SuSE has different doc conventions.
[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 find $RPM_BUILD_ROOT/%{_libexecdir} -type f -or -type l | grep \.so |
84   sed -e "s|$RPM_BUILD_ROOT||" | sort > rpm.filelist
85
86 %check || :
87 make check
88
89 %clean
90 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
91
92 %post
93 /sbin/ldconfig
94
95 # Plug the SP into Apache on a recognized system.
96 APACHE_CONFIG="no"
97 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_13.so ] ; then
98         APACHE_CONFIG="apache.config"
99 fi
100 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_20.so ] ; then
101         APACHE_CONFIG="apache2.config"
102 fi
103 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_22.so ] ; then
104         APACHE_CONFIG="apache22.config"
105 fi
106 if [ "$APACHE_CONFIG" != "no" ] ; then
107         APACHE_CONFD="no"
108         if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
109                 APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
110         fi
111         if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
112                 APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
113         fi
114         if [ "$APACHE_CONFD" != "no" ] ; then
115                 if [ ! -f $APACHE_CONFD/shib.conf ] ; then
116 %if "%{_vendor}" == "suse"
117                     sed "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \
118                                 %{_sysconfdir}/%{name}/$APACHE_CONFIG \
119                                 > $APACHE_CONFD/shib.conf
120 %else
121                         sed "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-@-VERSION-@/g" \
122                             %{_sysconfdir}/%{name}/$APACHE_CONFIG \
123                             > $APACHE_CONFD/shib.conf
124 %endif
125                 fi
126         fi
127 fi
128
129 # Install the shibd init.d scripts and service
130 %if "%{_vendor}" == "redhat"
131         if [ -d %{_sysconfdir}/init.d ] ; then
132                 if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then
133                         cp -p %{_sysconfdir}/%{name}/shibd %{_sysconfdir}/init.d/shibd
134                         chmod 755 %{_sysconfdir}/init.d/shibd
135                         chkconfig --add shibd
136                 fi
137         fi
138 %endif
139
140 %postun
141 /sbin/ldconfig
142
143 # delete the Apache configuration if we're being removed
144 [ "$1" = 0 ] || exit 0
145 [ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && \
146     rm -f %{_sysconfdir}/httpd/conf.d/shib.conf
147 [ -f %{_sysconfdir}/apache2/conf.d/shib.conf ] && \
148     rm -f %{_sysconfdir}/apache2/conf.d/shib.conf
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 %triggerin selinux-policy-targeted -- %{name}
158 restorecon %{_sbindir}/shibd
159
160 %triggerin selinux-policy-targeted -- selinux-policy-targeted-sources
161 cd %{_sysconfdir}/selinux/targeted/src/policy || exit 1
162 make -W install
163 make load
164 restorecon %{_sbindir}/shibd
165
166 %files -f rpm.filelist
167 %defattr(-,root,root,-)
168 %doc _docs/CREDITS.txt _docs/LICENSE.txt _docs/NOTICE.txt _docs/README.txt _docs/RELEASE.txt
169 %doc _docs/logo.jpg _docs/main.css
170 %{_sbindir}/shibd
171 %{_sbindir}/siterefresh
172 %{_bindir}/samlquery
173 %{_libdir}/libshibsp.so.*
174 %{_libdir}/libshibsp-lite.so.*
175 %dir %{_localstatedir}/log/%{name}
176 %dir %{_datadir}/xml/%{name}
177 %{_datadir}/xml/%{name}
178 %dir %{_sysconfdir}/%{name}
179 %config(noreplace) %{_sysconfdir}/%{name}/*.xml
180 %config(noreplace) %{_sysconfdir}/%{name}/*.html
181 %config(noreplace) %{_sysconfdir}/%{name}/*.logger
182 %config %{_sysconfdir}/%{name}/sp-example.crt
183 %config %{_sysconfdir}/%{name}/sp-example.key
184 %{_sysconfdir}/%{name}/*.dist
185 %{_sysconfdir}/%{name}/apache*.config
186 %{_sysconfdir}/%{name}/shibd
187 %exclude %{_libexecdir}/*.la
188
189 %files devel
190 %defattr(-,root,root,-)
191 %{_includedir}
192 %{_libdir}/libshibsp.so
193 %{_libdir}/libshibsp-lite.so
194
195 %files selinux-policy-targeted
196 %defattr(-,root,root,-)
197 %{_sysconfdir}/selinux/targeted/src/policy/file_contexts/program/*.fc
198 %{_sysconfdir}/selinux/targeted/src/policy/domains/program/*.te
199
200 %changelog
201 * Fri Jul 13 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-2
202 - Second alpha release
203
204 * Sun Jun 10 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-1
205 - First alpha release
206
207 * Mon Oct 2 2006 Scott Cantor   <cantor.2@osu.edu>  - 1.3-11
208 - Applied fix for secadv 20061002
209 - Fix for metadata loader loop
210
211 * Wed Jun 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-10
212 - Applied fix for sec 20060615
213
214 * Fri Apr 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-9
215 - Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support
216
217 * Mon Jan 9 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-8
218 - Applied new fix for secadv 20060109
219
220 * Tue Nov 8 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-7
221 - Applied new fix for secadv 20050901 plus rollup
222
223 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
224 - Minor patches and default config changes
225 - pidfile patch
226 - Fix shib.conf creation
227 - Integrated init.d script
228 - Prevent replacement of config files
229
230 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
231 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
232
233 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
234 - Updated test programs and location of schemas.
235 - move siterefresh to to sbindir
236
237 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
238 - Add selinux-targeted-policy package
239 - move shar to sbindir
240
241 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
242 - Create SPEC file based on various versions in existence.