Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 26528 - (show annotations) (download)
Fri Jul 3 08:05:11 2015 UTC (8 years, 11 months ago) by niro
File size: 3960 byte(s)
-fixed patch version
1 # $Id$
2
3 PNAME="openldap"
4 PVER="2.4.41"
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.26
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.1
18 >= sys-libs/libuuid-2.25
19 >= sys-libs/libltdl-2.4"
20
21 SDEPEND="${LIB_DEPEND}
22 ${LDAP_DEPEND}
23 >= sys-apps/util-linux-2.25
24 >= sys-dev/libtool-2.4"
25
26 SRCFILE="${PNAME}-${PVER}.tgz"
27 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
28
29 sminclude multilib mtools systemd rpath
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 mirror://${PNAME}/${PNAME}-2.4.40-gcc5.patch
39 )
40
41 UP2DATE="updatecmd http://www.openldap.org/software/download/ | grep 'currently avail' | sed 's/.*OpenLDAP-\(.*\)\ is.*/\1/'"
42
43 split_info_libldap()
44 {
45 DESCRIPTION="Lightweight Directory Access Protocol client libraries."
46 DEPEND="${LIB_DEPEND}"
47 }
48
49 split_info_openldap()
50 {
51 DESCRIPTION="OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol."
52 DEPEND="== net-nds/libldap-${PVER}
53 ${LDAP_DEPEND}"
54 }
55
56 pkg_setup()
57 {
58 preinstall_openldap
59 }
60
61 src_prepare()
62 {
63 munpack ${SRCFILE} || die
64
65 # fix db version detection with gcc5
66 mpatch ${PNAME}-2.4.40-gcc5.patch || die
67
68 local abi
69 for abi in ${MULTILIB_ABIS}
70 do
71 cd ${SRCDIR}-${abi}
72 # fix localstate dir to /run/openldap
73 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
74 sed -i 's:%LOCALSTATEDIR%/run:/run/openldap:' servers/slapd/slapd.conf || die
75 sed -i 's:-$(MKDIR) $(DESTDIR)$(localstatedir)/run:-$(MKDIR) $(DESTDIR)/run/openldap:' servers/slapd/Makefile.in || die
76
77 # remove db version limits
78 sed -i '/6.0.20/ a\\t__db_version_compat' build/openldap.m4 || die
79
80 # non standard, autoreconf doesn't work
81 libtoolize --force || die
82 aclocal || die
83 autoconf --force || die
84 done
85 }
86
87 src_compile()
88 {
89 # use mdb as default db, drop berkeley db support
90 mconfigure \
91 --localstatedir=/var/lib/openldap \
92 --libexecdir=/usr/$(mlibdir)/openldap \
93 --enable-overlays=mod \
94 --enable-modules=yes \
95 || die
96
97 mmake || die
98 }
99
100 src_install_libldap()
101 {
102 mmake -j1 -C include DESTDIR=${BINDIR} install || die
103 mmake -j1 -C libraries DESTDIR=${BINDIR} install || die
104 mmake -j1 -C doc/man/man3 DESTDIR=${BINDIR} install || die
105 # install ldap.conf man
106 cp doc/man/man5/ldap.conf.5.tmp ldap.conf.5 || die
107 minstallman ldap.conf.5 || die
108
109 minstalldocs COPYRIGHT LICENSE || die
110 }
111
112 src_install_openldap()
113 {
114 mmake -j1 -C clients DESTDIR=${BINDIR} install || die
115 mmake -j1 -C servers DESTDIR=${BINDIR} install || die
116 mmake -j1 -C doc/man/man1 DESTDIR=${BINDIR} install || die
117 mmake -j1 -C doc/man/man5 DESTDIR=${BINDIR} install || die
118 mmake -j1 -C doc/man/man8 DESTDIR=${BINDIR} install || die
119 # missing symlink
120 mlink ../$(mlibdir)/openldap/slapd /usr/sbin/slapd || die
121 # remove ldap.conf man, which is in the lib package
122 mdelete /usr/share/man/man5/ldap.conf.5 || die
123
124 # create runtime
125 mkeepdir /var/lib/openldap || die
126 mchown ldap:ldap /var/lib/openldap || die
127 mchmod 0700 /var/lib/openldap || die
128 # openldap modules dir
129 mkeepdir /usr/$(mlibdir)/openldap/openldap || die
130
131 # service
132 minstallunit slapd.service || die
133 minstallconf slapd.confd slapd || die
134 minstalltmp slapd.tmpfile slapd.conf || die
135
136 # remove insecure rpath
137 mdeleterpath || die
138
139 minstalldocs ANNOUNCEMENT CHANGES COPYRIGHT LICENSE || die
140 }
141
142 preinstall_openldap()
143 {
144 # adding ldap user
145 mgroupadd -o "-g 439" ldap
146 museradd -o "-u 439 -g ldap -d /var/lib/openldap -s /bin/false" ldap
147 }
148
149 postinstall_openldap()
150 {
151 mstartunit slapd.service
152 }
153
154 postremove_openldap()
155 {
156 mstopunit slapd.service
157 }