Fix for native log location on SuSE.
[shibboleth/sp.git] / shibboleth.spec.in
1 Name:           shibboleth
2 Summary:        Open source system to enable inter-institutional resource sharing
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
12 BuildRequires:  openssl-devel, curl-devel >= 7.10.6, xerces%{?xercesver}-c-devel >= 2.6.1
13 BuildRequires:  xml-security-c-devel >= 1.3.1, log4cpp-devel >= 0.3.5
14 BuildRequires:  zlib-devel, unixODBC-devel, opensaml-devel >= 2.0
15 %if "%{_vendor}" == "redhat"
16 BuildRequires:  httpd-devel
17 %endif
18 %if "%{_vendor}" == "suse"
19 BuildRequires:  apache2-devel
20 %endif
21
22
23 %description
24 Shibboleth, a project of Internet2/MACE, is developing architectures,
25 policy structures, practical technologies, and an open source
26 implementation to support inter-institutional sharing of web resources
27 subject to access controls. In addition, Shibboleth will develop a
28 policy framework that will allow inter-operation within the higher
29 education community.
30
31 This package contains the shibboleth runtime library and apache module.
32
33 %package devel
34 Summary: Shibboleth development Headers
35 Group: Development/Libraries
36 Requires: %{name} = %{version}
37
38 %description devel
39 Shibboleth, a project of Internet2/MACE, is developing architectures,
40 policy structures, practical technologies, and an open source
41 implementation to support inter-institutional sharing of web resources
42 subject to access controls. In addition, Shibboleth will develop a
43 policy framework that will allow inter-operation within the higher
44 education community.
45
46 This package contains the headers and other necessary files to build
47 applications that use the shibboleth library.
48
49 %package selinux-policy-targeted
50 Summary: SELinux policy targeted configuration for Shibboleth SP
51 Group: System Environment/Base
52 Requires: selinux-policy-targeted-sources
53
54 %description selinux-policy-targeted
55 Shibboleth, a project of Internet2/MACE, is developing architectures,
56 policy structures, practical technologies, and an open source
57 implementation to support inter-institutional sharing of web resources
58 subject to access controls. In addition, Shibboleth will develop a
59 policy framework that will allow inter-operation within the higher
60 education community.
61
62 This package contains the SELinux Policy (source) Configuration to
63 enable the Shibboleth SP to integrate into Apache HTTPD in Red Hat /
64 Fedora's Policy Targeted SELinux implementation.  It requires
65 rebuilding your policy, so you must have the policy-targeted-source
66 installed.
67
68 %prep
69 %setup -q
70
71 %build
72 %configure %{?shib_options}
73 make
74 #make -C selinux
75
76 %install
77 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
78 rm -rf _docs
79 make install DESTDIR=$RPM_BUILD_ROOT
80 make -C selinux install DESTDIR=$RPM_BUILD_ROOT
81 mv $RPM_BUILD_ROOT/usr/doc/%{name} _docs
82
83 %if "%{_vendor}" == "suse"
84         sed -i "s/\/var\/log\/httpd/\/var\/log\/apache2/g" \
85                 $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/native.logger
86 %endif
87
88 find $RPM_BUILD_ROOT/%{_libexecdir} -type f -or -type l | grep \.so |
89   sed -e "s|$RPM_BUILD_ROOT||" | sort > rpm.filelist
90
91 %check || :
92 make check
93
94 %clean
95 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
96
97 %post
98 /sbin/ldconfig
99
100 # Plug the SP into Apache on a recognized system.
101 APACHE_CONFIG="no"
102 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_13.so ] ; then
103         APACHE_CONFIG="apache.config"
104 fi
105 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_20.so ] ; then
106         APACHE_CONFIG="apache2.config"
107 fi
108 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_22.so ] ; then
109         APACHE_CONFIG="apache22.config"
110 fi
111 if [ "$APACHE_CONFIG" != "no" ] ; then
112         APACHE_CONFD="no"
113         if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
114                 APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
115         fi
116         if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
117                 APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
118         fi
119         if [ "$APACHE_CONFD" != "no" ] ; then
120                 if [ ! -f $APACHE_CONFD/shib.conf ] ; then
121 %if "%{_vendor}" == "suse"
122                     sed "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \
123                                 %{_sysconfdir}/%{name}/$APACHE_CONFIG \
124                                 > $APACHE_CONFD/shib.conf
125 %else
126                         sed "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-@-VERSION-@/g" \
127                             %{_sysconfdir}/%{name}/$APACHE_CONFIG \
128                             > $APACHE_CONFD/shib.conf
129 %endif
130                 fi
131         fi
132 fi
133
134 # Install the shibd init.d scripts and service
135 %if "%{_vendor}" == "redhat"
136         if [ -d %{_sysconfdir}/init.d ] ; then
137                 if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then
138                         cp -p %{_sysconfdir}/%{name}/shibd %{_sysconfdir}/init.d/shibd
139                         chmod 755 %{_sysconfdir}/init.d/shibd
140                         chkconfig --add shibd
141                 fi
142         fi
143 %endif
144
145 %postun
146 /sbin/ldconfig
147
148 # delete the Apache configuration if we're being removed
149 [ "$1" = 0 ] || exit 0
150 [ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && \
151     rm -f %{_sysconfdir}/httpd/conf.d/shib.conf
152 [ -f %{_sysconfdir}/apache2/conf.d/shib.conf ] && \
153     rm -f %{_sysconfdir}/apache2/conf.d/shib.conf
154
155 # clear init.d state
156 %if "%{_vendor}" == "redhat"
157         chkconfig --del shibd
158         [ -f %{_sysconfdir}/init.d/shibd ] && \
159             rm -f %{_sysconfdir}/init.d/shibd
160 %endif
161
162 %triggerin selinux-policy-targeted -- %{name}
163 restorecon %{_sbindir}/shibd
164
165 %triggerin selinux-policy-targeted -- selinux-policy-targeted-sources
166 cd %{_sysconfdir}/selinux/targeted/src/policy || exit 1
167 make -W install
168 make load
169 restorecon %{_sbindir}/shibd
170
171 %files -f rpm.filelist
172 %defattr(-,root,root,-)
173 %doc _docs/CREDITS.txt _docs/LICENSE.txt _docs/NOTICE.txt _docs/README.txt _docs/RELEASE.txt
174 %doc _docs/logo.jpg _docs/main.css
175 %{_sbindir}/shibd
176 %{_sbindir}/siterefresh
177 %{_bindir}/samlquery
178 %{_libdir}/libshibsp.so.*
179 %{_libdir}/libshibsp-lite.so.*
180 %dir %{_localstatedir}/log/%{name}
181 %dir %{_datadir}/xml/%{name}
182 %{_datadir}/xml/%{name}
183 %dir %{_sysconfdir}/%{name}
184 %config(noreplace) %{_sysconfdir}/%{name}/*.xml
185 %config(noreplace) %{_sysconfdir}/%{name}/*.html
186 %config(noreplace) %{_sysconfdir}/%{name}/*.logger
187 %config %{_sysconfdir}/%{name}/sp-example.crt
188 %config %{_sysconfdir}/%{name}/sp-example.key
189 %{_sysconfdir}/%{name}/*.dist
190 %{_sysconfdir}/%{name}/apache*.config
191 %{_sysconfdir}/%{name}/shibd
192 %exclude %{_libexecdir}/*.la
193
194 %files devel
195 %defattr(-,root,root,-)
196 %{_includedir}
197 %{_libdir}/libshibsp.so
198 %{_libdir}/libshibsp-lite.so
199
200 %files selinux-policy-targeted
201 %defattr(-,root,root,-)
202 %{_sysconfdir}/selinux/targeted/src/policy/file_contexts/program/*.fc
203 %{_sysconfdir}/selinux/targeted/src/policy/domains/program/*.te
204
205 %changelog
206 * Fri Jul 13 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-2
207 - Second alpha release
208
209 * Sun Jun 10 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-1
210 - First alpha release
211
212 * Mon Oct 2 2006 Scott Cantor   <cantor.2@osu.edu>  - 1.3-11
213 - Applied fix for secadv 20061002
214 - Fix for metadata loader loop
215
216 * Wed Jun 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-10
217 - Applied fix for sec 20060615
218
219 * Fri Apr 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-9
220 - Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support
221
222 * Mon Jan 9 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-8
223 - Applied new fix for secadv 20060109
224
225 * Tue Nov 8 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-7
226 - Applied new fix for secadv 20050901 plus rollup
227
228 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
229 - Minor patches and default config changes
230 - pidfile patch
231 - Fix shib.conf creation
232 - Integrated init.d script
233 - Prevent replacement of config files
234
235 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
236 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
237
238 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
239 - Updated test programs and location of schemas.
240 - move siterefresh to to sbindir
241
242 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
243 - Add selinux-targeted-policy package
244 - move shar to sbindir
245
246 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
247 - Create SPEC file based on various versions in existence.