Magellan Linux

Annotation of /smage/trunk/extras/openldap/openldap-2.4.52-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15458 - (hide annotations) (download)
Thu Sep 3 14:02:44 2020 UTC (3 years, 7 months ago) by niro
File size: 4417 byte(s)
auto added: ver bump to 2.4.52-r2
1 niro 15458 # $Id$
2    
3     PNAME="openldap"
4     PVER="2.4.52"
5     PBUILD="r2"
6    
7     SPLIT_PACKAGES="libldap libldap-dev openldap"
8    
9     PCAT="net-nds"
10     HOMEPAGE="http://www.openldap.org/"
11    
12     # enable features or not (0|1)
13     ENABLE_SASL=0
14     ENABLE_TCPWRAPPERS=0
15    
16     LIB_DEPEND=">= dev-libs/openssl-1.1"
17    
18     if [[ ${ENABLE_SASL} = 1 ]]
19     then
20     LIB_DEPEND="${LIB_DEPEND}
21     >= dev-libs/cyrus-sasl-2.1.26"
22     fi
23     if [[ ${ENABLE_TCPWRAPPERS} = 1 ]]
24     then
25     LIB_DEPEND="${LIB_DEPEND}
26     >= sys-apps/tcp-wrappers-7"
27     fi
28    
29     # requires libltdl.so.7 from libtool package
30     LDAP_DEPEND=">= dev-db/db-6.2
31     >= sys-libs/libuuid-2.34
32     >= sys-libs/libltdl-2.4"
33    
34     SDEPEND="${LIB_DEPEND}
35     ${LDAP_DEPEND}
36     >= sys-apps/util-linux-2.34
37     >= sys-dev/libtool-2.4"
38    
39     SRCFILE="${PNAME}-${PVER}.tgz"
40     SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
41    
42     sminclude multilib mtools systemd rpath
43     msetfeature "!check"
44    
45     SRC_URI=(
46     http://www.openldap.org/software/download/OpenLDAP/openldap-release/${SRCFILE}
47     mirror://${PNAME}/${SRCFILE}
48     mirror://${PNAME}/slapd.service
49     mirror://${PNAME}/slapd.confd
50     mirror://${PNAME}/slapd.tmpfile
51     )
52    
53     UP2DATE="updatecmd http://www.openldap.org/software/download/ | grep 'currently avail' | sed 's/.*OpenLDAP-\(.*\)\ is.*/\1/'"
54    
55     split_info_libldap()
56     {
57     DESCRIPTION="Lightweight Directory Access Protocol client libraries."
58     DEPEND="${LIB_DEPEND}"
59     }
60    
61     split_info_openldap()
62     {
63     DESCRIPTION="OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol."
64     DEPEND="== net-nds/libldap-${PVER}
65     ${LDAP_DEPEND}"
66     }
67    
68     pkg_setup()
69     {
70     preinstall_openldap
71     }
72    
73     src_prepare()
74     {
75     munpack ${SRCFILE} || die
76    
77     local abi
78     for abi in ${MULTILIB_ABIS}
79     do
80     cd ${SRCDIR}-${abi}
81     # fix localstate dir to /run/openldap
82     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
83     sed -i 's:%LOCALSTATEDIR%/run:/run/openldap:' servers/slapd/slapd.conf || die
84     sed -i 's:-$(MKDIR) $(DESTDIR)$(localstatedir)/run:-$(MKDIR) $(DESTDIR)/run/openldap:' servers/slapd/Makefile.in || die
85    
86     # remove db version limits
87     sed -i '/6.0.20/ a\\t__db_version_compat' build/openldap.m4 || die
88    
89     # non standard, autoreconf doesn't work
90     libtoolize --force || die
91     aclocal || die
92     autoconf --force || die
93     done
94     }
95    
96     src_compile()
97     {
98     local myconf
99    
100     if [[ ${ENABLE_SASL} = 1 ]]
101     then
102     # enable sasl
103     myconf+=" --with-cyrus-sasl"
104     else
105     # disable sasl
106     myconf+=" --without-cyrus-sasl"
107     fi
108    
109     if [[ ${ENABLE_TCPWRAPPERS} = 1 ]]
110     then
111     # enable tcp-wrappers
112     myconf+=" --enable-wrappers"
113     else
114     # disable tcp-wrappers
115     myconf+=" --disable-wrappers"
116     fi
117    
118     # use mdb as default db, drop berkeley db support
119     mconfigure \
120     --localstatedir=/var/lib/openldap \
121     --libexecdir=/usr/$(mlibdir)/openldap \
122     --enable-overlays=mod \
123     --enable-modules=yes \
124     ${myconf} \
125     || die
126    
127     mmake || die
128     }
129    
130     src_install_libldap()
131     {
132     mmake -j1 -C libraries DESTDIR=${BINDIR} install || die
133     }
134    
135     src_install_libldap-dev()
136     {
137     mmake -j1 -C include DESTDIR=${BINDIR} install || die
138     mmake -j1 -C doc/man/man3 DESTDIR=${BINDIR} install || die
139     # install ldap.conf man
140     cp doc/man/man5/ldap.conf.5.tmp ldap.conf.5 || die
141     minstallman ldap.conf.5 || die
142    
143     minstalldocs COPYRIGHT LICENSE || die
144     }
145    
146     src_install_openldap()
147     {
148     mmake -j1 -C clients DESTDIR=${BINDIR} install || die
149     mmake -j1 -C servers DESTDIR=${BINDIR} install || die
150     mmake -j1 -C doc/man/man1 DESTDIR=${BINDIR} install || die
151     mmake -j1 -C doc/man/man5 DESTDIR=${BINDIR} install || die
152     mmake -j1 -C doc/man/man8 DESTDIR=${BINDIR} install || die
153     # missing symlink
154     mlink ../$(mlibdir)/openldap/slapd /usr/sbin/slapd || die
155     # remove ldap.conf man, which is in the lib package
156     mdelete /usr/share/man/man5/ldap.conf.5 || die
157    
158     # create runtime
159     mkeepdir /var/lib/openldap || die
160     mchown ldap:ldap /var/lib/openldap || die
161     mchmod 0700 /var/lib/openldap || die
162     # openldap modules dir
163     mkeepdir /usr/$(mlibdir)/openldap/openldap || die
164    
165     # service
166     minstallunit slapd.service || die
167     minstallconf slapd.confd slapd || die
168     minstalltmp slapd.tmpfile slapd.conf || die
169    
170     # remove insecure rpath
171     mdeleterpath || die
172    
173     minstalldocs ANNOUNCEMENT CHANGES COPYRIGHT LICENSE || die
174     }
175    
176     preinstall_openldap()
177     {
178     # adding ldap user
179     mgroupadd -o "-g 439" ldap
180     museradd -o "-u 439 -g ldap -d /var/lib/openldap -s /bin/false" ldap
181     }
182    
183     postinstall_openldap()
184     {
185     mstartunit slapd.service
186     }
187    
188     postremove_openldap()
189     {
190     mstopunit slapd.service
191     }