[DRE-commits] [redmine] 18/39: simplistic maintainer scripts
Antonio Terceiro
terceiro at moszumanska.debian.org
Tue Dec 8 12:56:49 UTC 2015
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository redmine.
commit 418b6956ff128ef6faa5b1908fb844236c80ef9d
Author: Antonio Terceiro <terceiro at debian.org>
Date: Mon Sep 28 15:20:05 2015 -0300
simplistic maintainer scripts
---
debian/config | 7 ++++++-
debian/postinst | 31 +++++++++++++++++++++++++++++++
debian/postrm | 10 ++++++++++
debian/prerm | 10 ++++++++++
4 files changed, 57 insertions(+), 1 deletion(-)
diff --git a/debian/config b/debian/config
index 2b7fc10..bed4075 100644
--- a/debian/config
+++ b/debian/config
@@ -3,4 +3,9 @@
set -e
. /usr/share/debconf/confmodule
-db_go
+
+if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
+ dbc_dbtypes="sqlite3, pgsql, mysql"
+ . /usr/share/dbconfig-common/dpkg/config
+ dbc_go redmine "$@"
+fi
diff --git a/debian/postinst b/debian/postinst
index 7d08391..8c635ce 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -4,4 +4,35 @@ set -e
. /usr/share/debconf/confmodule
+#######################################################################
+# update Gemfile.lock, always
+#######################################################################
+rm -f /var/lib/redmine/Gemfile.lock
+(cd /usr/share/redmine && bundle --local --quiet)
+chown www-data:www-data /var/lib/redmine/Gemfile.lock
+
+#######################################################################
+# manage database
+#######################################################################
+
+. /usr/share/dbconfig-common/dpkg/postinst
+
+dbc_generate_include=template:/etc/redmine/database.yml # FIXME
+dbc_generate_includ . /usr/share/dbconfig-common/dpkg/postinst e_args="-o template_infile=/usr/share/redmine/templates/database.yml.template" # FIXME
+dbc_generate_include_owner="root:www-data"
+dbc_generate_include_perms="640"
+dbc_dbfile_owner="root:www-data"
+dbc_dbuser=redmine # FIXME
+# this is for sqlite3 to be r/w for www-data
+dbc_dbfile_perms="0660"
+dbc_mysql_createdb_encoding="UTF8"
+dbc_pgsql_createdb_encoding="UTF8"
+dbc_dbname=redmine # FIXME
+
+dbc_go redmine "$@"
+if [ -f /etc/redmine/database.yml ]; then
+ sed -i -i 's/mysql/mysql2/g; s/pgsql/postgresql/g' /etc/redmine/database.yml # FIXME
+fi
+
+
##DEBHELPER##
diff --git a/debian/postrm b/debian/postrm
new file mode 100644
index 0000000..b3ba526
--- /dev/null
+++ b/debian/postrm
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
+ . /usr/share/dbconfig-common/dpkg/postrm
+ dbc_go
+fi
+
+##DEBHELPER##
diff --git a/debian/prerm b/debian/prerm
new file mode 100644
index 0000000..a03bbe8
--- /dev/null
+++ b/debian/prerm
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+if [ -f /usr/share/dbconfig-common/dpkg/prerm ]; then
+ . /usr/share/dbconfig-common/dpkg/prerm
+ dbc_go
+fi
+
+##DEBHELPER##
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/redmine.git
More information about the Pkg-ruby-extras-commits
mailing list