Skip to content

Instantly share code, notes, and snippets.

@sschober
Created July 6, 2011 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sschober/1067258 to your computer and use it in GitHub Desktop.
Save sschober/1067258 to your computer and use it in GitHub Desktop.
Archlinux AUR nss-ldapd PKGBUILD fix
From 8f2172e2a7dfdd970ebcc6a5bb56735f02690870 Mon Sep 17 00:00:00 2001
From: Sven Schober <sven.schober@uni-ulm.de>
Date: Wed, 6 Jul 2011 15:41:36 +0200
Subject: [PATCH] package fixes
- add conflictions and replaces definitions
- add an install script adding necessary nslcd user and group
- increase package release number
---
PKGBUILD | 5 ++++-
nslcd.install | 27 +++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletions(-)
create mode 100644 nslcd.install
diff --git a/PKGBUILD b/PKGBUILD
index ab14d1d..5933e0e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,14 +3,17 @@
pkgname='nss-ldapd'
_pkgname='nss-pam-ldapd'
pkgver='0.8.3'
-pkgrel='1'
+pkgrel='2'
pkgdesc='LDAP module for NSS and PAM'
arch=('i686' 'x86_64')
url="http://arthurdejong.org/$_pkgname/"
license=('LGPL2.1')
depends=('heimdal' 'pam' 'libldap' 'cyrus-sasl')
+conflicts=('nss_ldap' 'pam_ldap')
+replaces=('nss_ldap' 'pam_ldap')
backup=('etc/nslcd.conf')
+install=nslcd.install
md5sums=('83d69ecca5f1389a6b23f13ec367c09f'
'42d7285523b23a077e1133eb3eac5ea3')
diff --git a/nslcd.install b/nslcd.install
new file mode 100644
index 0000000..50fb3f2
--- /dev/null
+++ b/nslcd.install
@@ -0,0 +1,27 @@
+post_install() {
+ if [ ! `grep nslcd /etc/group` ]; then
+ groupadd -r nslcd &>/dev/null;
+ fi
+
+ id nslcd &>/dev/null || \
+ useradd -r -M -s /bin/false nslcd
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ userdel nslcd &> /dev/null
+ groupdel nslcd &> /dev/null
+}
+
+post_remove() {
+ /bin/true
+}
+
+op=$1
+shift
+
+$op $*
+# vim: ts=2 sw=2 et ft=sh
--
1.7.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment