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

  ViewVC Help
Powered by ViewVC 1.1.30