Fix link and Apache conf install.
[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:        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
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, 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                         sed "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-@-VERSION-@/g" \
117                                 %{_sysconfdir}/%{name}/$APACHE_CONFIG \
118                                 > $APACHE_CONFD/shib.conf
119                 fi
120         fi
121 fi
122
123 # Install the shibd init.d scripts and service
124 %if "%{_vendor}" == "redhat"
125         if [ -d %{_sysconfdir}/init.d ] ; then
126                 if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then
127                         cp -p %{_sysconfdir}/%{name}/shibd %{_sysconfdir}/init.d/shibd
128                         chmod 755 %{_sysconfdir}/init.d/shibd
129                         chkconfig --add shibd
130                 fi
131         fi
132 %endif
133
134 %postun
135 /sbin/ldconfig
136
137 # delete the Apache configuration if we're being removed
138 [ "$1" = 0 ] || exit 0
139 [ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && \
140     rm -f %{_sysconfdir}/httpd/conf.d/shib.conf
141 [ -f %{_sysconfdir}/apache2/conf.d/shib.conf ] && \
142     rm -f %{_sysconfdir}/apache2/conf.d/shib.conf
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 %triggerin selinux-policy-targeted -- %{name}
152 restorecon %{_sbindir}/shibd
153
154 %triggerin selinux-policy-targeted -- selinux-policy-targeted-sources
155 cd %{_sysconfdir}/selinux/targeted/src/policy || exit 1
156 make -W install
157 make load
158 restorecon %{_sbindir}/shibd
159
160 %files -f rpm.filelist
161 %defattr(-,root,root,-)
162 %doc _docs/CREDITS.txt _docs/NOTICE.txt _docs/NEWS.txt _docs/logo.jpg
163 %doc _docs/main.css _docs/README.txt _docs/LICENSE.txt
164 %{_sbindir}/shibd
165 %{_sbindir}/siterefresh
166 %{_bindir}/samlquery
167 %{_libdir}/libshibsp.so.*
168 %{_libdir}/libshibsp-lite.so.*
169 %dir %{_localstatedir}/log/%{name}
170 %dir %{_datadir}/xml/%{name}
171 %{_datadir}/xml/%{name}
172 %dir %{_sysconfdir}/%{name}
173 %config(noreplace) %{_sysconfdir}/%{name}/*.xml
174 %config(noreplace) %{_sysconfdir}/%{name}/*.html
175 %config(noreplace) %{_sysconfdir}/%{name}/*.logger
176 %config %{_sysconfdir}/%{name}/sp-example.crt
177 %config %{_sysconfdir}/%{name}/sp-example.key
178 %{_sysconfdir}/%{name}/*.dist
179 %{_sysconfdir}/%{name}/apache*.config
180 %{_sysconfdir}/%{name}/shibd
181 %exclude %{_libexecdir}/*.la
182
183 %files devel
184 %defattr(-,root,root,-)
185 %{_includedir}
186 %{_libdir}/libshibsp.so
187 %{_libdir}/libshibsp-lite.so
188
189 %files selinux-policy-targeted
190 %defattr(-,root,root,-)
191 %{_sysconfdir}/selinux/targeted/src/policy/file_contexts/program/*.fc
192 %{_sysconfdir}/selinux/targeted/src/policy/domains/program/*.te
193
194 %changelog
195 * Mon Oct 2 2006 Scott Cantor   <cantor.2@osu.edu>  - 1.3-11
196 - Applied fix for secadv 20061002
197 - Fix for metadata loader loop
198
199 * Wed Jun 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-10
200 - Applied fix for sec 20060615
201
202 * Fri Apr 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-9
203 - Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support
204
205 * Mon Jan 9 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-8
206 - Applied new fix for secadv 20060109
207
208 * Tue Nov 8 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-7
209 - Applied new fix for secadv 20050901 plus rollup
210
211 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
212 - Minor patches and default config changes
213 - pidfile patch
214 - Fix shib.conf creation
215 - Integrated init.d script
216 - Prevent replacement of config files
217
218 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
219 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
220
221 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
222 - Updated test programs and location of schemas.
223 - move siterefresh to to sbindir
224
225 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
226 - Add selinux-targeted-policy package
227 - move shar to sbindir
228
229 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
230 - Create SPEC file based on various versions in existence.