Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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