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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30