gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-sync] 01/03: fix debian package, in particular DB setup


From: gnunet
Subject: [taler-sync] 01/03: fix debian package, in particular DB setup
Date: Mon, 20 Jun 2022 22:12:54 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository sync.

commit 67d9eff0193a5ebc360a4200fa560d883177068f
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Jun 20 22:09:35 2022 +0200

    fix debian package, in particular DB setup
---
 debian/changelog                            |  6 ++++++
 debian/control                              | 25 ++++++++++++-------------
 debian/db/install/pgsql                     |  2 +-
 debian/etc/sync/override.conf               |  2 --
 debian/etc/sync/secrets/sync-db.secret.conf |  3 ---
 debian/rules                                |  5 +++++
 debian/sync-httpd.config                    |  1 -
 debian/sync-httpd.install                   |  7 +++++--
 debian/sync-httpd.postinst                  | 16 ++++++++++++++++
 debian/sync-httpd.postrm                    |  1 +
 debian/sync-httpd.prerm                     |  4 ++++
 11 files changed, 50 insertions(+), 22 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index cb9f177..52acf75 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+sync (0.9.0) unstable; urgency=low
+
+  * Updating to latest pre-release from Git.
+
+ -- Christian Grothoff <grothoff@taler.net>  Mon, 20 Jun 2022 13:12:58 +0200
+
 sync (0.8.3) unstable; urgency=medium
 
   * Initial Debian package.
diff --git a/debian/control b/debian/control
index d951a91..13193fe 100644
--- a/debian/control
+++ b/debian/control
@@ -8,16 +8,14 @@ Build-Depends:
  autopoint,
  debhelper-compat (= 12),
  gettext,
- libgnunet-dev,
- libtalerexchange-dev (>= 0.8.5),
- libtalermerchant-dev (>= 0.8.4),
- libpq-dev (>=9.5),
+ libgnunet-dev (>=0.17.0),
+ libtalerexchange-dev (>= 0.9.0),
+ libtalermerchant-dev (>= 0.9.0),
+ libpq-dev (>=13.0),
  pkg-config,
  po-debconf,
- zlib1g-dev
-Build-Conflicts:
- autoconf2.13,
- automake1.4
+ zlib1g-dev,
+ texinfo
 Standards-Version: 4.5.0
 Vcs-Git: https://salsa.debian.org/debian/sync.git
 Vcs-browser: https://salsa.debian.org/debian/sync
@@ -39,12 +37,13 @@ Architecture: any
 Pre-Depends:
  ${misc:Pre-Depends}
 Depends:
- libtalerexchange (>= 0.8.4),
- libtalermerchant (>= 0.8.3),
+ libtalerexchange (>= 0.9.0),
+ libtalermerchant (>= 0.9.0),
  libgnutls30 (>= 3.7.1),
  adduser,
  lsb-base,
  netbase,
+ sudo,
  apache2 | nginx | httpd,
  postgresql,
  dbconfig-pgsql | dbconfig-no-thanks,
@@ -56,9 +55,9 @@ Package: libsync-dev
 Section: libdevel
 Architecture: any
 Depends:
- libtalermerchant-dev (>= 0.8.3),
- libtalerexchange-dev (>= 0.8.4),
- libgnunet-dev (>=0.15.3),
+ libtalermerchant-dev (>= 0.9.0),
+ libtalerexchange-dev (>= 0.9.0),
+ libgnunet-dev (>=0.17.0),
  ${misc:Depends},
  ${shlibs:Depends}
 Description: libraries to talk to a Sync provider (development)
diff --git a/debian/db/install/pgsql b/debian/db/install/pgsql
index f24927b..47c2dc7 100755
--- a/debian/db/install/pgsql
+++ b/debian/db/install/pgsql
@@ -17,7 +17,7 @@ if [ -f /etc/dbconfig-common/sync-httpd.conf ]; then
       $conf_sync_db
 
     # Allow the taler-merchant-httpd user to create schemas, needed by dbinit
-    echo "GRANT CREATE on database \"$dbc_dbname\" to \"sync-httpd\";" | sudo 
-u postgres psql -f -
+    echo "GRANT CREATE ON DATABASE \"${dbc_dbname}\" TO \"sync-httpd\";" | 
sudo -u postgres psql -f -
     # Run database initialization logic
     sudo -u sync-httpd sync-dbinit -c /etc/sync/sync.conf
     ;;
