Remove stale packaging files, adjust log perms in specfile.
[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:          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 %attr(0750,-,-) %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,-,-) %{_sysconfdir}/%{name}/keygen.sh
222 %attr(755,-,-) %{_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 Jun 10 2011  Scott Cantor  <cantor.2@osu.edu>  - 2.4.3-1
236 - Log files shouldn't be world readable.
237
238 * Fri Dec 25 2009  Scott Cantor  <cantor.2@osu.edu>  - 2.4-1
239 - Update dependencies.
240
241 * Mon Nov 23 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.3.1-1
242 - Reset revision for 2.3.1 release
243
244 * Wed Aug 19 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.2.1-2
245 - SuSE init script changes
246 - Restart Apache on removal, not just upgrade
247 - Fix scriptlet exit values when Apache is stopped
248
249 * Mon Aug 10 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.2.1-1
250 - Doc handling changes
251 - SuSE init script
252
253 * Tue Aug 4 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.2.1-1
254 - Initial version for 2.2.1, with shibd/httpd restart on upgrade
255
256 * Thu Jun 25 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.2-3
257 - Add additional cleanup to posttrans fix
258
259 * Tue Jun 23 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.2-2
260 - Reverse without_builtinapache macro test
261 - Fix init script handling on Red Hat to handle upgrades
262
263 * Wed Dec 3 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.2-1
264 - Bump minor version.
265 - Make keygen.sh executable.
266 - Fixing SUSE Xerces dependency name.
267 - Optionally package shib.conf.
268
269 * Tue Jun 10 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.1-1
270 - Change shib.conf handling to treat as config file.
271
272 * Mon Mar 17 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.0-6
273 - Official release.
274
275 * Fri Jan 18 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.0-5
276 - Release candidate 1.
277
278 * Sun Oct 21 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-4
279 - libexec -> lib/shibboleth changes
280 - Added doc subpackage
281
282 * Thu Aug 16 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-3
283 - First public beta.
284
285 * Fri Jul 13 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-2
286 - Second alpha release.
287
288 * Sun Jun 10 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-1
289 - First alpha release.
290
291 * Mon Oct 2 2006 Scott Cantor   <cantor.2@osu.edu>  - 1.3-11
292 - Applied fix for secadv 20061002
293 - Fix for metadata loader loop
294
295 * Wed Jun 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-10
296 - Applied fix for sec 20060615
297
298 * Fri Apr 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-9
299 - Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support
300
301 * Mon Jan 9 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-8
302 - Applied new fix for secadv 20060109
303
304 * Tue Nov 8 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-7
305 - Applied new fix for secadv 20050901 plus rollup
306
307 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
308 - Minor patches and default config changes
309 - pidfile patch
310 - Fix shib.conf creation
311 - Integrated init.d script
312 - Prevent replacement of config files
313
314 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
315 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
316
317 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
318 - Updated test programs and location of schemas.
319 - move siterefresh to to sbindir
320
321 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
322 - Add selinux-targeted-policy package
323 - move shar to sbindir
324
325 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
326 - Create SPEC file based on various versions in existence.