diff options
author | Peter Hoeg | 2015-10-09 19:40:07 +0800 |
---|---|---|
committer | Peter Hoeg | 2015-10-09 19:40:07 +0800 |
commit | f7798d8c6ea9e9db2276036646ab205fe2cb9aff (patch) | |
tree | 64420f3082c00ada2b21a12da2cbd63396bb625b | |
parent | 47203394a7672e2afd90e5150402fab823ee612f (diff) | |
download | aur-f7798d8c6ea9e9db2276036646ab205fe2cb9aff.tar.gz |
upgpkg: glpi 0.85.5-2
service units so it now works out of the box
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | PKGBUILD | 40 | ||||
-rw-r--r-- | glpi-cron.service | 6 | ||||
-rw-r--r-- | glpi-cron.timer | 8 | ||||
-rw-r--r-- | glpi.install | 16 | ||||
-rw-r--r-- | glpi.service | 10 |
6 files changed, 82 insertions, 13 deletions
@@ -1,18 +1,27 @@ pkgbase = glpi pkgdesc = GLPI Inventory Management pkgver = 0.85.5 - pkgrel = 1 + pkgrel = 2 url = http://www.glpi-project.org + install = glpi.install arch = any license = GPL - depends = nginx depends = mysql depends = php + optdepends = nginx: a more performant webserver + optdepends = apache: a more performant webserver options = !strip + backup = etc/glpi/config_db.php source = https://forge.glpi-project.org/attachments/download/2093/glpi-0.85.5.tar.gz + source = glpi.install source = glpi.service + source = glpi-cron.service + source = glpi-cron.timer sha256sums = 6dee0ca3dc01f0aece2b91302c42e790749f02c0a3603d20385da9b663474309 - sha256sums = 2df019c2eada4bf8a31ee3fbb77e25f1e15882129bea19ebaabfbdddce8131b3 + sha256sums = 6bdb13bca4392899f64038f0cea82a3a12289ea177a92c44922d012c2ee04f3d + sha256sums = c5ca6a8d1bcc73c71348d5f8a4c3de0fd023c346d1c2bf02c9dd627bcda9bfe8 + sha256sums = 6b515c1c8cc44ef703fe01e53b64d6aea56ed1c833b3553233482437478d4e77 + sha256sums = eea9489db1fa8f4762957eb6299dd22ca43c25f9dc62628c973a53cbcfdbab1f pkgname = glpi @@ -2,34 +2,56 @@ pkgname=glpi pkgver=0.85.5 -pkgrel=1 +pkgrel=2 pkgdesc="GLPI Inventory Management" arch=('any') url=('http://www.glpi-project.org') source=("https://forge.glpi-project.org/attachments/download/2093/glpi-${pkgver}.tar.gz" - 'glpi.service') + 'glpi.install' + 'glpi.service' + 'glpi-cron.service' + 'glpi-cron.timer') license=('GPL') options=(!strip) -depends=(nginx mysql php) +depends=(mysql php) +backup=(etc/glpi/config_db.php) +optdepends=('nginx: a more performant webserver' + 'apache: a more performant webserver') sha256sums=('6dee0ca3dc01f0aece2b91302c42e790749f02c0a3603d20385da9b663474309' - '2df019c2eada4bf8a31ee3fbb77e25f1e15882129bea19ebaabfbdddce8131b3') + '6bdb13bca4392899f64038f0cea82a3a12289ea177a92c44922d012c2ee04f3d' + 'c5ca6a8d1bcc73c71348d5f8a4c3de0fd023c346d1c2bf02c9dd627bcda9bfe8' + '6b515c1c8cc44ef703fe01e53b64d6aea56ed1c833b3553233482437478d4e77' + 'eea9489db1fa8f4762957eb6299dd22ca43c25f9dc62628c973a53cbcfdbab1f') +install=glpi.install package() { - _base=$pkgdir/usr/share/webapps/glpi cd $srcdir/glpi || exit + + _base=$pkgdir/usr/share/webapps/glpi + mkdir -p \ - $pkgdir/usr/lib/systemd/user \ + $pkgdir/usr/lib/systemd/system \ + $pkgdir/etc \ + $pkgdir/var/lib \ $pkgdir/usr/share/doc/glpi \ $_base - cp $srcdir/glpi.service $pkgdir/usr/lib/systemd/user + cp $srcdir/glpi*.{service,timer} $pkgdir/usr/lib/systemd/system mv *.txt $pkgdir/usr/share/doc/glpi cp -r * $_base + mv $_base/config $pkgdir/etc/glpi + ln -s /etc/glpi $_base/config + + mv $_base/files $pkgdir/var/lib/glpi + ln -s /var/lib/glpi $_base/files + + find $pkgdir -name remove.txt -delete + find $pkgdir -type d | xargs chmod 755 find $pkgdir -type f | xargs chmod 644 - find $_base/{files,config} -type d | xargs chmod 777 - find $_base -name '*.sh' | xargs chmod 755 + find $_base/scripts -name '*.sh' | xargs chmod 755 + find $_base/scripts -name '*.sh' | xargs sed -i 's/YOURSERVER/localhost:8080/' } diff --git a/glpi-cron.service b/glpi-cron.service new file mode 100644 index 000000000000..4565207dbafa --- /dev/null +++ b/glpi-cron.service @@ -0,0 +1,6 @@ +[Unit] +Description=Simulate GLPI Cron + +[Service] +Type=oneshot +ExecStart=/usr/share/webapps/glpi/scripts/glpi_cron_curl.sh diff --git a/glpi-cron.timer b/glpi-cron.timer new file mode 100644 index 000000000000..e21511d6a03f --- /dev/null +++ b/glpi-cron.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Timer for GLPI + +[Timer] +OnUnitInactiveSec=1h + +[Install] +WantedBy=timers.target diff --git a/glpi.install b/glpi.install new file mode 100644 index 000000000000..7bff090eefa3 --- /dev/null +++ b/glpi.install @@ -0,0 +1,16 @@ +post_install() { + groupadd --system glpi + useradd --system \ + --home-dir /var/lib/glpi \ + --shell /usr/bin/nologin \ + --gid glpi \ + glpi + + chown -R glpi:glpi /var/lib/glpi /etc/glpi +} + +post_remove() { + userdel glpi +} + +# vim:set ts=2 sw=2 et: diff --git a/glpi.service b/glpi.service index 64781b09708c..4dc8afc70095 100644 --- a/glpi.service +++ b/glpi.service @@ -2,5 +2,13 @@ Description=GLPI [Service] +User=glpi WorkingDirectory=/usr/share/webapps/glpi -ExecStart=/usr/bin/php -S localhost:8080 +ExecStart=/usr/bin/php -S localhost:8080 +PrivateTmp=yes +ProtectHome=yes +ProtectSystem=yes +Restart=on-failure + +[Install] +WantedBy=multi-user.target |