[arch-commits] Commit in git/trunk (4 files)

Dan McGee dan at archlinux.org
Thu Aug 16 14:44:33 UTC 2012


    Date: Thursday, August 16, 2012 @ 10:44:33
  Author: dan
Revision: 165367

upgpkg: git 1.7.11.5-2

* Add systemd support

Added:
  git/trunk/git-daemon.socket
  git/trunk/git-daemon at .service
  git/trunk/git.install
Modified:
  git/trunk/PKGBUILD

---------------------+
 PKGBUILD            |   15 ++++++++++++---
 git-daemon.socket   |   10 ++++++++++
 git-daemon at .service |   11 +++++++++++
 git.install         |   22 ++++++++++++++++++++++
 4 files changed, 55 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2012-08-16 14:41:50 UTC (rev 165366)
+++ PKGBUILD	2012-08-16 14:44:33 UTC (rev 165367)
@@ -3,7 +3,7 @@
 
 pkgname=git
 pkgver=1.7.11.5
-pkgrel=1
+pkgrel=2
 pkgdesc="the fast distributed version control system"
 arch=(i686 x86_64)
 url="http://git-scm.com/"
@@ -22,10 +22,13 @@
 replaces=('git-core')
 provides=('git-core')
 backup=('etc/conf.d/git-daemon.conf')
+install=git.install
 source=("http://git-core.googlecode.com/files/git-$pkgver.tar.gz"
         "http://git-core.googlecode.com/files/git-manpages-$pkgver.tar.gz"
         git-daemon
-        git-daemon.conf)
+        git-daemon.conf
+        git-daemon at .service
+        git-daemon.socket)
 changelog=ChangeLog
 
 build() {
@@ -98,9 +101,15 @@
   # git daemon script
   install -D -m755 "$srcdir"/git-daemon "$pkgdir"/etc/rc.d/git-daemon
   install -D -m644 "$srcdir"/git-daemon.conf "$pkgdir"/etc/conf.d/git-daemon.conf
+
+  # systemd stuff
+  install -D -m 644 "$srcdir"/git-daemon at .service "$pkgdir"/usr/lib/systemd/system/git-daemon at .service
+  install -D -m 644 "$srcdir"/git-daemon.socket "$pkgdir"/usr/lib/systemd/system/git-daemon.socket
 }
 
 md5sums=('9985d35c11531d546426ebefb327c847'
          'f08a5a60e57f00399bbd384cfd7791f3'
          '8e2648910fd5dd4f1c41d3c7fa9e9156'
-         '2e42bf97779a1c6411d89043334c9e78')
+         '2e42bf97779a1c6411d89043334c9e78'
+         '198ef9d9e79bd8d5868f95ed9f79cc34'
+         '779c00deb490291c6b477b8cc0161123')

Added: git-daemon.socket
===================================================================
--- git-daemon.socket	                        (rev 0)
+++ git-daemon.socket	2012-08-16 14:44:33 UTC (rev 165367)
@@ -0,0 +1,10 @@
+[Unit]
+Description=Git Daemon Socket
+After=network.target
+
+[Socket]
+ListenStream=9418
+Accept=true
+
+[Install]
+WantedBy=sockets.target

Added: git-daemon at .service
===================================================================
--- git-daemon at .service	                        (rev 0)
+++ git-daemon at .service	2012-08-16 14:44:33 UTC (rev 165367)
@@ -0,0 +1,11 @@
+[Unit]
+Description=Git Daemon Instance
+After=network.target
+
+[Service]
+User=git
+# The '-' is to ignore non-zero exit statuses
+ExecStart=-/usr/lib/git-core/git-daemon --inetd --export-all --base-path=/srv/git
+StandardInput=socket
+StandardOutput=inherit
+StandardError=journal

Added: git.install
===================================================================
--- git.install	                        (rev 0)
+++ git.install	2012-08-16 14:44:33 UTC (rev 165367)
@@ -0,0 +1,22 @@
+post_install() {
+  if ! getent group git >/dev/null; then
+    groupadd --system git 
+  fi
+  if ! getent passwd git >/dev/null; then
+    useradd --system -c 'git daemon user' -g git -d / -s /bin/bash git 
+    passwd -l git >/dev/null
+  fi
+}
+
+post_upgrade() {
+  post_install $1
+}
+
+post_remove() {
+  if getent passwd git >/dev/null; then
+    userdel git
+  fi
+  if getent group git >/dev/null; then
+    groupdel git
+  fi
+}




More information about the arch-commits mailing list