Contents of /trunk/extras/openldap/openldap-2.4.45-r2.smage2
Parent Directory | Revision Log
Revision 29978 -
(show annotations)
(download)
Thu Oct 19 14:06:17 2017 UTC (6 years, 11 months ago) by niro
File size: 3831 byte(s)
Thu Oct 19 14:06:17 2017 UTC (6 years, 11 months ago) by niro
File size: 3831 byte(s)
-openssl-1.1 rebuild
1 | # $Id$ |
2 | |
3 | PNAME="openldap" |
4 | PVER="2.4.45" |
5 | PBUILD="r2" |
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.1 |
14 | >= sys-apps/tcp-wrappers-7" |
15 | |
16 | # requires libltdl.so.7 from libtool package |
17 | LDAP_DEPEND=">= dev-db/db-6.2 |
18 | >= sys-libs/libuuid-2.30 |
19 | >= sys-libs/libltdl-2.4" |
20 | |
21 | SDEPEND="${LIB_DEPEND} |
22 | ${LDAP_DEPEND} |
23 | >= sys-apps/util-linux-2.30 |
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 | ) |
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 | |
64 | local abi |
65 | for abi in ${MULTILIB_ABIS} |
66 | do |
67 | cd ${SRCDIR}-${abi} |
68 | # fix localstate dir to /run/openldap |
69 | 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 |
70 | sed -i 's:%LOCALSTATEDIR%/run:/run/openldap:' servers/slapd/slapd.conf || die |
71 | sed -i 's:-$(MKDIR) $(DESTDIR)$(localstatedir)/run:-$(MKDIR) $(DESTDIR)/run/openldap:' servers/slapd/Makefile.in || die |
72 | |
73 | # remove db version limits |
74 | sed -i '/6.0.20/ a\\t__db_version_compat' build/openldap.m4 || die |
75 | |
76 | # non standard, autoreconf doesn't work |
77 | libtoolize --force || die |
78 | aclocal || die |
79 | autoconf --force || die |
80 | done |
81 | } |
82 | |
83 | src_compile() |
84 | { |
85 | # use mdb as default db, drop berkeley db support |
86 | mconfigure \ |
87 | --localstatedir=/var/lib/openldap \ |
88 | --libexecdir=/usr/$(mlibdir)/openldap \ |
89 | --enable-overlays=mod \ |
90 | --enable-modules=yes \ |
91 | || die |
92 | |
93 | mmake || die |
94 | } |
95 | |
96 | src_install_libldap() |
97 | { |
98 | mmake -j1 -C include DESTDIR=${BINDIR} install || die |
99 | mmake -j1 -C libraries DESTDIR=${BINDIR} install || die |
100 | mmake -j1 -C doc/man/man3 DESTDIR=${BINDIR} install || die |
101 | # install ldap.conf man |
102 | cp doc/man/man5/ldap.conf.5.tmp ldap.conf.5 || die |
103 | minstallman ldap.conf.5 || die |
104 | |
105 | minstalldocs COPYRIGHT LICENSE || die |
106 | } |
107 | |
108 | src_install_openldap() |
109 | { |
110 | mmake -j1 -C clients DESTDIR=${BINDIR} install || die |
111 | mmake -j1 -C servers DESTDIR=${BINDIR} install || die |
112 | mmake -j1 -C doc/man/man1 DESTDIR=${BINDIR} install || die |
113 | mmake -j1 -C doc/man/man5 DESTDIR=${BINDIR} install || die |
114 | mmake -j1 -C doc/man/man8 DESTDIR=${BINDIR} install || die |
115 | # missing symlink |
116 | mlink ../$(mlibdir)/openldap/slapd /usr/sbin/slapd || die |
117 | # remove ldap.conf man, which is in the lib package |
118 | mdelete /usr/share/man/man5/ldap.conf.5 || die |
119 | |
120 | # create runtime |
121 | mkeepdir /var/lib/openldap || die |
122 | mchown ldap:ldap /var/lib/openldap || die |
123 | mchmod 0700 /var/lib/openldap || die |
124 | # openldap modules dir |
125 | mkeepdir /usr/$(mlibdir)/openldap/openldap || die |
126 | |
127 | # service |
128 | minstallunit slapd.service || die |
129 | minstallconf slapd.confd slapd || die |
130 | minstalltmp slapd.tmpfile slapd.conf || die |
131 | |
132 | # remove insecure rpath |
133 | mdeleterpath || die |
134 | |
135 | minstalldocs ANNOUNCEMENT CHANGES COPYRIGHT LICENSE || die |
136 | } |
137 | |
138 | preinstall_openldap() |
139 | { |
140 | # adding ldap user |
141 | mgroupadd -o "-g 439" ldap |
142 | museradd -o "-u 439 -g ldap -d /var/lib/openldap -s /bin/false" ldap |
143 | } |
144 | |
145 | postinstall_openldap() |
146 | { |
147 | mstartunit slapd.service |
148 | } |
149 | |
150 | postremove_openldap() |
151 | { |
152 | mstopunit slapd.service |
153 | } |