summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlad2015-07-08 15:42:04 +0300
committervlad2015-07-08 15:42:04 +0300
commit78eb6cbe4788691ac2c11e22000000fe81bb1a2b (patch)
tree01881748b18038a913defce26699cf11406da466
downloadaur-78eb6cbe4788691ac2c11e22000000fe81bb1a2b.tar.gz
Initial import
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD27
-rw-r--r--p4d.conf3
-rw-r--r--p4d.install27
-rw-r--r--p4d.service16
5 files changed, 91 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..ef1aaf507ca
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = p4d
+ pkgdesc = Perforce Server
+ pkgver = 2014.2.1033284
+ pkgrel = 1
+ url = http://www.perforce.com
+ install = p4d.install
+ arch = x86_64
+ license = custom:p4d
+ backup = etc/p4d.conf
+ source = http://www.perforce.com/downloads/perforce/r14.2/bin.linux26/p4d
+ source = p4d.service
+ source = p4d.conf
+ sha1sums = 92f2f2847b32c0669c1a187dbfe4fc48de3c8b90
+ sha1sums = 8033b7c40f9ff96578f220bf0c27e51788eec661
+ sha1sums = 85ebc96e2c678020308de6985d9e5e53aedbf49c
+
+pkgname = p4d
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..8dad9d8fa24
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,27 @@
+# Package p4d
+# Maintainer: Andrew Boktor andrew dot boktor at gmail dot com
+pkgname=p4d
+pkgver=2014.2.1033284
+pkgrel=1
+pkgdesc="Perforce Server"
+arch=('x86_64')
+url="http://www.perforce.com"
+license=('custom:p4d')
+depends=()
+backup=('etc/p4d.conf')
+install=p4d.install
+source=(
+ http://www.perforce.com/downloads/perforce/r${pkgver:2:4}/bin.linux26${CARCH}/${pkgname}
+ p4d.service
+ p4d.conf
+ )
+
+sha1sums=('92f2f2847b32c0669c1a187dbfe4fc48de3c8b90'
+ '8033b7c40f9ff96578f220bf0c27e51788eec661'
+ '85ebc96e2c678020308de6985d9e5e53aedbf49c')
+
+package() {
+ install -Dm755 ${pkgname} ${pkgdir}/usr/bin/${pkgname}
+ install -Dm644 p4d.service ${pkgdir}/usr/lib/systemd/system/p4d.service
+ install -Dm644 p4d.conf ${pkgdir}/etc/p4d.conf
+}
diff --git a/p4d.conf b/p4d.conf
new file mode 100644
index 00000000000..b66d1dba42d
--- /dev/null
+++ b/p4d.conf
@@ -0,0 +1,3 @@
+P4ROOT=/home/p4/perforce
+P4PORT=1666
+P4LOG=/var/log/p4d.log
diff --git a/p4d.install b/p4d.install
new file mode 100644
index 00000000000..6c134b4a1ad
--- /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
+}
diff --git a/p4d.service b/p4d.service
new file mode 100644
index 00000000000..de69384f439
--- /dev/null
+++ b/p4d.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Perforce Server
+Requires=network.target local-fs.target
+After=network.target local-fs.target
+
+[Service]
+Type=forking
+User=perforce
+EnvironmentFile=-/etc/p4d.conf
+ExecStart=/usr/bin/p4d -d
+ExecStop=/usr/bin/killall p4d
+Restart=on-failure
+RestartSec=10
+
+[Install]
+WantedBy=multi-user.target