Magellan Linux

Contents of /branches/R11-stable/extras/openldap/openldap-2.4.38-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 20197 - (show annotations) (download)
Tue Nov 26 11:44:43 2013 UTC (10 years, 5 months ago) by niro
File size: 3560 byte(s)
-release branches/R11-stable
1 # $Id$
2
3 PNAME="openldap"
4 PVER="2.4.38"
5 PBUILD="r1"
6
7 SPLIT_PACKAGES="libldap openldap"
8
9 PCAT="net-nds"
10 HOMEPAGE="http://www.openldap.org/"
11
12 LIB_DEPEND=">= dev-libs/cyrus-sasl-2.1
13 >= dev-libs/openssl-1.0.1
14 >= sys-apps/tcp-wrappers-7"
15
16 # requires libltdl.so.7 from libtool package
17 LDAP_DEPEND=">= dev-db/db-6.0
18 >= sys-libs/libuuid-2.23
19 >= sys-libs/libltdl-2.4"
20
21 SDEPEND="${LIB_DEPEND}
22 ${LDAP_DEPEND}
23 >= sys-apps/util-linux-2.23
24 >= sys-dev/libtool-2.4"
25
26 SRCFILE="${PNAME}-${PVER}.tgz"
27 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
28
29 sminclude mbuild mtools systemd
30 msetfeature "!check"
31
32 SRC_URI=(
33 http://www.openldap.org/software/download/OpenLDAP/openldap-release/${SRCFILE}
34 mirror://${PNAME}/${SRCFILE}
35 mirror://${PNAME}/slapd.service
36 mirror://${PNAME}/slapd.confd
37 mirror://${PNAME}/slapd.tmpfile
38 )
39
40 UP2DATE="updatecmd http://www.openldap.org/software/download/ | grep 'currently avail' | sed 's/.*OpenLDAP-\(.*\)\ is.*/\1/'"
41
42 split_info_libldap()
43 {
44 DESCRIPTION="Lightweight Directory Access Protocol client libraries."
45 DEPEND="${LIB_DEPEND}"
46 }
47
48 split_info_openldap()
49 {
50 DESCRIPTION="OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol."
51 DEPEND="== net-nds/libldap-${PVER}
52 ${LDAP_DEPEND}"
53 }
54
55 src_prepare()
56 {
57 munpack ${SRCFILE} || die
58 cd ${SRCDIR}
59
60 # fix localstate dir to /run/openldap
61 sed -i 's:#define LDAPI_SOCK LDAP_RUNDIR LDAP_DIRSEP "run" LDAP_DIRSEP "ldapi":#define LDAPI_SOCK LDAP_DIRSEP "run" LDAP_DIRSEP "openldap" LDAP_DIRSEP "ldapi":' include/ldap_defaults.h || die
62 sed -i 's:%LOCALSTATEDIR%/run:/run/openldap:' servers/slapd/slapd.conf || die
63 sed -i 's:-$(MKDIR) $(DESTDIR)$(localstatedir)/run:-$(MKDIR) $(DESTDIR)/run/openldap:' servers/slapd/Makefile.in || die
64
65 # non standard, autoreconf doesn't work
66 mlibtoolize || die
67 aclocal || die
68 autoconf --force || die
69 }
70
71 src_compile()
72 {
73 cd ${SRCDIR}
74
75 mconfigure \
76 --localstatedir=/var/lib/openldap \
77 --libexecdir=/usr/$(mlibdir)/openldap \
78 --enable-overlays=mod \
79 --enable-modules=yes \
80 || die
81
82 mmake || die
83 }
84
85 src_install_libldap()
86 {
87 cd ${SRCDIR}
88 mmake -j1 -C include DESTDIR=${BINDIR} install || die
89 mmake -j1 -C libraries DESTDIR=${BINDIR} install || die
90 mmake -j1 -C doc/man/man3 DESTDIR=${BINDIR} install || die
91 # install ldap.conf man
92 cp doc/man/man5/ldap.conf.5.tmp ldap.conf.5 || die
93 minstallman ldap.conf.5 || die
94
95 minstalldocs COPYRIGHT LICENSE || die
96 }
97
98 src_install_openldap()
99 {
100 cd ${SRCDIR}
101 mmake -j1 -C clients DESTDIR=${BINDIR} install || die
102 mmake -j1 -C servers DESTDIR=${BINDIR} install || die
103 mmake -j1 -C doc/man/man1 DESTDIR=${BINDIR} install || die
104 mmake -j1 -C doc/man/man5 DESTDIR=${BINDIR} install || die
105 mmake -j1 -C doc/man/man8 DESTDIR=${BINDIR} install || die
106 # missing symlink
107 mlink ../$(mlibdir)/openldap/slapd /usr/sbin/slapd || die
108 # remove ldap.conf man, which is in the lib package
109 rm ${BINDIR}/usr/share/man/man5/ldap.conf.5 || die
110
111 # create runtime
112 mkeepdir /var/lib/openldap || die
113 mchown ldap:ldap /var/lib/openldap || die
114 mchmod 0700 /var/lib/openldap || die
115 # openldap modules dir
116 mkeepdir /usr/$(mlibdir)/openldap/openldap || die
117
118 # service
119 minstallunit slapd.service || die
120 minstallconf slapd.confd slapd || die
121 minstalltmp slapd.tmpfile slapd.conf || die
122
123 minstalldocs ANNOUNCEMENT CHANGES COPYRIGHT LICENSE || die
124 }
125
126 preinstall_openldap()
127 {
128 # adding ssh user
129 mgroupadd -o "-g 439" ldap
130 museradd -o "-u 439 -g ldap -d /var/lib/openldap -s /bin/false" ldap
131 }
132
133 postinstall_openldap()
134 {
135 mstartunit slapd.service
136 }
137
138 postremove_openldap()
139 {
140 mstopunit slapd.service
141 }