Magellan Linux

Contents of /trunk/extras/openldap/openldap-2.4.31-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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