Contents of /branches/R11-unstable/extras/openldap/openldap-2.4.40-r1.smage2
Parent Directory | Revision Log
Revision 25690 -
(show annotations)
(download)
Tue Nov 25 04:10:32 2014 UTC (9 years, 10 months ago) by niro
File size: 3698 byte(s)
Tue Nov 25 04:10:32 2014 UTC (9 years, 10 months ago) by niro
File size: 3698 byte(s)
-release branches/R11-unstable
1 | # $Id$ |
2 | |
3 | PNAME="openldap" |
4 | PVER="2.4.40" |
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.0 |
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 mbuild mtools systemd |
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 | ) |
39 | |
40 | UP2DATE="updatecmd http://www.openldap.org/software/download/ | grep 'currently avail' | sed 's/.*OpenLDAP-\(.*\)\ is.*/\1/'" |
41 | |
42 | split_info_libldap() |
43 | { |
44 | DESCRIPTION="Lightweight Directory Access Protocol client libraries." |
45 | DEPEND="${LIB_DEPEND}" |
46 | } |
47 | |
48 | split_info_openldap() |
49 | { |
50 | DESCRIPTION="OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol." |
51 | DEPEND="== net-nds/libldap-${PVER} |
52 | ${LDAP_DEPEND}" |
53 | } |
54 | |
55 | pkg_setup() |
56 | { |
57 | preinstall_openldap |
58 | } |
59 | |
60 | src_prepare() |
61 | { |
62 | munpack ${SRCFILE} || die |
63 | cd ${SRCDIR} |
64 | |
65 | # fix localstate dir to /run/openldap |
66 | 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 |
67 | sed -i 's:%LOCALSTATEDIR%/run:/run/openldap:' servers/slapd/slapd.conf || die |
68 | sed -i 's:-$(MKDIR) $(DESTDIR)$(localstatedir)/run:-$(MKDIR) $(DESTDIR)/run/openldap:' servers/slapd/Makefile.in || die |
69 | |
70 | # remove db version limits |
71 | sed -i '/6.0.20/ a\\t__db_version_compat' build/openldap.m4 || die |
72 | |
73 | # non standard, autoreconf doesn't work |
74 | mlibtoolize || die |
75 | aclocal || die |
76 | autoconf --force || die |
77 | } |
78 | |
79 | src_compile() |
80 | { |
81 | cd ${SRCDIR} |
82 | |
83 | mconfigure \ |
84 | --localstatedir=/var/lib/openldap \ |
85 | --libexecdir=/usr/$(mlibdir)/openldap \ |
86 | --enable-overlays=mod \ |
87 | --enable-modules=yes \ |
88 | || die |
89 | |
90 | mmake || die |
91 | } |
92 | |
93 | src_install_libldap() |
94 | { |
95 | cd ${SRCDIR} |
96 | mmake -j1 -C include DESTDIR=${BINDIR} install || die |
97 | mmake -j1 -C libraries DESTDIR=${BINDIR} install || die |
98 | mmake -j1 -C doc/man/man3 DESTDIR=${BINDIR} install || die |
99 | # install ldap.conf man |
100 | cp doc/man/man5/ldap.conf.5.tmp ldap.conf.5 || die |
101 | minstallman ldap.conf.5 || die |
102 | |
103 | minstalldocs COPYRIGHT LICENSE || die |
104 | } |
105 | |
106 | src_install_openldap() |
107 | { |
108 | cd ${SRCDIR} |
109 | mmake -j1 -C clients DESTDIR=${BINDIR} install || die |
110 | mmake -j1 -C servers DESTDIR=${BINDIR} install || die |
111 | mmake -j1 -C doc/man/man1 DESTDIR=${BINDIR} install || die |
112 | mmake -j1 -C doc/man/man5 DESTDIR=${BINDIR} install || die |
113 | mmake -j1 -C doc/man/man8 DESTDIR=${BINDIR} install || die |
114 | # missing symlink |
115 | mlink ../$(mlibdir)/openldap/slapd /usr/sbin/slapd || die |
116 | # remove ldap.conf man, which is in the lib package |
117 | rm ${BINDIR}/usr/share/man/man5/ldap.conf.5 || die |
118 | |
119 | # create runtime |
120 | mkeepdir /var/lib/openldap || die |
121 | mchown ldap:ldap /var/lib/openldap || die |
122 | mchmod 0700 /var/lib/openldap || die |
123 | # openldap modules dir |
124 | mkeepdir /usr/$(mlibdir)/openldap/openldap || die |
125 | |
126 | # service |
127 | minstallunit slapd.service || die |
128 | minstallconf slapd.confd slapd || die |
129 | minstalltmp slapd.tmpfile slapd.conf || die |
130 | |
131 | minstalldocs ANNOUNCEMENT CHANGES COPYRIGHT LICENSE || die |
132 | } |
133 | |
134 | preinstall_openldap() |
135 | { |
136 | # adding ssh user |
137 | mgroupadd -o "-g 439" ldap |
138 | museradd -o "-u 439 -g ldap -d /var/lib/openldap -s /bin/false" ldap |
139 | } |
140 | |
141 | postinstall_openldap() |
142 | { |
143 | mstartunit slapd.service |
144 | } |
145 | |
146 | postremove_openldap() |
147 | { |
148 | mstopunit slapd.service |
149 | } |