summarylogtreecommitdiffstats
path: root/p4d.install
diff options
context:
space:
mode:
authorvlad2015-07-08 15:42:04 +0300
committervlad2015-07-08 15:42:04 +0300
commit78eb6cbe4788691ac2c11e22000000fe81bb1a2b (patch)
tree01881748b18038a913defce26699cf11406da466 /p4d.install
downloadaur-78eb6cbe4788691ac2c11e22000000fe81bb1a2b.tar.gz
Initial import
Diffstat (limited to 'p4d.install')
-rw-r--r--p4d.install27
1 files changed, 27 insertions, 0 deletions
diff --git a/p4d.install b/p4d.install
new file mode 100644
index 000000000000..6c134b4a1ad7
--- /dev/null
+++ b/p4d.install
@@ -0,0 +1,27 @@
+# Package p4d
+# Maintainer: Andrew Boktor andrew dot boktor at gmail dot come
+post_install(){
+ groupadd p4admin &>/dev/null
+ useradd -g p4admin -d /var/lib/perforce -s /bin/false perforce &>/dev/null
+ echo ":: Configuration in /etc/p4d.conf"
+ echo ":: Change ownership of files in \$P4ROOT and \$P4LOG to perforce:p4admin"
+}
+
+post_upgrade(){
+ getent group p4admin >/dev/null 2>&1 || groupadd p4admin &>/dev/null
+ getent passwd perforce >/dev/null 2>&1 || useradd -g perforce -d /var/lib/perforce \
+ -s /bin/false perforce &>/dev/null
+ if [[ "$(vercmp $2 2014.2.978861-4)" -lt 0 ]]; then
+ echo ":: perforce now is run as the \"perforce\" user"
+ echo ":: Change ownership of files in \$P4ROOT and \$P4LOG to perforce:p4admin"
+ fi
+}
+
+post_remove(){
+ if getent passwd perforce >/dev/null 2>&1; then
+ userdel perforce
+ fi
+ if getent group p4admin >/dev/null 2>&1; then
+ groupdel p4admin
+ fi
+}