[DRE-commits] [diaspora] 134/257: add postinst script, create user, grant privs
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Sun Apr 12 14:17:15 UTC 2015
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository diaspora.
commit fb19fb36408470e69f5aa31e9fc028a16d518774
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Mon Nov 24 02:41:57 2014 +0530
add postinst script, create user, grant privs
---
debian/diaspora.config | 18 +++++++++++++++
debian/diaspora.postinst | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+)
diff --git a/debian/diaspora.config b/debian/diaspora.config
new file mode 100644
index 0000000..c0a7be8
--- /dev/null
+++ b/debian/diaspora.config
@@ -0,0 +1,18 @@
+#!/bin/sh
+# config maintainer script for gnukhata-core-engine
+
+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_dbname="diaspora"
+ dbc_dbuser="diaspora"
+
+ dbc_go diaspora $@
+fi
+
diff --git a/debian/diaspora.postinst b/debian/diaspora.postinst
new file mode 100755
index 0000000..c01ec40
--- /dev/null
+++ b/debian/diaspora.postinst
@@ -0,0 +1,60 @@
+#! /bin/sh
+# postinst script for gnukhata-core-engine
+# copied from postinst script for hplip
+# $Id: hplip.postinst,v 1.1 2005/10/15 21:39:04 hmh Exp $
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+# quoting from the policy:
+# Any necessary prompting should almost always be confined to the
+# post-installation script, and should be protected with a conditional
+# so that unnecessary prompting doesn't happen if a package's
+# installation fails and the `postinst' is called with `abort-upgrade',
+# `abort-remove' or `abort-deconfigure'.
+
+
+. /usr/share/debconf/confmodule
+. /usr/share/dbconfig-common/dpkg/postinst.pgsql
+
+dbc_dbname="diaspora"
+dbc_dbuser="diaspora"
+
+dbc_go diaspora $@
+
+case "$1" in
+ configure)
+
+ /usr/lib/diaspora/scripts/adduser.sh
+ /usr/lib/diaspora/scripts/grantpriv.sh
+ chown -R diaspora: /usr/share/diaspora
+ cd /usr/share/diaspora
+ sudo -u diaspora bundle install --local
+
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+db_stop
+
+
+exit 0
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/diaspora.git
More information about the Pkg-ruby-extras-commits
mailing list