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

  ViewVC Help
Powered by ViewVC 1.1.30