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