diff --git a/debian/etc/sync/override.conf b/debian/etc/sync/override.conf
deleted file mode 100644
index 7392b1a..0000000
--- a/debian/etc/sync/override.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# Do not edit by hand.
-# This file is used by tooling to override configuration settings.
diff --git a/debian/etc/sync/secrets/sync-db.secret.conf 
b/debian/etc/sync/secrets/sync-db.secret.conf
deleted file mode 100644
index 742d509..0000000
--- a/debian/etc/sync/secrets/sync-db.secret.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-[syncdb-postgres]
-#The connection string the plugin has to use for connecting to the database
-CONFIG = postgres:///sync
diff --git a/debian/rules b/debian/rules
index 17e3c0b..d33da79 100755
--- a/debian/rules
+++ b/debian/rules
@@ -30,6 +30,11 @@ override_dh_auto_install-indep:
 override_dh_auto_clean:
        dh_auto_clean
 
+override_dh_installsystemd:
+       dh_installsystemd -psync-httpd --name=sync-httpd --no-start --no-enable
+       # final invocation to generate daemon reload
+       dh_installsystemd
+
 override_dh_install:
        dh_install
 # Done manually for debhelper-compat<13
diff --git a/debian/sync-httpd.config b/debian/sync-httpd.config
index 63f7a0a..36e67d1 100644
--- a/debian/sync-httpd.config
+++ b/debian/sync-httpd.config
@@ -10,7 +10,6 @@ _GROUPNAME=www-data
 # For now, we only support postgres
 dbc_dbtypes=pgsql
 dbc_dbuser=${_USERNAME}
-dbc_dbname="sync"
 
 dbc_authmethod_user=ident
 dbc_authmethod_admin=ident
diff --git a/debian/sync-httpd.install b/debian/sync-httpd.install
index 19b55db..17e4ce9 100644
--- a/debian/sync-httpd.install
+++ b/debian/sync-httpd.install
@@ -3,7 +3,10 @@ usr/lib/*/libsyncdb.so.*
 usr/lib/*/sync/libsync_plugin*.*
 usr/share/sync/sql/*
 usr/share/sync/config.d/*
-debian/etc/* /etc/
-debian/db/install/* usr/share/dbconfig-common/scripts/sync/install/
 usr/share/man/man1/sync-dbinit.1
 usr/share/man/man1/sync-httpd.1
+
+debian/etc/* /etc/
+
+# Files needed by dbconf
+debian/db/install/* usr/share/dbconfig-common/scripts/sync-httpd/install/
diff --git a/debian/sync-httpd.postinst b/debian/sync-httpd.postinst
index 60393ad..9eaddab 100644
--- a/debian/sync-httpd.postinst
+++ b/debian/sync-httpd.postinst
@@ -2,6 +2,22 @@
 
 set -e
 
+if [ -d /run/systemd/system ]; then
+        systemctl --system daemon-reload >/dev/null || true
+fi
+if [ "$1" = "remove" ]; then
+        if [ -x "/usr/bin/deb-systemd-helper" ]; then
+                deb-systemd-helper mask 'sync-httpd.service' >/dev/null || true
+        fi
+fi
+
+if [ "$1" = "purge" ]; then
+        if [ -x "/usr/bin/deb-systemd-helper" ]; then
+                deb-systemd-helper purge 'sync-httpd.service' >/dev/null || 
true
+                deb-systemd-helper unmask 'sync-httpd.service' >/dev/null || 
true
+        fi
+fi
+
 SYNC_HOME="/var/lib/sync/"
 _USERNAME=sync-httpd
 _GROUPNAME=www-data
diff --git a/debian/sync-httpd.postrm b/debian/sync-httpd.postrm
index 1cd85bc..79934a8 100644
--- a/debian/sync-httpd.postrm
+++ b/debian/sync-httpd.postrm
@@ -14,6 +14,7 @@ fi
 case "${1}" in
 purge)
   rm -rf /var/lib/sync/httpd/
+  rm -f /etc/sync/override.conf
   ;;
 remove | upgrade | failed-upgrade | abort-install | abort-upgrade | disappear)
   ;;
diff --git a/debian/sync-httpd.prerm b/debian/sync-httpd.prerm
index 24bed99..0c134b2 100644
--- a/debian/sync-httpd.prerm
+++ b/debian/sync-httpd.prerm
@@ -2,6 +2,10 @@
 
 set -e
 
+if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
+        deb-systemd-invoke stop 'sync-httpd.service' >/dev/null || true
+fi
+
 if [ -f /usr/share/debconf/confmodule ]; then
   . /usr/share/debconf/confmodule
 fi

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]