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