Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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