]>
Commit | Line | Data |
---|---|---|
ff60f2d3 | 1 | Summary: Package that uses webapps configuration |
ce39d734 | 2 | Summary(pl.UTF-8): Pakiet używający konfiguracji aplikacji WWW |
ff60f2d3 | 3 | Name: template-webapp |
8185008c ER |
4 | Version: 0.3 |
5 | Release: 0.3 | |
5ba5cc7a | 6 | License: GPL |
1b5d0c9a | 7 | Group: Applications/WWW |
1ddef0d1 ER |
8 | #Source0: %{name}-%{version}.tar.gz |
9 | # Source0-md5: - | |
94c40923 ER |
10 | #Source1: apache.conf |
11 | #Source2: lighttpd.conf | |
1ddef0d1 | 12 | #URL: - |
b53f8131 | 13 | BuildRequires: rpmbuild(macros) >= 1.268 |
ff60f2d3 | 14 | Requires: webapps |
bc8ecf1d | 15 | # see packages/webapps/webapps.README for description and complete listing |
b65061da ER |
16 | #Requires: webserver(access) |
17 | #Requires: webserver(alias) | |
18 | #Requires: webserver(auth) | |
ff3ba9b3 | 19 | #Requires: webserver(cgi) |
94c40923 | 20 | #Requires: webserver(expires) |
367a5ad4 | 21 | #Requires: webserver(indexfile) |
94c40923 | 22 | #Requires: webserver(mime) |
c7e3b118 | 23 | #Requires: webserver(php) |
69fb8d33 | 24 | #Requires: webserver(setenv) |
9407df51 ER |
25 | BuildArch: noarch |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
ff60f2d3 | 28 | %define _webapps /etc/webapps |
c1b7608a | 29 | %define _webapp %{name} |
ff60f2d3 | 30 | %define _sysconfdir %{_webapps}/%{_webapp} |
e4a4f082 | 31 | #%define _appdir %{_datadir}/%{_webapp} |
87b72dfa | 32 | |
38caece8 ER |
33 | # in case _sysconfdir is not in webapps dir, run this replace pattern |
34 | # before copy-pasting to your spec: :%s#%{_sysconfdir}#%{_webapps}/%{_webapp}#g | |
35 | ||
9407df51 | 36 | %description |
d9acef23 ER |
37 | This .spec is for demonstrating triggers used for linking webapp |
38 | configuration to webserver config dir. | |
9407df51 | 39 | |
9be49f18 JR |
40 | %description -l pl.UTF-8 |
41 | Ten plik .spec służy do pokazania triggerów służących do podłączania | |
cbe1381a | 42 | konfiguracji aplikacji WWW do katalogu konfiguracyjnego serwera WWW. |
832823fd | 43 | |
9407df51 | 44 | %prep |
c27fb8a9 ER |
45 | %setup -q |
46 | ||
66ac8cb1 | 47 | cat > apache.conf <<'EOF' |
98da39be ER |
48 | Alias /%{name} %{_appdir} |
49 | <Directory %{_appdir}> | |
794d0abc ER |
50 | # Apache 2.x |
51 | <IfModule !mod_authz_core.c> | |
52 | Order allow,deny | |
53 | Allow from all | |
54 | </IfModule> | |
55 | # Apache 2.4 | |
56 | <IfModule mod_authz_core.c> | |
57 | Require all granted | |
58 | </IfModule> | |
c27fb8a9 | 59 | </Directory> |
ff60f2d3 | 60 | EOF |
9407df51 | 61 | |
324cf851 ER |
62 | cat > lighttpd.conf <<'EOF' |
63 | alias.url += ( | |
574da12a | 64 | "/%{name}" => "%{_appdir}", |
324cf851 ER |
65 | ) |
66 | EOF | |
67 | ||
9407df51 ER |
68 | %install |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | install -d $RPM_BUILD_ROOT%{_sysconfdir} | |
f36a6fcb | 71 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}} |
498b0e06 | 72 | |
b6cd57ed ER |
73 | cp -a . $RPM_BUILD_ROOT%{_appdir} |
74 | ||
7f007c8b | 75 | cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
8185008c | 76 | cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf |
7f007c8b | 77 | cp -p lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf |
c1b7608a | 78 | |
d22a0298 ER |
79 | mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/apache.conf |
80 | mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/lighttpd.conf | |
8185008c | 81 | cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf |
d22a0298 | 82 | |
7f007c8b | 83 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
8185008c ER |
84 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf |
85 | cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf | |
d22a0298 | 86 | |
0430c8f6 ER |
87 | %clean |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
ff60f2d3 | 90 | # %webapp_* macros usage extracted from /usr/lib/rpm/macros.build: |
4f853f24 ER |
91 | # |
92 | # Usage: | |
ff60f2d3 ER |
93 | # %%webapp_register HTTPD WEBAPP |
94 | # %%webapp_unregister HTTPD WEBAPP | |
4f853f24 | 95 | |
a5bcddf5 | 96 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
ff60f2d3 | 97 | %webapp_register apache %{_webapp} |
9407df51 | 98 | |
a5bcddf5 | 99 | %triggerun -- apache1 < 1.3.37-3, apache1-base |
ff60f2d3 | 100 | %webapp_unregister apache %{_webapp} |
9407df51 | 101 | |
8185008c | 102 | %triggerin -- apache < 2.2.0, apache-base |
ff60f2d3 | 103 | %webapp_register httpd %{_webapp} |
9407df51 | 104 | |
8185008c | 105 | %triggerun -- apache < 2.2.0, apache-base |
ff60f2d3 ER |
106 | %webapp_unregister httpd %{_webapp} |
107 | ||
108 | %triggerin -- lighttpd | |
109 | %webapp_register lighttpd %{_webapp} | |
110 | ||
111 | %triggerun -- lighttpd | |
112 | %webapp_unregister lighttpd %{_webapp} | |
e2b18c9c ER |
113 | |
114 | %files | |
115 | %defattr(644,root,root,755) | |
38caece8 ER |
116 | %dir %attr(750,root,http) %{_sysconfdir} |
117 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
118 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
119 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
120 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php | |
f36a6fcb | 121 | %{_appdir} |