/[packages]/updates/5/389-ds-base/current/SPECS/389-ds-base.spec
ViewVC logotype

Annotation of /updates/5/389-ds-base/current/SPECS/389-ds-base.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 441888 - (hide annotations) (download)
Mon Jun 10 22:03:29 2013 UTC (10 years, 10 months ago) by spuhler
Original Path: cauldron/389-ds-base/current/SPECS/389-ds-base.spec
File size: 10047 byte(s)
SILENT reverted back to rel 1 since it was has never been built.
1 spuhler 287129
2     %global pkgname dirsrv
3     # for a pre-release, define the prerel field e.g. .a1 .rc2 - comment out for official release
4     # also remove the space between % and global - this space is needed because
5     # fedpkg verrel stupidly ignores comment lines
6 spuhler 398874 #% global prerel .rc3
7 spuhler 287129 # also need the relprefix field for a pre-release e.g. .0 - also comment out for official release
8 spuhler 398874 #% global relprefix 0.
9 spuhler 287129
10 spuhler 291495 %global use_openldap 1
11     %global use_db4 0
12     # If perl-Socket-2.000 or newer is available, set 0 to use_Socket6.
13     %global use_Socket6 0
14 spuhler 287129
15 colin 321807 # (cg) NB the --with-tmpfiles_d argument below is for user generated config files
16     # created via DSCreate.pm script - i.e. it should be the /etc/ path, NOT %_tmpfilesdir
17    
18 spuhler 398874 # Mageia 3 and later uses tmpfiles.d
19 spuhler 287129 # otherwise, comment this out
20 colin 321807 %{!?with_tmpfiles_d: %global with_tmpfiles_d %{_sysconfdir}/tmpfiles.d}
21 spuhler 287129
22 spuhler 291495 # systemd support
23     %global groupname %{pkgname}.target
24    
25 spuhler 424952 # set PIE flag
26     %global _hardened_build 1
27    
28 spuhler 287129 Summary: 389 Directory Server (base)
29     Name: 389-ds-base
30 spuhler 424952 Version: 1.3.1.0
31 spuhler 441888 Release: %mkrel 1
32 spuhler 287129 License: GPLv2 with exceptions
33     URL: http://port389.org/
34 spuhler 291509 Group: System/Servers
35 spuhler 287129 Requires: %{name}-libs = %{version}-%{release}
36 spuhler 291495 Provides: ldif2ldbm
37 spuhler 287129
38     BuildRequires: nspr-devel
39     BuildRequires: nss-devel
40 spuhler 300705 BuildRequires: krb5-devel
41 spuhler 287129 BuildRequires: svrcore-devel
42     %if %{use_openldap}
43     BuildRequires: openldap-devel
44     %else
45     BuildRequires: mozldap-devel
46     %endif
47 spuhler 291495 %if %{use_db4}
48 spuhler 287129 BuildRequires: db4-devel
49 spuhler 291495 %else
50     BuildRequires: db-devel
51     %endif
52 spuhler 300646 BuildRequires: libsasl-devel
53 spuhler 287129 BuildRequires: icu
54     BuildRequires: libicu-devel
55     BuildRequires: pcre-devel
56 spuhler 291495 BuildRequires: gcc-c++
57 spuhler 287129 # The following are needed to build the snmp ldap-agent
58     BuildRequires: net-snmp-devel
59     BuildRequires: bzip2-devel
60     BuildRequires: zlib-devel
61     BuildRequires: openssl-devel
62     BuildRequires: tcp_wrappers
63     # the following is for the pam passthru auth plug-in
64     BuildRequires: pam-devel
65 spuhler 291495 BuildRequires: systemd-units
66 spuhler 287129
67     # this is needed for using semanage from our setup scripts
68 spuhler 291495 Requires: policycoreutils-python
69 spuhler 287129
70 spuhler 413351 Requires(post): rpm-helper >= %{rpmhelper_required_version}
71     Requires(preun): rpm-helper >= %{rpmhelper_required_version}
72 spuhler 401340
73 spuhler 413351
74 spuhler 287129 # the following are needed for some of our scripts
75     %if %{use_openldap}
76 spuhler 291495 Requires: openldap-clients
77 spuhler 287129 %else
78     Requires: mozldap-tools
79     %endif
80     # use_openldap assumes perl-Mozilla-LDAP is built with openldap support
81     Requires: perl-Mozilla-LDAP
82    
83     # this is needed to setup SSL if you are not using the
84     # administration server package
85 spuhler 291495 Requires: nss
86 spuhler 287129
87     # these are not found by the auto-dependency method
88     # they are required to support the mandatory LDAP SASL mechs
89 spuhler 300646 Requires: sasl-plug-gssapi
90     Requires: sasl-plug-digestmd5
91 spuhler 287129
92     # this is needed for verify-db.pl
93 spuhler 291495 %if %{use_db4}
94 spuhler 287129 Requires: db4-utils
95 spuhler 291495 %else
96 spuhler 296942 Requires: db5-utils
97 spuhler 291495 %endif
98 spuhler 287129
99     # This picks up libperl.so as a Requires, so we add this versioned one
100 spuhler 401340 # We don't pack this virtual package in Mageia and it doesn't look it's needed anymore in mdern perl.
101     # Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
102 spuhler 287129
103     # for the init script
104 spuhler 291495 Requires(post): systemd-units
105     Requires(preun): systemd-units
106     Requires(postun): systemd-units
107 spuhler 287129
108 spuhler 291495 # for setup-ds.pl to support ipv6
109     %if %{use_Socket6}
110     Requires: perl-Socket6
111     %else
112     Requires: perl-Socket
113     %endif
114     Requires: perl-NetAddr-IP
115    
116 spuhler 287129 Source0: http://port389.org/sources/%{name}-%{version}%{?prerel}.tar.bz2
117     # 389-ds-git.sh should be used to generate the source tarball from git
118     Source1: %{name}-git.sh
119     Source2: %{name}-devel.README
120 spuhler 413351 Patch0: mageia-nogroup.patch
121 spuhler 287129
122     %description
123     389 Directory Server is an LDAPv3 compliant server. The base package includes
124     the LDAP server and command line utilities for server administration.
125    
126 spuhler 398874 %package libs
127 spuhler 287129 Summary: Core libraries for 389 Directory Server
128 spuhler 291509 Group: System/Servers
129 spuhler 287129 BuildRequires: nspr-devel
130     BuildRequires: nss-devel
131     BuildRequires: svrcore-devel
132     %if %{use_openldap}
133     BuildRequires: openldap-devel
134     %else
135     BuildRequires: mozldap-devel
136     %endif
137 spuhler 291495 %if %{use_db4}
138 spuhler 287129 BuildRequires: db4-devel
139 spuhler 291495 %else
140     BuildRequires: db-devel
141     %endif
142 spuhler 300646 BuildRequires: libsasl-devel
143 spuhler 287129 BuildRequires: libicu-devel
144     BuildRequires: pcre-devel
145    
146 spuhler 305913 %description libs
147 spuhler 287129 Core libraries for the 389 Directory Server base package. These libraries
148     are used by the main package and the -devel package. This allows the -devel
149     package to be installed with just the -libs package and without the main package.
150    
151     %package devel
152     Summary: Development libraries for 389 Directory Server
153 spuhler 296942 Group: System/Libraries
154 spuhler 287129 Requires: %{name}-libs = %{version}-%{release}
155     Requires: pkgconfig
156     Requires: nspr-devel
157     Requires: nss-devel
158     Requires: svrcore-devel
159     %if %{use_openldap}
160     Requires: openldap-devel
161     %else
162     Requires: mozldap-devel
163     %endif
164    
165     %description devel
166     Development Libraries and headers for the 389 Directory Server base package.
167    
168     %prep
169     %setup -q -n %{name}-%{version}%{?prerel}
170     cp %{SOURCE2} README.devel
171 spuhler 413351 %patch0 -p1 -b .mageia-nogroup
172 spuhler 287129
173     %build
174 spuhler 398874
175 spuhler 287129 %if %{use_openldap}
176     OPENLDAP_FLAG="--with-openldap"
177     %endif
178 colin 321807 %{?with_tmpfiles_d: TMPFILES_FLAG="--with-tmpfiles-d=%{with_tmpfiles_d}"}
179 spuhler 401340 # hack hack hack https://bugzilla.redhat.com/show_bug.cgi?id=833529
180     NSSARGS="--with-svrcore-inc=%{_includedir} --with-svrcore-lib=%{_libdir} --with-nss-lib=%{_libdir} --with-nss-inc=%{_includedir}/nss"
181 spuhler 305248 %configure2_5x --enable-autobind \
182 spuhler 296942 --with-selinux $OPENLDAP_FLAG $TMPFILES_FLAG \
183 spuhler 291495 --with-systemdsystemunitdir=%{_unitdir} \
184     --with-systemdsystemconfdir=%{_sysconfdir}/systemd/system \
185 spuhler 401340 --with-systemdgroupname=%{groupname} $NSSARGS
186 spuhler 287129
187     # Generate symbolic info for debuggers
188     export XCFLAGS=$RPM_OPT_FLAGS
189    
190 spuhler 398874 %ifarch x86_64
191     export USE_64=1
192     %endif
193 spuhler 305248
194 spuhler 398874
195 spuhler 296942 %make
196 spuhler 287129
197    
198     %install
199 spuhler 398874 make DESTDIR="%{buildroot}" install
200 spuhler 287129
201 spuhler 413351 mkdir -p %{buildroot}%{_logdir}/%{pkgname}
202 spuhler 398874 mkdir -p %{buildroot}/var/lib/%{pkgname}
203     mkdir -p %{buildroot}/var/lock/%{pkgname}
204 spuhler 287129
205 spuhler 398874 # for systemd
206     mkdir -p %{buildroot}%{_sysconfdir}/systemd/system/%{groupname}.wants
207    
208 spuhler 287129 #remove libtool and static libs
209 spuhler 398874 rm -f %{buildroot}%{_libdir}/%{pkgname}/*.a
210     rm -f %{buildroot}%{_libdir}/%{pkgname}/*.la
211     rm -f %{buildroot}%{_libdir}/%{pkgname}/plugins/*.a
212     rm -f %{buildroot}%{_libdir}/%{pkgname}/plugins/*.la
213 spuhler 287129
214     # make sure perl scripts have a proper shebang
215 spuhler 398874 sed -i -e 's|#{{PERL-EXEC}}|#!/usr/bin/perl|' %{buildroot}%{_datadir}/%{pkgname}/script-templates/template-*.pl
216 spuhler 287129
217     %post
218 spuhler 398874 output=/dev/null
219 spuhler 410202 %_post_service %{pkgname}-snmp
220 spuhler 291495 # reload to pick up any changes to systemd files
221     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
222     # reload to pick up any shared lib changes
223 spuhler 287129 /sbin/ldconfig
224 spuhler 291495 # restart the snmp subagent if needed
225     /bin/systemctl try-restart %{pkgname}-snmp.service > $output 2>&1 || :
226 spuhler 287129 # find all instances
227     instances="" # instances that require a restart after upgrade
228     ninst=0 # number of instances found in total
229 spuhler 291495 if [ -n "$DEBUGPOSTTRANS" ] ; then
230     output=$DEBUGPOSTTRANS
231     fi
232     echo looking for services in %{_sysconfdir}/systemd/system/%{groupname}.wants/* > $output 2>&1 || :
233     for service in %{_sysconfdir}/systemd/system/%{groupname}.wants/* ; do
234     if [ ! -f "$service" ] ; then continue ; fi # in case nothing matches
235     inst=`echo $service | sed -e 's,%{_sysconfdir}/systemd/system/%{groupname}.wants/,,'`
236     echo found instance $inst - getting status > $output 2>&1 || :
237     if /bin/systemctl -q is-active $inst ; then
238     echo instance $inst is running > $output 2>&1 || :
239 spuhler 287129 instances="$instances $inst"
240     else
241 spuhler 291495 echo instance $inst is not running > $output 2>&1 || :
242 spuhler 287129 fi
243     ninst=`expr $ninst + 1`
244     done
245     if [ $ninst -eq 0 ] ; then
246 spuhler 291495 echo no instances to upgrade > $output 2>&1 || :
247 spuhler 287129 exit 0 # have no instances to upgrade - just skip the rest
248     fi
249     # shutdown all instances
250 spuhler 291495 echo shutting down all instances . . . > $output 2>&1 || :
251     /bin/systemctl stop %{groupname} > $output 2>&1 || :
252     echo remove pid files . . . > $output 2>&1 || :
253     /bin/rm -f /var/run/%{pkgname}*.pid /var/run/%{pkgname}*.startpid
254 spuhler 287129 # do the upgrade
255 spuhler 291495 echo upgrading instances . . . > $output 2>&1 || :
256     %{_sbindir}/setup-ds.pl -l $output -u -s General.UpdateMode=offline > $output 2>&1 || :
257 spuhler 287129 # restart instances that require it
258     for inst in $instances ; do
259 spuhler 291495 echo restarting instance $inst > $output 2>&1 || :
260     /bin/systemctl start $inst > $output 2>&1 || :
261 spuhler 287129 done
262     exit 0
263    
264 spuhler 291495 %preun
265     if [ $1 -eq 0 ]; then # Final removal
266     # Package removal, not upgrade
267 spuhler 398874 %systemd_preun %{pkgname}-snmp.service %{groupname}
268 spuhler 291495 # remove instance specific service files/links
269     rm -rf %{_sysconfdir}/systemd/system/%{groupname}.wants/* > /dev/null 2>&1 || :
270     fi
271    
272     %postun
273     /sbin/ldconfig
274     if [ $1 = 0 ]; then # Final removal
275     rm -rf /var/run/%{pkgname}
276     fi
277    
278 spuhler 287129 %files
279     %doc LICENSE EXCEPTION LICENSE.GPLv2
280     %dir %{_sysconfdir}/%{pkgname}
281     %dir %{_sysconfdir}/%{pkgname}/schema
282     %config(noreplace)%{_sysconfdir}/%{pkgname}/schema/*.ldif
283     %dir %{_sysconfdir}/%{pkgname}/config
284 spuhler 413351 %dir %{_sysconfdir}/systemd/system/%{groupname}.wants
285 spuhler 287129 %config(noreplace)%{_sysconfdir}/%{pkgname}/config/slapd-collations.conf
286     %config(noreplace)%{_sysconfdir}/%{pkgname}/config/certmap.conf
287     %config(noreplace)%{_sysconfdir}/%{pkgname}/config/ldap-agent.conf
288     %config(noreplace)%{_sysconfdir}/%{pkgname}/config/template-initconfig
289     %config(noreplace)%{_sysconfdir}/sysconfig/%{pkgname}
290 spuhler 291495 %config(noreplace)%{_sysconfdir}/sysconfig/%{pkgname}.systemd
291 spuhler 287129 %{_datadir}/%{pkgname}
292 spuhler 291495 %{_unitdir}
293 spuhler 287129 %{_bindir}/*
294     %{_sbindir}/*
295     %{_libdir}/%{pkgname}/libns-dshttpd.so*
296     %{_libdir}/%{pkgname}/perl
297     %{_libdir}/%{pkgname}/plugins/*.so
298     %dir %{_localstatedir}/lib/%{pkgname}
299 spuhler 296942 %dir %{_logdir}/%{pkgname}
300 spuhler 287129 %{_mandir}/man1/*
301     %{_mandir}/man8/*
302    
303     %files devel
304     %doc LICENSE EXCEPTION LICENSE.GPLv2 README.devel
305     %{_includedir}/%{pkgname}
306     %{_libdir}/%{pkgname}/libslapd.so
307     %{_libdir}/pkgconfig/*
308    
309 spuhler 305913 %files libs
310 spuhler 287129 %doc LICENSE EXCEPTION LICENSE.GPLv2 README.devel
311     %{_libdir}/%{pkgname}/libslapd.so.*

  ViewVC Help
Powered by ViewVC 1.1.30