summaryrefslogtreecommitdiff
path: root/cas.spec
blob: 439cba12a961ead5131b05d0df20f2810cc48743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
%include	/usr/lib/rpm/macros.java
Summary:	JA-SIG Central Authentication Service
Name:		cas
Version:	3.3.5
Release:	0.3
License:	MIT License
Group:		Networking/Daemons/Java/Servlets
Source0:	http://www.ja-sig.org/downloads/cas/%{name}-server-%{version}-release.tar.gz
# Source0-md5:	c12594a2af98ee2dd11a8c97895d91af
Source1:	%{name}-context.xml
URL:		http://www.ja-sig.org/products/cas/
BuildRequires:	rpm-javaprov
BuildRequires:	rpmbuild(macros) >= 1.540
Requires:	jpackage-utils
Requires:	tomcat >= 6
BuildArch:	noarch
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%define webappdir %{_datadir}/%{name}
%define libdir    %{_datadir}/%{name}/WEB-INF/lib
%define	logdir    %{_var}/log/%{name}

%description
CAS is an authentication system originally created by Yale University
to provide a trusted way for an application to authenticate a user.
CAS became a JA-SIG project in December 2004.

CAS provides enterprise single sign on service. It features:

- An open and well-documented protocol
- An open-source Java server component
- A library of clients for Java, .Net, PHP, Perl, Apache, uPortal and
  others
- Integrates with uPortal, BlueSocket, TikiWiki, Mule, Liferay, Moodle
  and others
- Community documentation and implementation support
- An extensive community of adopters

%package authenticator-spnego
Summary:	Spnego authenticator for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description authenticator-spnego
Spnego authentication backend for CAS Server.

%package authenticator-x509
Summary:	x509 authenticator for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description authenticator-x509
X509 client certificates authentication backend for CAS Server.

%package authenticator-openid
Summary:	OpenID authenticator for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description authenticator-openid
OpenID authentication backend for CAS Server.

%package authenticator-legacy
Summary:	Legacy authenticator for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description authenticator-legacy
Legacy authentication backend for CAS Server.

%package authenticator-radius
Summary:	Radius authenticator for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description authenticator-radius
Radius authentication backend for CAS Server.

%package authenticator-ldap
Summary:	LDAP authenticator for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description authenticator-ldap
LDAP authentication backend for CAS Server.

%package authenticator-generic
Summary:	Generic authenticator for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description authenticator-generic
Generic authentication backend for CAS Server.

%package authenticator-trusted
Summary:	Trusted authenticator for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description authenticator-trusted
Trusted authentication backend for CAS Server.

%package authenticator-jdbc
Summary:	JDBC authenticator for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description authenticator-jdbc
JDBC authentication backend for CAS Server.

%package integration-berkeleydb
Summary:	Berkeleydb ticket registry for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description integration-berkeleydb
BerkeleyDB integration for CAS Server allows to store ticket registry
in berkeleyDB.

%package integration-jboss
Summary:	Jboss ticket registry for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description integration-jboss
Jboss integration for CAS Server allows to store ticket registry in
Jboss internal authentication system.

%package integration-memcached
Summary:	Memory ticket registry for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description integration-memcached
Memcached integration for CAS Server allows to store ticket registry
in memory cache.

%package integration-restlet
Summary:	I have no idea WTF is that, but it is for CAS server
Group:		Libraries/Java
Requires:	%{name} = %{version}-%{release}

%description integration-restlet
I really have no idea WTF is that. It name suggests it is yet another
registry storage driver for CAS, but it does not extends
AbstractDistributedTicketRegistry class.

%prep
%setup -q -n %{name}-server-%{version}
unzip modules/%{name}-server-webapp-%{version}.war -d webapp

rm webapp/WEB-INF/lib/%{name}-server-support-ldap-%{version}.jar

sed -i 's,^\(log4j.appender.logfile.File=\)cas.log$,\1%{logdir}/%{name}.log,' webapp/WEB-INF/classes/log4j.properties

%build

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_datadir},%{_sharedstatedir}/%{name},%{_tomcatconfdir},%{logdir}}

