https://issues.shibboleth.net/jira/browse/SSPCPP-152
[shibboleth/cpp-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 Group:          System Environment/Libraries
6 Vendor:         Internet2
7 License:        Apache 2.0
8 URL:            http://shibboleth.internet2.edu/
9 Source0:        %{name}-%{version}.tar.gz
10 BuildRoot:      %{_tmppath}/%{name}-%{version}-root
11
12 BuildRequires:  openssl-devel, curl-devel >= 7.10.6
13 %if 0%{?suse_version} > 1030
14 BuildRequires:  libXerces-c-devel >= 2.8.0
15 %else
16 BuildRequires:  xerces%{?xercesver}-c-devel >= 2.8.0
17 %endif
18 BuildRequires:  xml-security-c-devel >= 1.3.0
19 BuildRequires:  zlib-devel, opensaml-devel >= 1.1.1, opensaml-devel < 2.0
20 %{?_with_log4cpp:BuildRequires: log4cpp-devel >= 1.0}
21 %{!?_with_log4cpp:BuildRequires: log4shib-devel}
22 %{?_with_fastcgi:BuildRequires: fcgi-devel}
23 %if "%{_vendor}" == "redhat"
24 %{!?_without_builtinapache:BuildRequires: httpd-devel}
25 %endif
26 %if "%{_vendor}" == "suse"
27 %{!?_without_builtinapache:BuildRequires: apache2-devel}
28 %endif
29
30
31 %description
32 Shibboleth, a project of Internet2/MACE, is is an open source,
33 attribute-based, cross-domain web single sign-on package, primarily
34 based on the SAML standard.
35
36 This package contains the Shibboleth runtime libraries and Apache
37 server module.
38
39 %package devel
40 Summary: Shibboleth development files
41 Group: Development/Libraries
42 Requires: %{name} = %{version}
43
44 %description devel
45 Shibboleth, a project of Internet2/MACE, is is an open source,
46 attribute-based, cross-domain web single sign-on package, primarily
47 based on the SAML standard.
48
49 This package contains the headers and other necessary files to build
50 extensions using the Shibboleth runtime libraries.
51
52 %prep
53 %setup -q
54
55 %build
56 %configure %{?_with_fastcgi} %{?shib_options}
57 %{__make}
58
59 %install
60 [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
61 %{__make} install DESTDIR=$RPM_BUILD_ROOT
62
63 %if "%{_vendor}" == "suse"
64         %{__sed} -i "s/\/var\/log\/httpd/\/var\/log\/apache2/g" \
65                 $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/native.logger
66 %endif
67
68 find $RPM_BUILD_ROOT/%{_libexecdir} -type f -or -type l |
69   %{__sed} -e "s|$RPM_BUILD_ROOT||" | sort > rpm.filelist
70
71 %check
72 %{__make} check
73
74 %clean
75 [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
76
77 %post
78 %ifnos solaris2.8 solaris2.9 solaris2.10
79 /sbin/ldconfig
80 %endif
81
82 # Plug the SP into Apache on a recognized system.
83 APACHE_CONFIG="no"
84 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_13.so ] ; then
85         APACHE_CONFIG="apache.config"
86 fi
87 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_20.so ] ; then
88         APACHE_CONFIG="apache2.config"
89 fi
90 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_22.so ] ; then
91         APACHE_CONFIG="apache22.config"
92 fi
93 if [ "$APACHE_CONFIG" != "no" ] ; then
94         APACHE_CONFD="no"
95         if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
96                 APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
97         fi
98         if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
99                 APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
100         fi
101         if [ "$APACHE_CONFD" != "no" ] ; then
102                 if [ ! -f $APACHE_CONFD/shib.conf ] ; then
103 %if "%{_vendor}" == "suse"
104                     %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \
105                                 %{_sysconfdir}/%{name}/$APACHE_CONFIG \
106                                 > $APACHE_CONFD/shib.conf
107 %else
108                         %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-@-VERSION-@/g" \
109                             %{_sysconfdir}/%{name}/$APACHE_CONFIG \
110                             > $APACHE_CONFD/shib.conf
111 %endif
112                 fi
113         fi
114 fi
115
116 # Install the shibd init.d scripts and service
117 %if "%{_vendor}" == "redhat"
118         if [ -d %{_sysconfdir}/init.d ] ; then
119                 if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then
120                         %{__cp} -p %{_sysconfdir}/shibboleth/shibd-%{_vendor} %{_sysconfdir}/init.d/shibd
121                         %{__chmod} 755 %{_sysconfdir}/init.d/shibd
122                         chkconfig --add shibd
123                 fi
124         fi
125 %endif
126
127 %postun
128 %ifnos solaris2.8 solaris2.9 solaris2.10 
129 /sbin/ldconfig
130 %endif
131
132 # delete the Apache configuration if we're being removed
133 [ "$1" = 0 ] || exit 0
134 [ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && \
135     %{__rm} -f %{_sysconfdir}/httpd/conf.d/shib.conf
136 [ -f %{_sysconfdir}/apache2/conf.d/shib.conf ] && \
137     %{__rm} -f %{_sysconfdir}/apache2/conf.d/shib.conf
138
139 # clear init.d state
140 %if "%{_vendor}" == "redhat"
141         chkconfig --del shibd
142         [ -f %{_sysconfdir}/init.d/shibd ] && \
143             %{__rm} -f %{_sysconfdir}/init.d/shibd
144 %endif
145
146 %files -f rpm.filelist
147 %defattr(-,root,root,-)
148 %{_sbindir}/shibd
149 %{_sbindir}/siterefresh
150 %{_bindir}/shibtest
151 %{_libdir}/libshib.so.*
152 %{_libdir}/libshib-target.so.*
153 %dir %{_localstatedir}/log/shibboleth
154 %dir %{_datadir}/xml/shibboleth
155 %{_datadir}/xml/shibboleth/*.xsd
156 %{_datadir}/xml/shibboleth/*.xsl
157 %dir %{_sysconfdir}/shibboleth
158 %config(noreplace) %{_sysconfdir}/shibboleth/*.xml
159 %config(noreplace) %{_sysconfdir}/shibboleth/*.html
160 %config(noreplace) %{_sysconfdir}/shibboleth/*.logger
161 %config %{_sysconfdir}/shibboleth/sp-example.crt
162 %config %{_sysconfdir}/shibboleth/sp-example.key
163 %{_sysconfdir}/shibboleth/*.dist
164 %{_sysconfdir}/shibboleth/apache*.config
165 %{_sysconfdir}/%{name}/shibd-redhat
166 %{_sysconfdir}/%{name}/shibd-debian
167 %{_sysconfdir}/%{name}/shibd-osx.plist
168 %docdir %{_datadir}/doc/shibboleth
169 %{_datadir}/doc/shibboleth
170
171 %exclude %{_bindir}/posttest
172 %exclude %{_bindir}/test-client
173 %exclude %{_libexecdir}/*.la
174
175 %files devel
176 %defattr(-,root,root,-)
177 %{_includedir}
178 %{_libdir}/libshib.so
179 %{_libdir}/libshib-target.so
180
181 %changelog
182 * Mon Dec 17 2007 Scott Cantor   <cantor.2@osu.edu>  - 1.3.1-2
183 - 1.3.1 initial release
184
185 * Sat Sep 15 2007 Scott Cantor   <cantor.2@osu.edu>  - 1.3.1-1
186 - 1.3.1 release candidate
187
188 * Mon Oct 2 2006 Scott Cantor   <cantor.2@osu.edu>  - 1.3-11
189 - Applied fix for secadv 20061002
190 - Fix for metadata loader loop
191
192 * Wed Jun 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-10
193 - Applied fix for sec 20060615
194
195 * Fri Apr 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-9
196 - Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support
197
198 * Mon Jan 9 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-8
199 - Applied new fix for secadv 20060109
200
201 * Tue Nov 8 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-7
202 - Applied new fix for secadv 20050901 plus rollup
203
204 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
205 - Minor patches and default config changes
206 - pidfile patch
207 - Fix shib.conf creation
208 - Integrated init.d script
209 - Prevent replacement of config files
210
211 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
212 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
213
214 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
215 - Updated test programs and location of schemas.
216 - move siterefresh to to sbindir
217
218 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
219 - Add selinux-targeted-policy package
220 - move shar to sbindir
221
222 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
223 - Create SPEC file based on various versions in existence.