From 117301515ca5aaa77e20b8d855543228a3fcf7df Mon Sep 17 00:00:00 2001 From: YAEGASHI Takeshi Date: Sun, 16 Feb 2014 18:19:31 +0900 Subject: Add postinst/postrm scripts diff --git a/debian/cgit.postinst b/debian/cgit.postinst new file mode 100644 index 0000000..2988dd6 --- /dev/null +++ b/debian/cgit.postinst @@ -0,0 +1,43 @@ +#!/bin/sh +# postinst script for cgit +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +cachedir=/var/cache/cgit + +case "$1" in + configure) + if test -d $cachedir; then + chown www-data.www-data $cachedir + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/cgit.postrm b/debian/cgit.postrm new file mode 100644 index 0000000..b58613e --- /dev/null +++ b/debian/cgit.postrm @@ -0,0 +1,44 @@ +#!/bin/sh +# postrm script for cgit +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +cachedir=/var/cache/cgit + +case "$1" in + purge|remove) + if test -d $cachedir; then + rm -rf $cachedir + fi + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 -- cgit v0.10.1