/[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 324210 - (hide annotations) (download)
Sat Dec 1 17:19:03 2012 UTC (11 years, 4 months ago) by spuhler
Original Path: cauldron/389-ds-base/current/SPECS/389-ds-base.spec
File size: 9666 byte(s)
upgrade to 1.3.0
1 spuhler 296942 %define major 0
2     %define libname %mklibname 389-ds-base %major
3 spuhler 287129
4 spuhler 296942
5 spuhler 287129 %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 spuhler 324210 %global prerel .a1
10 spuhler 287129 # also need the relprefix field for a pre-release e.g. .0 - also comment out for official release
11 spuhler 291495 # %global relprefix 0.
12 spuhler 287129
13 spuhler 291495 %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 spuhler 287129
18 colin 321807 # (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 spuhler 287129 # fedora 15 and later uses tmpfiles.d
22     # otherwise, comment this out
23 colin 321807 %{!?with_tmpfiles_d: %global with_tmpfiles_d %{_sysconfdir}/tmpfiles.d}
24 spuhler 287129
25 spuhler 291495 # systemd support
26     %global groupname %{pkgname}.target
27    
28 spuhler 287129 Summary: 389 Directory Server (base)
29     Name: 389-ds-base
30 spuhler 324210 Version: 1.3
31     Release: %mkrel 1
32 spuhler 287129 License: GPLv2 with exceptions
33     URL: http://port389.org/
34 spuhler 291509 Group: System/Servers
35 spuhler 287129 Obsoletes: %{name}-selinux
36 spuhler 291495 Conflicts: selinux-policy-base < 3.9.8
37 spuhler 287129 Requires: %{name}-libs = %{version}-%{release}
38 spuhler 291495 Provides: ldif2ldbm
39 spuhler 287129
40     BuildRequires: nspr-devel
41     BuildRequires: nss-devel
42 spuhler 300705 BuildRequires: krb5-devel
43 spuhler 287129 BuildRequires: svrcore-devel
44     %if %{use_openldap}
45     BuildRequires: openldap-devel
46     %else
47     BuildRequires: mozldap-devel
48     %endif
49 spuhler 291495 %if %{use_db4}
50 spuhler 287129 BuildRequires: db4-devel
51 spuhler 291495 %else
52     BuildRequires: db-devel
53     %endif
54 spuhler 300646 BuildRequires: libsasl-devel
55 spuhler 287129 BuildRequires: icu
56     BuildRequires: libicu-devel
57     BuildRequires: pcre-devel
58 spuhler 291495 BuildRequires: gcc-c++
59 spuhler 287129 # 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 spuhler 291495 BuildRequires: systemd-units
68 spuhler 287129
69     # this is needed for using semanage from our setup scripts
70 spuhler 291495 Requires: policycoreutils-python
71 spuhler 287129
72     # the following are needed for some of our scripts
73     %if %{use_openldap}
74 spuhler 291495 Requires: openldap-clients
75 spuhler 287129 %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 spuhler 291495 Requires: nss
84 spuhler 287129
85     # these are not found by the auto-dependency method
86     # they are required to support the mandatory LDAP SASL mechs
87 spuhler 300646 Requires: sasl-plug-gssapi
88     Requires: sasl-plug-digestmd5
89 spuhler 287129
90     # this is needed for verify-db.pl
91 spuhler 291495 %if %{use_db4}
92 spuhler 287129 Requires: db4-utils
93 spuhler 291495 %else
94 spuhler 296942 Requires: db5-utils
95 spuhler 291495 %endif
96 spuhler 287129
97     # This picks up libperl.so as a Requires, so we add this versioned one
98 spuhler 305248 #Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
99 spuhler 287129
100     # for the init script
101 spuhler 291495 Requires(post): systemd-units
102     Requires(preun): systemd-units
103     Requires(postun): systemd-units
104 spuhler 287129
105 spuhler 291495 # 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 spuhler 287129 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 colin 321807 Patch0001: 389-ds-base-1.2.11.15-systemd-create-wants-folder.patch
119    
120 spuhler 287129 %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 spuhler 305913 %package libs
125 spuhler 287129 Summary: Core libraries for 389 Directory Server
126 spuhler 291509 Group: System/Servers
127 spuhler 287129 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 spuhler 291495 %if %{use_db4}
136 spuhler 287129 BuildRequires: db4-devel
137 spuhler 291495 %else
138     BuildRequires: db-devel
139     %endif
140 spuhler 300646 BuildRequires: libsasl-devel
141 spuhler 287129 BuildRequires: libicu-devel
142     BuildRequires: pcre-devel
143    
144 spuhler 305913 %description libs
145 spuhler 287129 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 spuhler 296942 Group: System/Libraries
152 spuhler 287129 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 colin 321807 %apply_patches
169 spuhler 287129 cp %{SOURCE2} README.devel
170    
171     %build
172 spuhler 291495 autoreconf -fi
173 spuhler 287129 %if %{use_openldap}
174     OPENLDAP_FLAG="--with-openldap"
175     %endif
176 colin 321807 %{?with_tmpfiles_d: TMPFILES_FLAG="--with-tmpfiles-d=%{with_tmpfiles_d}"}
177 spuhler 305248 %configure2_5x --enable-autobind \
178 spuhler 296942 --with-selinux $OPENLDAP_FLAG $TMPFILES_FLAG \
179 spuhler 291495 --with-systemdsystemunitdir=%{_unitdir} \
180     --with-systemdsystemconfdir=%{_sysconfdir}/systemd/system \
181 spuhler 305248 --with-systemdgroupname=%{groupname} \
182     LDFLAGS=-L%{perl_archlib}/CORE
183 spuhler 287129
184     # Generate symbolic info for debuggers
185     export XCFLAGS=$RPM_OPT_FLAGS
186    
187 spuhler 305248
188 spuhler 296942 %make
189 spuhler 287129
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 spuhler 291495 # 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 spuhler 287129 /sbin/ldconfig
211 spuhler 291495 # restart the snmp subagent if needed
212     /bin/systemctl try-restart %{pkgname}-snmp.service > $output 2>&1 || :
213 spuhler 287129 # find all instances
214     instances="" # instances that require a restart after upgrade
215     ninst=0 # number of instances found in total
216 spuhler 291495 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 spuhler 287129 instances="$instances $inst"
228     else
229 spuhler 291495 echo instance $inst is not running > $output 2>&1 || :
230 spuhler 287129 fi
231     ninst=`expr $ninst + 1`
232     done
233     if [ $ninst -eq 0 ] ; then
234 spuhler 291495 echo no instances to upgrade > $output 2>&1 || :
235 spuhler 287129 exit 0 # have no instances to upgrade - just skip the rest
236     fi
237     # shutdown all instances
238 spuhler 291495 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 spuhler 287129 # do the upgrade
243 spuhler 291495 echo upgrading instances . . . > $output 2>&1 || :
244     %{_sbindir}/setup-ds.pl -l $output -u -s General.UpdateMode=offline > $output 2>&1 || :
245 spuhler 287129 # restart instances that require it
246     for inst in $instances ; do
247 spuhler 291495 echo restarting instance $inst > $output 2>&1 || :
248     /bin/systemctl start $inst > $output 2>&1 || :
249 spuhler 287129 done
250     exit 0
251    
252 spuhler 291495 %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 spuhler 287129 %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 spuhler 291495 %config(noreplace)%{_sysconfdir}/sysconfig/%{pkgname}.systemd
279 spuhler 287129 %{_datadir}/%{pkgname}
280 spuhler 291495 %{_unitdir}
281 spuhler 287129 %{_bindir}/*
282     %{_sbindir}/*
283     %{_libdir}/%{pkgname}/libns-dshttpd.so*
284     %{_libdir}/%{pkgname}/perl
285     %{_libdir}/%{pkgname}/plugins/*.so
286     %dir %{_localstatedir}/lib/%{pkgname}
287 spuhler 296942 %dir %{_logdir}/%{pkgname}
288 spuhler 287129 %{_mandir}/man1/*
289     %{_mandir}/man8/*
290    
291     %files devel
292 spuhler 296942
293 spuhler 287129 %doc LICENSE EXCEPTION LICENSE.GPLv2 README.devel
294     %{_includedir}/%{pkgname}
295     %{_libdir}/%{pkgname}/libslapd.so
296     %{_libdir}/pkgconfig/*
297    
298 spuhler 305913 %files libs
299 spuhler 287129 %doc LICENSE EXCEPTION LICENSE.GPLv2 README.devel
300     %{_libdir}/%{pkgname}/libslapd.so.*

  ViewVC Help
Powered by ViewVC 1.1.30