Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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