diff options
author | Andrew Dolgov <[email protected]> | 2011-11-11 00:02:53 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-11-11 00:02:53 +0400 |
commit | d0cafcf4a048bfcc72d9523d20d61ba719e566cd (patch) | |
tree | 8d99e9b8f7009076da1f507bde405d4d0f8cd865 /debian/tt-rss-pgsql.postinst | |
parent | 17140b71edaad9160742a33f094f94479bbbd573 (diff) |
add debianization scripts based on work by Florent USSEIL
Diffstat (limited to 'debian/tt-rss-pgsql.postinst')
-rw-r--r-- | debian/tt-rss-pgsql.postinst | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/debian/tt-rss-pgsql.postinst b/debian/tt-rss-pgsql.postinst new file mode 100644 index 000000000..7a0332779 --- /dev/null +++ b/debian/tt-rss-pgsql.postinst @@ -0,0 +1,57 @@ +#!/bin/sh +set -e + +PACKAGE=tt-rss-pgsql + +case "$1" in + configure) + + # source debconf stuff + if [ -f /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + fi + + # debconf messages + db_get $PACKAGE/webserver || true + WEBSERVER="$RET"; + + # webserver configuration + if $WEBSERVER; then + if [ ! -d /etc/apache2/conf.d/ ]; then + install -d -m755 /etc/apache2/conf.d/ + fi + + if [ ! -e /etc/apache2/conf.d/$PACKAGE.conf ]; then + ln -s /etc/$PACKAGE/apache.conf /etc/apache2/conf.d/$PACKAGE.conf + #sed -e "s#tt-rss/www#$PACKAGE/www#" -i /etc/$PACKAGE/apache.conf + fi + if apache2ctl configtest 2>/dev/null; then + invoke-rc.d apache2 force-reload || true + else + echo "apache need to be reload manualy" + fi + fi + + # dbconfig-common + . /usr/share/dbconfig-common/dpkg/postinst.pgsql + dbc_first_version="1.3.1" + dbc_generate_include="php:/etc/$PACKAGE/database.php" + dbc_generate_include_owner="root:www-data" + dbc_generate_include_perms="0640" + dbc_go $PACKAGE $@ + + echo "Install ok on http://localhost/tt-rss/tt-rss.php" + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +exit 0 + +#DEBHELPER# |