Bump version, add overall version to log.
[shibboleth/cpp-sp.git] / shibboleth.spec.in
1 Name:           @PACKAGE@
2 Version:        @PACKAGE_VERSION@
3 Release:        1
4 Summary:    Open source system for attribute-based Web SSO
5 Group:          System Environment/Libraries
6 Vendor:     Internet2
7 License:        Apache 2.0
8 URL:            http://shibboleth.internet2.edu/
9 Source:     %{name}-sp-%{version}.tar.gz
10 BuildRoot:      %{_tmppath}/%{name}-%{version}-root
11 PreReq:     openssl
12 %if 0%{?suse_version} > 1030
13 PreReq:         %{insserv_prereq}
14 BuildRequires:  libXerces-c-devel >= 2.8.0
15 BuildRequires:  libxml-security-c-devel >= 1.4.0
16 BuildRequires:  libxmltooling-devel >= 1.3
17 BuildRequires:  libsaml-devel >= 2.3
18 %{?_with_log4cpp:BuildRequires: liblog4cpp-devel >= 1.0}
19 %{!?_with_log4cpp:BuildRequires: liblog4shib-devel}
20 %else
21 BuildRequires:  xerces%{?xercesver}-c-devel >= 2.8.0
22 BuildRequires:  xml-security-c-devel >= 1.4.0
23 BuildRequires:  xmltooling-devel >= 1.3
24 BuildRequires:  opensaml-devel >= 2.3
25 %{?_with_log4cpp:BuildRequires: log4cpp-devel >= 1.0}
26 %{!?_with_log4cpp:BuildRequires: log4shib-devel}
27 %endif
28 BuildRequires:  gcc-c++
29 %{!?_without_doxygen:BuildRequires: doxygen}
30 %{!?_without_odbc:BuildRequires:unixODBC-devel}
31 BuildRequires:  zlib-devel
32 %{?_with_fastcgi:BuildRequires: fcgi-devel}
33 %if "%{_vendor}" == "redhat"
34 %{!?_without_builtinapache:BuildRequires: httpd-devel}
35 BuildRequires: redhat-rpm-config
36 %endif
37 %if "%{_vendor}" == "suse"
38 %{!?_without_builtinapache:BuildRequires: apache2-devel}
39 %endif
40
41 %if "%{_vendor}" == "suse"
42 %define pkgdocdir %{_docdir}/%{name}
43 %else
44 %define pkgdocdir %{_docdir}/%{name}-%{version}
45 %endif
46
47 %description
48 Shibboleth is a Web Single Sign-On implementations based on OpenSAML
49 that supports multiple protocols, federated identity, and the extensible
50 exchange of rich attributes subject to privacy controls.
51
52 This package contains the Shibboleth Service Provider runtime libraries
53 and Apache module(s).
54
55 %package devel
56 Summary: Shibboleth development Headers
57 Group: Development/Libraries
58 Requires: %{name} = %{version}
59 %if 0%{?suse_version} > 1030
60 Requires: libXerces-c-devel >= 2.8.0
61 Requires: libxml-security-c-devel >= 1.4.0
62 Requires: libxmltooling-devel >= 1.3
63 Requires: libsaml-devel >= 2.3
64 %{?_with_log4cpp:Requires: liblog4cpp-devel >= 1.0}
65 %{!?_with_log4cpp:Requires: liblog4shib-devel}
66 %else
67 Requires: xerces%{?xercesver}-c-devel >= 2.8.0
68 Requires: xml-security-c-devel >= 1.4.0
69 Requires: xmltooling-devel >= 1.3
70 Requires: opensaml-devel >= 2.3
71 %{?_with_log4cpp:Requires: log4cpp-devel >= 1.0}
72 %{!?_with_log4cpp:Requires: log4shib-devel}
73 %endif
74
75 %description devel
76 Shibboleth is a Web Single Sign-On implementations based on OpenSAML
77 that supports multiple protocols, federated identity, and the extensible
78 exchange of rich attributes subject to privacy controls.
79
80 This package includes files needed for development with Shibboleth.
81
82
83 %prep
84 %setup -q
85
86 %build
87 %configure %{?_without_odbc:--disable-odbc} %{?_without_adfs:--disable-adfs} %{?_with_fastcgi} %{?_with_memcached} %{?shib_options}
88 %{__make} pkgdocdir=%{pkgdocdir}
89
90 %install
91 %{__make} install NOKEYGEN=1 DESTDIR=$RPM_BUILD_ROOT pkgdocdir=%{pkgdocdir}
92
93 %if "%{_vendor}" == "suse"
94         %{__sed} -i "s/\/var\/log\/httpd/\/var\/log\/apache2/g" \
95                 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/native.logger
96 %endif
97
98 # Plug the SP into the built-in Apache on a recognized system.
99 touch rpm.filelist
100 APACHE_CONFIG="no"
101 if [ -f $RPM_BUILD_ROOT%{_libdir}/%{name}/mod_shib_13.so ] ; then
102     APACHE_CONFIG="apache.config"
103 fi
104 if [ -f $RPM_BUILD_ROOT%{_libdir}/%{name}/mod_shib_20.so ] ; then
105     APACHE_CONFIG="apache2.config"
106 fi
107 if [ -f $RPM_BUILD_ROOT%{_libdir}/%{name}/mod_shib_22.so ] ; then
108     APACHE_CONFIG="apache22.config"
109 fi
110 %{?_without_builtinapache:APACHE_CONFIG="no"}
111 if [ "$APACHE_CONFIG" != "no" ] ; then
112     APACHE_CONFD="no"
113     if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
114             APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
115     fi
116     if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
117             APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
118     fi
119     if [ "$APACHE_CONFD" != "no" ] ; then
120         %{__mkdir} -p $RPM_BUILD_ROOT$APACHE_CONFD
121         %{__cp} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$APACHE_CONFIG $RPM_BUILD_ROOT$APACHE_CONFD/shib.conf 
122         echo "%config $APACHE_CONFD/shib.conf" > rpm.filelist
123     fi
124 fi
125
126 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "suse"
127         # %{_initddir} not yet in RHEL5, use deprecated %{_initrddir}
128         install -d -m 0755 $RPM_BUILD_ROOT%{_initrddir}
129         install -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/shibd-%{_vendor} $RPM_BUILD_ROOT%{_initrddir}/shibd
130 %if "%{_vendor}" == "suse"
131         install -d -m 0755 $RPM_BUILD_ROOT/%{_sbindir}
132         %{__ln_s} -f %{_initrddir}/shibd $RPM_BUILD_ROOT%{_sbindir}/rcshibd
133 %endif
134 %endif
135
136 %check
137 %{__make} check
138
139 %clean
140 [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
141
142 %post
143 %ifnos solaris2.8 solaris2.9 solaris2.10
144 /sbin/ldconfig
145 %endif
146
147 # Key generation
148 cd %{_sysconfdir}/%{name}
149 sh ./keygen.sh -b
150
151 %if "%{_vendor}" == "redhat"
152         # This adds the proper /etc/rc*.d links for the script
153         /sbin/chkconfig --add shibd
154         # On upgrade, restart components if they're already running.
155     if [ "$1" -gt "1" ] ; then
156         /etc/init.d/shibd status 1>/dev/null && /etc/init.d/shibd restart 1>/dev/null
157         %{!?_without_builtinapache:/etc/init.d/httpd status 1>/dev/null && /etc/init.d/httpd restart 1>/dev/null}
158         exit 0
159     fi
160 %endif
161 %if "%{_vendor}" == "suse"
162     # This adds the proper /etc/rc*.d links for the script
163     cd /
164     %insserv_force_if_yast shibd
165 %endif
166
167 %preun
168 %if "%{_vendor}" == "redhat"
169         if [ "$1" = 0 ] ; then
170                 /sbin/service shibd stop >/dev/null 2>&1
171                 /sbin/chkconfig --del shibd
172         %{!?_without_builtinapache:/etc/init.d/httpd status 1>/dev/null && /etc/init.d/httpd restart 1>/dev/null}
173         fi
174 %endif
175 %if "%{_vendor}" == "suse"
176     %stop_on_removal shibd
177     if [ "$1" = 0 ] ; then
178         %{!?_without_builtinapache:/etc/init.d/apache2 status 1>/dev/null && /etc/init.d/apache2 restart 1>/dev/null}
179     fi
180 %endif
181 exit 0
182
183 %postun
184 %ifnos solaris2.8 solaris2.9 solaris2.10
185 /sbin/ldconfig
186 %endif
187 %if "%{_vendor}" == "suse"
188 cd /
189 %restart_on_update shibd
190 %{!?_without_builtinapache:%restart_on_update apache2}
191 %{insserv_cleanup}
192 %endif
193
194 %posttrans
195 # ugly hack if init script got removed during %postun by upgraded (buggy/2.1) package
196 %if "%{_vendor}" == "redhat"
197     if [ ! -f %{_initrddir}/shibd ] ; then
198         if [ -f %{_sysconfdir}/%{name}/shibd-%{_vendor} ] ; then
199             %{__cp} -p %{_sysconfdir}/%{name}/shibd-%{_vendor} %{_initrddir}/shibd
200             %{__chmod} 755 %{_initrddir}/shibd
201             /sbin/chkconfig --add shibd
202         fi
203     fi
204 %endif
205
206 %files -f rpm.filelist
207 %defattr(-,root,root,-)
208 %{_sbindir}/shibd
209 %{_bindir}/mdquery
210 %{_bindir}/resolvertest
211 %{_libdir}/libshibsp.so.*
212 %{_libdir}/libshibsp-lite.so.*
213 %dir %{_libdir}/%{name}
214 %{_libdir}/%{name}/*
215 %exclude %{_libdir}/%{name}/*.la
216 %dir %{_localstatedir}/log/%{name}
217 %dir %{_localstatedir}/run/%{name}
218 %dir %{_datadir}/xml/%{name}
219 %{_datadir}/xml/%{name}/*
220 %dir %{_sysconfdir}/%{name}
221 %config(noreplace) %{_sysconfdir}/%{name}/*.xml
222 %config(noreplace) %{_sysconfdir}/%{name}/*.html
223 %config(noreplace) %{_sysconfdir}/%{name}/*.logger
224 %if "%{_vendor}" == "redhat" || "%{_vendor}" == "suse"
225 %config %{_initrddir}/shibd
226 %endif
227 %if "%{_vendor}" == "suse"
228 %{_sbindir}/rcshibd
229 %endif
230 %{_sysconfdir}/%{name}/*.dist
231 %{_sysconfdir}/%{name}/apache*.config
232 %{_sysconfdir}/%{name}/shibd-*
233 %attr(755, root, root) %{_sysconfdir}/%{name}/keygen.sh
234 %attr(755, root, root) %{_sysconfdir}/%{name}/metagen.sh
235 %{_sysconfdir}/%{name}/*.xsl
236 %doc %{pkgdocdir}
237 %exclude %{pkgdocdir}/api
238
239 %files devel
240 %defattr(-,root,root,-)
241 %{_includedir}/*
242 %{_libdir}/libshibsp.so
243 %{_libdir}/libshibsp-lite.so
244 %doc %{pkgdocdir}/api
245
246 %changelog
247 * Mon Nov 23 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.3.1-1
248 - Reset revision for 2.3.1 release
249
250 * Wed Aug 19 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.2.1-2
251 - SuSE init script changes
252 - Restart Apache on removal, not just upgrade
253 - Fix scriptlet exit values when Apache is stopped
254
255 * Mon Aug 10 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.2.1-1
256 - Doc handling changes
257 - SuSE init script
258
259 * Tue Aug 4 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.2.1-1
260 - Initial version for 2.2.1, with shibd/httpd restart on upgrade
261
262 * Thu Jun 25 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.2-3
263 - Add additional cleanup to posttrans fix
264
265 * Tue Jun 23 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.2-2
266 - Reverse without_builtinapache macro test
267 - Fix init script handling on Red Hat to handle upgrades
268
269 * Wed Dec 3 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.2-1
270 - Bump minor version.
271 - Make keygen.sh executable.
272 - Fixing SUSE Xerces dependency name.
273 - Optionally package shib.conf.
274
275 * Tue Jun 10 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.1-1
276 - Change shib.conf handling to treat as config file.
277
278 * Mon Mar 17 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.0-6
279 - Official release.
280
281 * Fri Jan 18 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.0-5
282 - Release candidate 1.
283
284 * Sun Oct 21 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-4
285 - libexec -> lib/shibboleth changes
286 - Added doc subpackage
287
288 * Thu Aug 16 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-3
289 - First public beta.
290
291 * Fri Jul 13 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-2
292 - Second alpha release.
293
294 * Sun Jun 10 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-1
295 - First alpha release.
296
297 * Mon Oct 2 2006 Scott Cantor   <cantor.2@osu.edu>  - 1.3-11
298 - Applied fix for secadv 20061002
299 - Fix for metadata loader loop
300
301 * Wed Jun 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-10
302 - Applied fix for sec 20060615
303
304 * Fri Apr 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-9
305 - Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support
306
307 * Mon Jan 9 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-8
308 - Applied new fix for secadv 20060109
309
310 * Tue Nov 8 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-7
311 - Applied new fix for secadv 20050901 plus rollup
312
313 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
314 - Minor patches and default config changes
315 - pidfile patch
316 - Fix shib.conf creation
317 - Integrated init.d script
318 - Prevent replacement of config files
319
320 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
321 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
322
323 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
324 - Updated test programs and location of schemas.
325 - move siterefresh to to sbindir
326
327 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
328 - Add selinux-targeted-policy package
329 - move shar to sbindir
330
331 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
332 - Create SPEC file based on various versions in existence.