From 93bcf936851d9e41289ac9b80830c91e45264d7f Mon Sep 17 00:00:00 2001 From: "J. King" Date: Wed, 7 Jul 2021 08:22:19 -0400 Subject: [PATCH] Prototype Debian maintainer scripts --- dist/debian/.gitignore | 2 +- dist/debian/arsse.config | 18 ++++++++++++++++++ dist/debian/arsse.postinst | 27 +++++++++++++++++++++++++++ dist/debian/arsse.postrm | 20 ++++++++++++++++++++ dist/debian/arsse.prerm | 16 ++++++++++++++++ 5 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 dist/debian/arsse.config create mode 100644 dist/debian/arsse.postinst create mode 100644 dist/debian/arsse.postrm create mode 100644 dist/debian/arsse.prerm diff --git a/dist/debian/.gitignore b/dist/debian/.gitignore index d8b7e4f3..e214825e 100644 --- a/dist/debian/.gitignore +++ b/dist/debian/.gitignore @@ -1,6 +1,6 @@ * !.gitignore -!arsse.install +!arsse.* !compat !control !copyright diff --git a/dist/debian/arsse.config b/dist/debian/arsse.config new file mode 100644 index 00000000..3ee1beb8 --- /dev/null +++ b/dist/debian/arsse.config @@ -0,0 +1,18 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule + +# Settings for dbconfig-common +dbc_authmethod_user=password +dbc_dbtypes="sqlite3, pgsql, mysql" + +# Do dbconfig-common magic +if test -f /usr/share/dbconfig-common/dpkg/config; then + . /usr/share/dbconfig-common/dpkg/config + dbc_go arsse "$@" +fi + +# Ask all the questions +db_go || true diff --git a/dist/debian/arsse.postinst b/dist/debian/arsse.postinst new file mode 100644 index 00000000..75a97af7 --- /dev/null +++ b/dist/debian/arsse.postinst @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule + +# Settings for dbconfig-common +dbc_generate_include_owner=root:www-data +dbc_generate_include_perms=0640 +dbc_generate_include=php:/var/lib/arsse/dbconfig.inc +dbc_pgsql_createdb_encoding="UTF8' lc_collate='C" +dbc_mysql_createdb_encoding="UTF8" +dbc_dbfile_owner=root:www-data +dbc_dbfile_perms=0660 + +# Do dbconfig-common installation stuff +if test -f /usr/share/dbconfig-common/dpkg/postinst; then + . /usr/share/dbconfig-common/dpkg/postinst + dbc_go arsse "$@" +fi + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/dist/debian/arsse.postrm b/dist/debian/arsse.postrm new file mode 100644 index 00000000..ad4a1874 --- /dev/null +++ b/dist/debian/arsse.postrm @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +if test -f /usr/share/debconf/confmodule; then + . /usr/share/debconf/confmodule +fi + +# Do dbconfig-common removal stuff +if test -f /usr/share/dbconfig-common/dpkg/postrm; then + . /usr/share/dbconfig-common/dpkg/postrm + dbc_go arsse "$@" +fi + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/dist/debian/arsse.prerm b/dist/debian/arsse.prerm new file mode 100644 index 00000000..67f60a4c --- /dev/null +++ b/dist/debian/arsse.prerm @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule + +# Do dbconfig-common prerm stuff +. /usr/share/dbconfig-common/dpkg/prerm +dbc_go arsse "$@" + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0