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