https://issues.shibboleth.net/jira/browse/SSPCPP-217
[shibboleth/cpp-sp.git] / shibboleth.spec.in
1 Name:           shibboleth
2 Summary:        Open source system for attribute-based Web SSO
3 Version:        @-VERSION-@
4 Release:        2
5 #Copyright:     Internet2
6 Group:          System Environment/Libraries
7 License:        Apache style
8 URL:            http://shibboleth.internet2.edu/
9 Source0:        http://shibboleth.internet2.edu/downloads/%{name}-%{version}.tar.gz
10 BuildRoot:      %{_tmppath}/%{name}-%{version}-root
11 BuildRequires:  openssl-devel
12 %if 0%{?suse_version} > 1030
13 BuildRequires:  libXerces-c-devel >= 2.8.0
14 %else
15 BuildRequires:  xerces%{?xercesver}-c-devel >= 2.8.0
16 %endif
17 BuildRequires:  xml-security-c-devel >= 1.4.0
18 BuildRequires:  zlib-devel, opensaml-devel >= 2.2
19 %{?_with_log4cpp:BuildRequires: log4cpp-devel >= 1.0}
20 %{!?_with_log4cpp:BuildRequires: log4shib-devel}
21 %{?_with_fastcgi:BuildRequires: fcgi-devel}
22 %if "%{_vendor}" == "redhat"
23 %{!?_without_builtinapache:BuildRequires: httpd-devel}
24 %endif
25 %if "%{_vendor}" == "suse"
26 %{!?_without_builtinapache:BuildRequires: apache2-devel}
27 %endif
28
29
30 %description
31 Shibboleth, a project of Internet2/MACE, is developing architectures,
32 policy structures, practical technologies, and an open source
33 implementation to support inter-institutional sharing of web resources
34 subject to access controls. In addition, Shibboleth will develop a
35 policy framework that will allow inter-operation within the higher
36 education community.
37
38 This package contains the shibboleth runtime library and apache module.
39
40 %package devel
41 Summary: Shibboleth development Headers
42 Group: Development/Libraries
43 Requires: %{name} = %{version}
44 Requires: opensaml-devel >= 2.2
45
46 %description devel
47 Shibboleth, a project of Internet2/MACE, is developing architectures,
48 policy structures, practical technologies, and an open source
49 implementation to support inter-institutional sharing of web resources
50 subject to access controls. In addition, Shibboleth will develop a
51 policy framework that will allow inter-operation within the higher
52 education community.
53
54 This package contains the headers and other necessary files to build
55 applications that use the shibboleth library.
56
57 %package docs
58 Summary: Shibboleth API Documentation
59 Group: Development/Libraries
60 Requires: %{name} = %{version}
61
62 %description docs
63 Shibboleth Library API documentation generated by doxygen.
64
65 %prep
66 %setup -q
67
68 %build
69 %configure %{?_without_odbc:--disable-odbc} %{?_without_adfs:--disable-adfs} %{?_with_fastcgi} %{?_with_memcached} %{?shib_options}
70 %{__make}
71
72 %install
73 [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
74 %{__make} install NOKEYGEN=1 DESTDIR=$RPM_BUILD_ROOT
75
76 %if "%{_vendor}" == "suse"
77         %{__sed} -i "s/\/var\/log\/httpd/\/var\/log\/apache2/g" \
78                 $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/native.logger
79 %endif
80
81 # Plug the SP into Apache on a recognized system.
82 APACHE_CONFIG="no"
83 if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_13.so ] ; then
84     APACHE_CONFIG="apache.config"
85 fi
86 if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_20.so ] ; then
87     APACHE_CONFIG="apache2.config"
88 fi
89 if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_22.so ] ; then
90     APACHE_CONFIG="apache22.config"
91 fi
92 %{?_without_builtinapache:APACHE_CONFIG="no"}
93 if [ "$APACHE_CONFIG" != "no" ] ; then
94     APACHE_CONFD="no"
95     if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
96             APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
97     fi
98     if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
99             APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
100     fi
101     if [ "$APACHE_CONFD" != "no" ] ; then
102         %{__mkdir} -p $RPM_BUILD_ROOT$APACHE_CONFD
103 %if "%{_vendor}" == "suse"
104         %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \
105             $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$APACHE_CONFIG \
106             > $RPM_BUILD_ROOT$APACHE_CONFD/shib.conf
107 %else
108         %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-@-VERSION-@/g" \
109             $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$APACHE_CONFIG \
110             > $RPM_BUILD_ROOT$APACHE_CONFD/shib.conf
111 %endif
112         echo "%config $APACHE_CONFD/shib.conf" > rpm.filelist
113     else
114         echo "" > rpm.filelist
115     fi
116 else
117     echo "" > rpm.filelist
118 fi
119
120 %if "%{_vendor}" == "redhat"
121         # %{_initddir} not yet in RHEL5, use deprecated %{_initrddir}
122         mkdir -p $RPM_BUILD_ROOT%{_initrddir}
123         %{__cp} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/shibd-%{_vendor} $RPM_BUILD_ROOT%{_initrddir}/shibd
124         %{__chmod} 755 $RPM_BUILD_ROOT%{_initrddir}/shibd
125 %endif
126
127 %check
128 %{__make} check
129
130 %clean
131 [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
132
133 %post
134 %ifnos solaris2.8 solaris2.9 solaris2.10
135 /sbin/ldconfig
136 %endif
137
138 %if "%{_vendor}" == "redhat"
139         # This adds the proper /etc/rc*.d links for the script
140         /sbin/chkconfig --add shibd
141 %endif
142
143 # Key generation
144 cd %{_sysconfdir}/%{name}
145 sh ./keygen.sh -b
146
147 %preun
148 %if "%{_vendor}" == "redhat"
149         if [ "$1" = 0 ] ; then
150                 /sbin/service shibd stop >/dev/null 2>&1
151                 /sbin/chkconfig --del shibd
152         fi
153 %endif
154
155 %postun
156 %ifnos solaris2.8 solaris2.9 solaris2.10
157 /sbin/ldconfig
158 %endif
159
160 %if "%{_vendor}" == "redhat"
161         if [ "$1" -ge "1" ] ; then
162                 #/sbin/service shibd condrestart >/dev/null 2>&1 || :
163                 /etc/init.d/shibd status 1>/dev/null && /etc/init.d/shibd start 1>/dev/null
164         fi
165 %endif
166
167 %posttrans
168 # ugly hack if init script got removed during %postun by upgraded package
169 %if "%{_vendor}" == "redhat"
170         if [ ! -f %{_initrddir}/shibd ] ; then
171                 %{__cp} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/shibd-%{_vendor} $RPM_BUILD_ROOT%{_initrddir}/shibd
172                 %{__chmod} 755 $RPM_BUILD_ROOT%{_initrddir}/shibd
173         fi
174 %endif
175
176 %files -f rpm.filelist
177 %defattr(-,root,root,-)
178 %{_sbindir}/shibd
179 %{_bindir}/mdquery
180 %{_bindir}/resolvertest
181 %{_libdir}/libshibsp.so.*
182 %{_libdir}/libshibsp-lite.so.*
183 %dir %{_libdir}/%{name}
184 %{_libdir}/%{name}/*
185 %exclude %{_libdir}/%{name}/*.la
186 %dir %{_localstatedir}/log/%{name}
187 %dir %{_localstatedir}/run/%{name}
188 %dir %{_datadir}/xml/%{name}
189 %{_datadir}/xml/%{name}/*
190 %dir %{_sysconfdir}/%{name}
191 %config(noreplace) %{_sysconfdir}/%{name}/*.xml
192 %config(noreplace) %{_sysconfdir}/%{name}/*.html
193 %config(noreplace) %{_sysconfdir}/%{name}/*.logger
194 %if "%{_vendor}" == "redhat"
195 %attr(755, root, root) %{_initrddir}/shibd
196 %endif
197 %{_sysconfdir}/%{name}/*.dist
198 %{_sysconfdir}/%{name}/apache*.config
199 %{_sysconfdir}/%{name}/shibd-redhat
200 %{_sysconfdir}/%{name}/shibd-debian
201 %{_sysconfdir}/%{name}/shibd-osx.plist
202 %attr(755, root, root) %{_sysconfdir}/%{name}/keygen.sh
203 %attr(755, root, root) %{_sysconfdir}/%{name}/metagen.sh
204 %{_sysconfdir}/%{name}/*.xsl
205 %docdir %{_datadir}/doc/%{name}
206 %{_datadir}/doc/%{name}/CREDITS.txt
207 %{_datadir}/doc/%{name}/FASTCGI.LICENSE
208 %{_datadir}/doc/%{name}/LICENSE.txt
209 %{_datadir}/doc/%{name}/LOG4CPP.LICENSE
210 %{_datadir}/doc/%{name}/logo.jpg
211 %{_datadir}/doc/%{name}/main.css
212 %{_datadir}/doc/%{name}/NOTICE.txt
213 %{_datadir}/doc/%{name}/OPENSSL.LICENSE
214 %{_datadir}/doc/%{name}/README.txt
215 %{_datadir}/doc/%{name}/RELEASE.txt
216
217 %files devel
218 %defattr(-,root,root,-)
219 %{_includedir}
220 %{_libdir}/libshibsp.so
221 %{_libdir}/libshibsp-lite.so
222
223 %files docs
224 %defattr(644,root,root,755)
225 %doc %{_datadir}/doc/%{name}/api
226
227 %changelog
228 * Wed Dec 3 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.2-1
229 - Bump minor version.
230 - Make keygen.sh executable.
231 - Fixing SUSE Xerces dependency name.
232 - Optionally package shib.conf.
233
234 * Tue Jun 10 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.1-1
235 - Change shib.conf handling to treat as config file.
236
237 * Mon Mar 17 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.0-6
238 - Official release.
239
240 * Fri Jan 18 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.0-5
241 - Release candidate 1.
242
243 * Sun Oct 21 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-4
244 - libexec -> lib/shibboleth changes
245 - Added doc subpackage
246
247 * Thu Aug 16 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-3
248 - First public beta.
249
250 * Fri Jul 13 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-2
251 - Second alpha release.
252
253 * Sun Jun 10 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-1
254 - First alpha release.
255
256 * Mon Oct 2 2006 Scott Cantor   <cantor.2@osu.edu>  - 1.3-11
257 - Applied fix for secadv 20061002
258 - Fix for metadata loader loop
259
260 * Wed Jun 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-10
261 - Applied fix for sec 20060615
262
263 * Fri Apr 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-9
264 - Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support
265
266 * Mon Jan 9 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-8
267 - Applied new fix for secadv 20060109
268
269 * Tue Nov 8 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-7
270 - Applied new fix for secadv 20050901 plus rollup
271
272 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
273 - Minor patches and default config changes
274 - pidfile patch
275 - Fix shib.conf creation
276 - Integrated init.d script
277 - Prevent replacement of config files
278
279 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
280 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
281
282 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
283 - Updated test programs and location of schemas.
284 - move siterefresh to to sbindir
285
286 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
287 - Add selinux-targeted-policy package
288 - move shar to sbindir
289
290 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
291 - Create SPEC file based on various versions in existence.