Skip to content
Commits on Source (17)
FROM ubuntu:16.04
FROM ubuntu:18.04
MAINTAINER Vaclav Petras <wenzeslaus@gmail.com>
LABEL authors="Vaclav Petras,Markus Neteler"
LABEL maintainer="wenzeslaus@gmail.com,neteler@osgeo.org"
# system environment
ENV DEBIAN_FRONTEND noninteractive
......@@ -10,13 +11,8 @@ ENV DATA_DIR /data
# GRASS GIS compile dependencies
RUN apt-get update \
&& apt-get install -y --install-recommends \
autoconf2.13 \
autotools-dev \
bison \
flex \
g++ \
gettext \
&& apt-get install -y --no-install-recommends --no-install-suggests \
build-essential \
libblas-dev \
libbz2-dev \
libcairo2-dev \
......@@ -25,11 +21,15 @@ RUN apt-get update \
libgdal-dev \
libgeos-dev \
libglu1-mesa-dev \
libgsl0-dev \
libjpeg-dev \
liblapack-dev \
liblas-dev \
liblas-c-dev \
libncurses5-dev \
libnetcdf-dev \
libopenjp2-7 \
libopenjp2-7-dev \
libpng-dev \
libpq-dev \
libproj-dev \
......@@ -37,20 +37,34 @@ RUN apt-get update \
libsqlite3-dev \
libtiff-dev \
libxmu-dev \
bison \
flex \
g++ \
gettext \
gdal-bin \
libfftw3-bin \
make \
ncurses-bin \
netcdf-bin \
proj-bin \
proj-data \
python \
python-dev \
python-numpy \
python-pil \
python-ply \
sqlite3 \
subversion \
unixodbc-dev \
zlib1g-dev \
&& apt-get autoremove \
&& apt-get clean && \
mkdir -p $DATA_DIR
RUN echo LANG="en_US.UTF-8" > /etc/default/locale
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
RUN mkdir /code
RUN mkdir /code/grass
......@@ -59,36 +73,58 @@ COPY . /code/grass
WORKDIR /code/grass
# install GRASS GIS
# Set gcc/g++ environmental variables for GRASS GIS compilation, without debug symbols
ENV MYCFLAGS "-O2 -march=native -std=gnu99 -m64"
ENV MYLDFLAGS "-s"
# CXX stuff:
ENV LD_LIBRARY_PATH "/usr/local/lib"
ENV LDFLAGS "$MYLDFLAGS"
ENV CFLAGS "$MYCFLAGS"
ENV CXXFLAGS "$MYCXXFLAGS"
# Configure, compile and install GRASS GIS
ENV NUMTHREADS=2
RUN ./configure \
--enable-largefile=yes \
--with-nls \
--enable-largefile \
--with-cxx \
--with-nls \
--with-readline \
--with-sqlite \
--with-bzlib \
--with-pthread \
--with-proj-share=/usr/share/proj \
--with-cairo --with-cairo-ldflags=-lfontconfig \
--with-freetype --with-freetype-includes="/usr/include/freetype2/" \
--with-fftw \
--with-netcdf \
--with-liblas --with-liblas-config=/usr/bin/liblas-config \
--with-proj --with-proj-share=/usr/share/proj \
--with-geos=/usr/bin/geos-config \
--with-cairo \
--with-postgres --with-postgres-includes="/usr/include/postgresql" \
--with-opengl-libs=/usr/include/GL \
--with-freetype=yes --with-freetype-includes="/usr/include/freetype2/" \
--with-sqlite=yes \
--with-liblas=yes --with-liblas-config=/usr/bin/liblas-config \
&& make -j2 && make install && ldconfig
&& make -j $NUMTHREADS && make install && ldconfig
# enable simple grass command regardless of version number
RUN ln -s /usr/local/bin/grass* /usr/local/bin/grass
# Reduce the image size
RUN apt-get autoremove -y
RUN apt-get clean -y
# set SHELL var to avoid /bin/sh fallback in interactive GRASS GIS sessions in docker
ENV SHELL /bin/bash
# Fix permissions
RUN chmod -R a+rwx $DATA_DIR
# create a user
RUN useradd -m -U grass
# declare volume late so permissions apply
# declare data volume late so permissions apply
VOLUME $DATA_DIR
WORKDIR $DATA_DIR
# Further reduce the docker image size
RUN rm -rf /code/grass
# switch the user
USER grass
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -69,17 +69,28 @@ int main(int argc, char *argv[])
def->description = _("Overwrite current settings if already initialized");
def->guisection = _("Set");
/* the default answers below are GRASS default settings,
* not current settings */
driver = G_define_standard_option(G_OPT_DB_DRIVER);
driver->options = db_list_drivers();
driver->answer = (char *) db_get_default_driver_name();
if (strcmp(DB_DEFAULT_DRIVER, "sqlite") == 0) {
driver->answer = "sqlite";
}
else {
driver->answer = "dbf";
}
driver->guisection = _("Set");
database = G_define_standard_option(G_OPT_DB_DATABASE);
database->answer = (char *) db_get_default_database_name();
if (strcmp(DB_DEFAULT_DRIVER, "sqlite") == 0) {
database->answer = "$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db";
}
else {
database->answer = "$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/";
}
database->guisection = _("Set");
schema = G_define_standard_option(G_OPT_DB_SCHEMA);
schema->answer = (char *) db_get_default_schema_name();
schema->guisection = _("Set");
group = G_define_option();
......@@ -87,7 +98,6 @@ int main(int argc, char *argv[])
group->type = TYPE_STRING;
group->required = NO;
group->multiple = NO;
group->answer = (char*) db_get_default_group_name();
group->description = _("Default group of database users to which "
"select privilege is granted");
group->guisection = _("Set");
......@@ -179,7 +189,6 @@ int main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
if (def->answer) {
db_set_default_connection();
db_get_connection(&conn);
......@@ -191,8 +200,8 @@ int main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
/* set connection */
db_get_connection(&conn); /* read current */
/* do not read current, set new connection from options */
G_zero(&conn, sizeof(dbConnection));
if (driver->answer)
conn.driverName = driver->answer;
......@@ -207,7 +216,12 @@ int main(int argc, char *argv[])
conn.group = group->answer;
db_set_connection(&conn);
/* check */
if (db_get_connection(&conn) != DB_OK) {
G_fatal_error(_("Unable to set default database connection"));
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
}
......
......@@ -80,6 +80,18 @@ int main(int argc, char **argv)
/* parms.sql */
db_set_string(&stmt, parms.sql);
ret = db_execute_immediate(driver, &stmt);
if (ret != DB_OK) {
if (parms.i) { /* ignore SQL errors */
G_warning(_("Error while executing: '%s'"),
db_get_string(&stmt));
error++;
}
else {
G_fatal_error(_("Error while executing: '%s'"),
db_get_string(&stmt));
}
}
}
else { /* parms.input */
while (get_stmt(fd, &stmt)) {
......
......@@ -19,6 +19,23 @@ db.connect -p
db.tables -p
</pre></div>
<h3>Username and password</h3>
From the <a href="https://www.postgresql.org/docs/10/static/libpq-pgpass.html">PostgresQL manual</a>:
<p>
The file <em>.pgpass</em> in a user's home directory can contain
passwords to be used if the connection requires a password (and no
password has been specified otherwise). On Microsoft Windows the file
is named <em>%APPDATA%\postgresql\pgpass.conf</em> (where
<em>%APPDATA%</em> refers to the Application Data subdirectory in the
user's profile). Alternatively, a password file can be specified using
the connection parameter passfile or the environment variable
PGPASSFILE.
This file should contain lines of the following format:
<div class="code"><pre>
hostname:port:database:username:password
</pre></div>
<h2>Supported SQL commands</h2>
......@@ -132,4 +149,4 @@ driver documentation</a></li>
</ul>
<p>
<i>Last changed: $Date: 2017-11-12 13:26:52 +0100 (Sun, 12 Nov 2017) $</i>
<i>Last changed: $Date: 2018-07-15 20:38:37 +0200 (Sun, 15 Jul 2018) $</i>
grass (7.4.2~rc1-1~exp1~xenial1) xenial; urgency=medium
* Rebuild for xenial.
* Remove libomp-dev dependency.
-- Martin Landa <landa.martin@gmail.com> Sun, 30 Sep 2018 15:53:56 +0200
grass (7.4.2~rc1-1~exp1) experimental; urgency=medium
* New upstream release candidate.
* Bump Standards-Version to 4.2.1, no changes.
* Enable OpenMP support.
-- Bas Couwenberg <sebastic@debian.org> Sat, 29 Sep 2018 09:02:45 +0200
grass (7.4.1-1~xenial2) xenial; urgency=medium
* Rebuild for xenial.
......@@ -5,12 +20,28 @@ grass (7.4.1-1~xenial2) xenial; urgency=medium
-- Martin Landa <landa.martin@gmail.com> Sun, 16 Sep 2018 11:03:59 +0200
grass (7.4.1-3) unstable; urgency=medium
* Disable PIE only on older Ubuntu releases.
* Bump Standards-Version to 4.1.5, no changes.
* Drop autopkgtest to test installability.
* Add lintian override for testsuite-autopkgtest-missing.
* Add overrides for package-contains-documentation-outside-usr-share-doc.
-- Bas Couwenberg <sebastic@debian.org> Tue, 31 Jul 2018 18:29:08 +0200
grass (7.4.1-1~xenial1) xenial; urgency=medium
* Rebuild for xenial.
-- Martin Landa <landa.martin@gmail.com> Wed, 13 Jun 2018 22:45:04 +0200
grass (7.4.1-2) unstable; urgency=medium
* Actually move from experimental to unstable.
-- Bas Couwenberg <sebastic@debian.org> Wed, 13 Jun 2018 01:50:48 +0200
grass (7.4.1-1) experimental; urgency=medium
* New upstream release.
......
This diff is collapsed.
......@@ -49,3 +49,6 @@ grass-core: extra-license-file usr/share/doc/grass-core/COPYING
# Python 3 not supported yet
grass-core: dependency-on-python-version-marked-for-end-of-life (Depends: python)
# Not a problem
grass-core: package-contains-documentation-outside-usr-share-doc usr/lib/grass*/etc/license
# Python 3 not supported yet
grass-gui: dependency-on-python-version-marked-for-end-of-life (Depends: python)
# Not a problem
grass-gui: package-contains-documentation-outside-usr-share-doc usr/lib/grass*/gui/wxpython/README
This diff is collapsed.
# Not worth the effort
testsuite-autopkgtest-missing
# Test installability
Depends: @
Test-Command: /bin/true
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.