Bit of cleanup, and add changelog.
[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 touch rpm.filelist
83 APACHE_CONFIG="no"
84 if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_13.so ] ; then
85     APACHE_CONFIG="apache.config"
86 fi
87 if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_20.so ] ; then
88     APACHE_CONFIG="apache2.config"
89 fi
90 if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_22.so ] ; then
91     APACHE_CONFIG="apache22.config"
92 fi
93 %{?_without_builtinapache:APACHE_CONFIG="no"}
94 if [ "$APACHE_CONFIG" != "no" ] ; then
95     APACHE_CONFD="no"
96     if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
97             APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
98     fi
99     if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
100             APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
101     fi
102     if [ "$APACHE_CONFD" != "no" ] ; then
103         %{__mkdir} -p $RPM_BUILD_ROOT$APACHE_CONFD
104 %if "%{_vendor}" == "suse"
105         %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \
106             $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$APACHE_CONFIG \
107             > $RPM_BUILD_ROOT$APACHE_CONFD/shib.conf
108 %else
109         %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-@-VERSION-@/g" \
110             $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$APACHE_CONFIG \
111             > $RPM_BUILD_ROOT$APACHE_CONFD/shib.conf
112 %endif
113         echo "%config $APACHE_CONFD/shib.conf" > rpm.filelist
114     fi
115 fi
116
117 %if "%{_vendor}" == "redhat"
118         # %{_initddir} not yet in RHEL5, use deprecated %{_initrddir}
119         mkdir -p $RPM_BUILD_ROOT%{_initrddir}
120         %{__cp} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/shibd-%{_vendor} $RPM_BUILD_ROOT%{_initrddir}/shibd
121         %{__chmod} 755 $RPM_BUILD_ROOT%{_initrddir}/shibd
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 %if "%{_vendor}" == "redhat"
136         # This adds the proper /etc/rc*.d links for the script
137         /sbin/chkconfig --add shibd
138 %endif
139
140 # Key generation
141 cd %{_sysconfdir}/%{name}
142 sh ./keygen.sh -b
143
144 %preun
145 %if "%{_vendor}" == "redhat"
146         if [ "$1" = 0 ] ; then
147                 /sbin/service shibd stop >/dev/null 2>&1
148                 /sbin/chkconfig --del shibd
149         fi
150 %endif
151
152 %postun
153 %ifnos solaris2.8 solaris2.9 solaris2.10
154 /sbin/ldconfig
155 %endif
156
157 %if "%{_vendor}" == "redhat"
158         if [ "$1" -ge "1" ] ; then
159                 #/sbin/service shibd condrestart >/dev/null 2>&1 || :
160                 /etc/init.d/shibd status 1>/dev/null && /etc/init.d/shibd start 1>/dev/null
161         fi
162 %endif
163
164 %posttrans
165 # ugly hack if init script got removed during %postun by upgraded (buggy/2.1) package
166 %if "%{_vendor}" == "redhat"
167         if [ ! -f %{_initrddir}/shibd ] ; then
168                 %{__cp} -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/shibd-%{_vendor} $RPM_BUILD_ROOT%{_initrddir}/shibd
169                 %{__chmod} 755 $RPM_BUILD_ROOT%{_initrddir}/shibd
170         fi
171 %endif
172
173 %files -f rpm.filelist
174 %defattr(-,root,root,-)
175 %{_sbindir}/shibd
176 %{_bindir}/mdquery
177 %{_bindir}/resolvertest
178 %{_libdir}/libshibsp.so.*
179 %{_libdir}/libshibsp-lite.so.*
180 %dir %{_libdir}/%{name}
181 %{_libdir}/%{name}/*
182 %exclude %{_libdir}/%{name}/*.la
183 %dir %{_localstatedir}/log/%{name}
184 %dir %{_localstatedir}/run/%{name}
185 %dir %{_datadir}/xml/%{name}
186 %{_datadir}/xml/%{name}/*
187 %dir %{_sysconfdir}/%{name}
188 %config(noreplace) %{_sysconfdir}/%{name}/*.xml
189 %config(noreplace) %{_sysconfdir}/%{name}/*.html
190 %config(noreplace) %{_sysconfdir}/%{name}/*.logger
191 %if "%{_vendor}" == "redhat"
192 %attr(755, root, root) %{_initrddir}/shibd
193 %endif
194 %{_sysconfdir}/%{name}/*.dist
195 %{_sysconfdir}/%{name}/apache*.config
196 %{_sysconfdir}/%{name}/shibd-redhat
197 %{_sysconfdir}/%{name}/shibd-debian
198 %{_sysconfdir}/%{name}/shibd-osx.plist
199 %attr(755, root, root) %{_sysconfdir}/%{name}/keygen.sh
200 %attr(755, root, root) %{_sysconfdir}/%{name}/metagen.sh
201 %{_sysconfdir}/%{name}/*.xsl
202 %docdir %{_datadir}/doc/%{name}
203 %{_datadir}/doc/%{name}/CREDITS.txt
204 %{_datadir}/doc/%{name}/FASTCGI.LICENSE
205 %{_datadir}/doc/%{name}/LICENSE.txt
206 %{_datadir}/doc/%{name}/LOG4CPP.LICENSE
207 %{_datadir}/doc/%{name}/logo.jpg
208 %{_datadir}/doc/%{name}/main.css
209 %{_datadir}/doc/%{name}/NOTICE.txt
210 %{_datadir}/doc/%{name}/OPENSSL.LICENSE
211 %{_datadir}/doc/%{name}/README.txt
212 %{_datadir}/doc/%{name}/RELEASE.txt
213
214 %files devel
215 %defattr(-,root,root,-)
216 %{_includedir}
217 %{_libdir}/libshibsp.so
218 %{_libdir}/libshibsp-lite.so
219
220 %files docs
221 %defattr(644,root,root,755)
222 %doc %{_datadir}/doc/%{name}/api
223
224 %changelog
225 * Tue Jun 23 2009 Scott Cantor  <cantor.2@osu.edu>  - 2.2-2
226 - Reverse without_builtinapache macro test
227 - Fix init script handling on Red Hat to handle upgrades
228
229 * Wed Dec 3 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.2-1
230 - Bump minor version.
231 - Make keygen.sh executable.
232 - Fixing SUSE Xerces dependency name.
233 - Optionally package shib.conf.
234
235 * Tue Jun 10 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.1-1
236 - Change shib.conf handling to treat as config file.
237
238 * Mon Mar 17 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.0-6
239 - Official release.
240
241 * Fri Jan 18 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.0-5
242 - Release candidate 1.
243
244 * Sun Oct 21 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-4
245 - libexec -> lib/shibboleth changes
246 - Added doc subpackage
247
248 * Thu Aug 16 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-3
249 - First public beta.
250
251 * Fri Jul 13 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-2
252 - Second alpha release.
253
254 * Sun Jun 10 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-1
255 - First alpha release.
256
257 * Mon Oct 2 2006 Scott Cantor   <cantor.2@osu.edu>  - 1.3-11
258 - Applied fix for secadv 20061002
259 - Fix for metadata loader loop
260
261 * Wed Jun 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-10
262 - Applied fix for sec 20060615
263
264 * Fri Apr 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-9
265 - Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support
266
267 * Mon Jan 9 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-8
268 - Applied new fix for secadv 20060109
269
270 * Tue Nov 8 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-7
271 - Applied new fix for secadv 20050901 plus rollup
272
273 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
274 - Minor patches and default config changes
275 - pidfile patch
276 - Fix shib.conf creation
277 - Integrated init.d script
278 - Prevent replacement of config files
279
280 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
281 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
282
283 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
284 - Updated test programs and location of schemas.
285 - move siterefresh to to sbindir
286
287 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
288 - Add selinux-targeted-policy package
289 - move shar to sbindir
290
291 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
292 - Create SPEC file based on various versions in existence.