1 |
< |
### RPM cms frontend 1.0 |
2 |
< |
|
3 |
< |
# Dummy package to get apache-conf installed. |
1 |
> |
### RPM cms frontend 2.0 |
2 |
|
%define cvsserver cvs://:pserver:anonymous@cmscvs.cern.ch:2401/cvs_server/repositories/CMSSW?passwd=AA_:yZZ3e&strategy=export&nocache=true |
3 |
< |
Source0: %cvsserver&module=COMP/WEBTOOLS/Configuration&export=conf&tag=-rSERVER_CONF_1_12&output=/config.tar.gz |
4 |
< |
Source1: %cvsserver&module=COMP/WEBTOOLS/WelcomePages&export=htdocs&tag=-rSERVER_CONF_1_12&output=/htdocs.tar.gz |
5 |
< |
Requires: apache2-conf |
3 |
> |
Source0: %cvsserver&module=COMP/WEBTOOLS/Configuration&export=conf&tag=-rFRONTEND_CONF_2_0&output=/config.tar.gz |
4 |
> |
Source1: %cvsserver&module=COMP/WEBTOOLS/WelcomePages&export=htdocs&tag=-rFRONTEND_HTDOCS_1_0&output=/htdocs.tar.gz |
5 |
> |
Requires: apache2-conf mod_perl2 |
6 |
> |
Obsoletes: cms+frontend+1.3-cmp |
7 |
> |
Obsoletes: cms+frontend+1.2-cmp |
8 |
> |
Obsoletes: cms+frontend+1.1e-cmp |
9 |
> |
Obsoletes: cms+frontend+1.1d-cmp |
10 |
> |
Obsoletes: cms+frontend+1.1c-cmp |
11 |
> |
Obsoletes: cms+frontend+1.1b-cmp |
12 |
> |
Obsoletes: cms+frontend+1.1-cmp |
13 |
> |
Obsoletes: cms+frontend+1.0-cmp11 |
14 |
> |
Obsoletes: cms+frontend+1.0-cmp10 |
15 |
> |
Obsoletes: cms+frontend+1.0-cmp9 |
16 |
> |
Obsoletes: cms+frontend+1.0-cmp8 |
17 |
> |
Obsoletes: cms+frontend+1.0-cmp7 |
18 |
> |
Obsoletes: cms+frontend+1.0-cmp6 |
19 |
> |
Obsoletes: cms+frontend+1.0-cmp5 |
20 |
> |
Obsoletes: cms+frontend+1.0-cmp4 |
21 |
> |
Obsoletes: cms+frontend+1.0-cmp3 |
22 |
> |
Obsoletes: cms+frontend+1.0-cmp2 |
23 |
> |
Obsoletes: cms+frontend+1.0-cmp |
24 |
|
|
25 |
|
%prep |
26 |
|
%setup -T -b 0 -n conf |
28 |
|
|
29 |
|
%build |
30 |
|
%install |
31 |
+ |
# Make directory for various resources of this package. |
32 |
+ |
rm -fr %instroot/htdocs/* |
33 |
+ |
rm -fr %instroot/apache2/*rewrites.d |
34 |
+ |
rm -f %instroot/apache2/apps.d/*frontend.conf |
35 |
+ |
rm -f %instroot/apache2/*/CMSAuth.pm |
36 |
+ |
rm -f %instroot/apache2/*/update-cookie-key |
37 |
+ |
|
38 |
+ |
mkdir -p %instroot/apache2/apps.d |
39 |
+ |
mkdir -p %instroot/apache2/rewrites.d |
40 |
+ |
mkdir -p %instroot/apache2/ssl_rewrites.d |
41 |
+ |
mkdir -p %instroot/apache2/var/cookie-keys |
42 |
+ |
mkdir -p %instroot/apache2/htdocs |
43 |
+ |
mkdir -p %instroot/apache2/auth |
44 |
+ |
mkdir -p %instroot/apache2/etc |
45 |
+ |
|
46 |
+ |
# Replace template variables in configuration files with actual paths. |
47 |
+ |
perl -p -i -e " |
48 |
+ |
s|\@SERVER_ROOT\@|%instroot/apache2|g; |
49 |
+ |
s|\@APACHE2_ROOT\@|$APACHE2_ROOT|g; |
50 |
+ |
s|\@MOD_PERL2_ROOT\@|$MOD_PERL2_ROOT|g" \ |
51 |
+ |
%_builddir/conf/*/*.conf |
52 |
+ |
|
53 |
+ |
# Copy files to the server setup directory. |
54 |
+ |
cp -p %_builddir/conf/CMSAuth.pm %instroot/apache2/conf/CMSAuth.pm |
55 |
+ |
cp -p %_builddir/conf/cms-centres.txt %instroot/apache2/etc/cms-centres.txt |
56 |
+ |
cp -p %_builddir/conf/update-cookie-key %instroot/apache2/etc/update-cookie-key |
57 |
+ |
cp -p %_builddir/conf/apps.d/*frontend.conf %instroot/apache2/apps.d |
58 |
+ |
cp -p %_builddir/conf/rewrites.d/*.conf %instroot/apache2/rewrites.d |
59 |
+ |
cp -p %_builddir/conf/ssl_rewrites.d/*.conf %instroot/apache2/ssl_rewrites.d |
60 |
+ |
cp -rp %_builddir/htdocs/* %instroot/apache2/htdocs |
61 |
+ |
|
62 |
+ |
%post |
63 |
+ |
# Relocate files. |
64 |
+ |
perl -p -i -e "s|%instroot|$RPM_INSTALL_PREFIX|g" $RPM_INSTALL_PREFIX/apache2/*.d/*.conf |
65 |
+ |
|
66 |
+ |
# Deter attempts to modify installed files locally. |
67 |
+ |
chmod a-w $RPM_INSTALL_PREFIX/apache2/*.d/*.conf |
68 |
+ |
chmod a-w $RPM_INSTALL_PREFIX/apache2/conf/CMSAuth.pm |
69 |
+ |
chmod a-w $RPM_INSTALL_PREFIX/apache2/etc/update-cookie-key |
70 |
+ |
|
71 |
+ |
%files |
72 |
+ |
%i/ |
73 |
+ |
%dir %instroot/apache2/var/cookie-keys |
74 |
+ |
%dir %instroot/apache2/rewrites.d |
75 |
+ |
%dir %instroot/apache2/ssl_rewrites.d |
76 |
+ |
%dir %instroot/apache2/auth |
77 |
+ |
%dir %instroot/apache2/etc |
78 |
+ |
%attr(555,-,-) %instroot/apache2/etc/update-cookie-key |
79 |
+ |
%config %instroot/apache2/etc/cms-centres.txt |
80 |
+ |
%config %attr(444,-,-) %instroot/apache2/apps.d/*frontend.conf |
81 |
+ |
%config %attr(444,-,-) %instroot/apache2/rewrites.d/*.conf |
82 |
+ |
%config %attr(444,-,-) %instroot/apache2/ssl_rewrites.d/*.conf |
83 |
+ |
%attr(444,-,-) %instroot/apache2/conf/CMSAuth.pm |
84 |
+ |
%instroot/apache2/htdocs/* |