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