debian: remove dbconfig (#34084)
This commit is contained in:
parent
72321ffdb1
commit
6aa08af7fe
|
@ -1,5 +0,0 @@
|
|||
export DATABASE_ENGINE='django.db.backends.postgresql_psycopg2'
|
||||
export DATABASE_NAME='_DBC_DBNAME_'
|
||||
export DATABASE_USER='_DBC_DBUSER_'
|
||||
export DATABASE_PASSWORD='_DBC_DBPASS_'
|
||||
export DATABASE_HOST='localhost'
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
# config maintainer script for foo-pgsql
|
||||
|
||||
set -e
|
||||
|
||||
# source debconf stuff
|
||||
. /usr/share/debconf/confmodule
|
||||
# source dbconfig-common shell library, and call the hook function
|
||||
if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
|
||||
. /usr/share/dbconfig-common/dpkg/config.pgsql
|
||||
dbc_go docbow $@
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
|
@ -14,7 +14,7 @@ X-Python-Version: >= 2.7
|
|||
|
||||
Package: docbow
|
||||
Architecture: all
|
||||
Pre-depends: dbconfig-common, postgresql
|
||||
Pre-depends: postgresql
|
||||
Depends: ${misc:Depends}, python (>= 2.6),
|
||||
python-django (>= 1.8),
|
||||
python-django (<< 1.9),
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
debian/conf/docbow.nginx /etc/nginx/sites-available/
|
||||
debian/conf/db.template /usr/share/docbow
|
||||
debian/conf/magic /usr/share/docbow
|
||||
debian/debian_config.py /usr/lib/docbow
|
||||
|
|
|
@ -10,9 +10,6 @@ USER=$NAME
|
|||
GROUP=$NAME
|
||||
HOME=/var/lib/$NAME
|
||||
|
||||
# source debconf stuff
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
if ! getent group $GROUP > /dev/null 2>&1; then
|
||||
|
@ -36,6 +33,16 @@ case "$1" in
|
|||
echo "..done" >&2
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/$NAME/db" ]; then
|
||||
cat > /etc/$NAME/db <<EOC
|
||||
export DATABASE_ENGINE='django.db.backends.postgresql_psycopg2'
|
||||
export DATABASE_NAME='docbow'
|
||||
export DATABASE_USER='docbow'
|
||||
export DATABASE_PASSWORD='SOME_PASSWORD'
|
||||
export DATABASE_HOST='localhost'
|
||||
EOC
|
||||
fi
|
||||
|
||||
chown $USER:$GROUP /var/lib/docbow \
|
||||
/var/lib/docbow/static \
|
||||
/var/lib/docbow/collectstatic \
|
||||
|
@ -43,17 +50,6 @@ case "$1" in
|
|||
/var/lib/docbow/media \
|
||||
/var/run/docbow \
|
||||
/var/log/docbow
|
||||
|
||||
# source dbconfig-common shell library, and call the hook function
|
||||
if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
|
||||
. /usr/share/dbconfig-common/dpkg/postinst.pgsql
|
||||
dbc_generate_include="template:/etc/docbow/db"
|
||||
dbc_generate_include_args="-o template_infile=/usr/share/docbow/db.template -U"
|
||||
dbc_generate_include_owner="root:docbow"
|
||||
dbc_generate_include_perms="640"
|
||||
dbc_pgsql_createdb_encoding="UTF8"
|
||||
dbc_go docbow $@
|
||||
fi
|
||||
;;
|
||||
|
||||
reconfigure|abort-upgrade|abort-remove|abort-deconfigure)
|
||||
|
@ -65,8 +61,6 @@ case "$1" in
|
|||
;;
|
||||
esac
|
||||
|
||||
db_stop
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
|
|
|
@ -12,21 +12,6 @@ GROUP=$NAME
|
|||
case "$1" in purge)
|
||||
deluser --quiet --system $NAME > /dev/null || true
|
||||
rm -rf /var/lib/$NAME/collectstatic
|
||||
# source debconf stuff
|
||||
. /usr/share/debconf/confmodule
|
||||
# source dbconfig-common shell library, and call the hook function
|
||||
if [ -f /usr/share/dbconfig-common/dpkg/postrm.pgsql ]; then
|
||||
. /usr/share/dbconfig-common/dpkg/postrm.pgsql
|
||||
dbc_go $NAME $@
|
||||
fi
|
||||
|
||||
DBCONF=/etc/$NAME/db
|
||||
if [ "$1" = "purge" ]; then
|
||||
rm -f $DBCONF
|
||||
if which ucf >/dev/null 2>&1; then
|
||||
ucf --purge $DBCONF
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
Loading…
Reference in New Issue