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