cp -a webapp $RPM_BUILD_ROOT%{webappdir}

MODULES="
  integration-berkeleydb
  integration-jboss
  integration-memcached
  integration-restlet
  support-generic
  support-jdbc
  support-ldap
  support-legacy
  support-openid
  support-radius
  support-spnego
  support-trusted
  support-x509
"

CONFIGFILES="
  classes/log4j.properties
  cas.properties
  deployerConfigContext.xml
  login-webflow.xml
  restlet-servlet.xml
  cas-servlet.xml
  web.xml
"

for i in $MODULES; do
  install modules/%{name}-server-$i-%{version}.jar $RPM_BUILD_ROOT%{libdir}/%{name}-$i-%{version}.jar
done

for i in $CONFIGFILES; do
  mv $RPM_BUILD_ROOT%{webappdir}/WEB-INF/$i $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$(basename $i)
  ln -s %{_sysconfdir}/%{name}/$(basename $i) $RPM_BUILD_ROOT%{webappdir}/WEB-INF/$i
done

install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/context.xml
ln -s %{_sysconfdir}/%{name}/context.xml $RPM_BUILD_ROOT%{_tomcatconfdir}/%{name}.xml

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}
%{_tomcatconfdir}/%{name}.xml
%{_datadir}/%{name}
%exclude %{libdir}/%{name}-support-spnego-%{version}.jar
%exclude %{libdir}/%{name}-integration-berkeleydb-%{version}.jar
%exclude %{libdir}/%{name}-support-x509-%{version}.jar
%exclude %{libdir}/%{name}-integration-jboss-%{version}.jar
%exclude %{libdir}/%{name}-support-openid-%{version}.jar
%exclude %{libdir}/%{name}-support-legacy-%{version}.jar
%exclude %{libdir}/%{name}-support-radius-%{version}.jar
%exclude %{libdir}/%{name}-integration-memcached-%{version}.jar
%exclude %{libdir}/%{name}-integration-restlet-%{version}.jar
%exclude %{libdir}/%{name}-support-ldap-%{version}.jar
%exclude %{libdir}/%{name}-support-generic-%{version}.jar
%exclude %{libdir}/%{name}-support-trusted-%{version}.jar
%exclude %{libdir}/%{name}-support-jdbc-%{version}.jar
%attr(2775,root,servlet) %dir %{_sharedstatedir}/%{name}
%dir %attr(2770,root,servlet) %{logdir}

%files authenticator-spnego
%defattr(644,root,root,755)
%{libdir}/%{name}-support-spnego-%{version}.jar

%files authenticator-x509
%defattr(644,root,root,755)
%{libdir}/%{name}-support-x509-%{version}.jar

%files authenticator-openid
%defattr(644,root,root,755)
%{libdir}/%{name}-support-openid-%{version}.jar

%files authenticator-legacy
%defattr(644,root,root,755)
%{libdir}/%{name}-support-legacy-%{version}.jar

%files authenticator-radius
%defattr(644,root,root,755)
%{libdir}/%{name}-support-radius-%{version}.jar

%files authenticator-ldap
%defattr(644,root,root,755)
%{libdir}/%{name}-support-ldap-%{version}.jar

%files authenticator-generic
%defattr(644,root,root,755)
%{libdir}/%{name}-support-generic-%{version}.jar

%files authenticator-trusted
%defattr(644,root,root,755)
%{libdir}/%{name}-support-trusted-%{version}.jar

%files authenticator-jdbc
%defattr(644,root,root,755)
%{libdir}/%{name}-support-jdbc-%{version}.jar

%files integration-berkeleydb
%defattr(644,root,root,755)
%{libdir}/%{name}-integration-berkeleydb-%{version}.jar

%files integration-jboss
%defattr(644,root,root,755)
%{libdir}/%{name}-integration-jboss-%{version}.jar

%files integration-memcached
%defattr(644,root,root,755)
%{libdir}/%{name}-integration-memcached-%{version}.jar

%files integration-restlet
%defattr(644,root,root,755)
%{libdir}/%{name}-integration-restlet-%{version}.jar