1 Summary: Package that uses webapps configuration
2 Summary(pl.UTF-8): Pakiet używający konfiguracji aplikacji WWW
7 Group: Applications/WWW
8 #Source0: %{name}-%{version}.tar.gz
11 #Source2: lighttpd.conf
13 BuildRequires: rpmbuild(macros) >= 1.268
15 # see packages/webapps/webapps.README for description and complete listing
16 #Requires: webserver(access)
17 #Requires: webserver(alias)
18 #Requires: webserver(auth)
19 #Requires: webserver(cgi)
20 #Requires: webserver(expires)
21 #Requires: webserver(indexfile)
22 #Requires: webserver(mime)
23 #Requires: webserver(php)
24 #Requires: webserver(setenv)
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 %define _webapps /etc/webapps
29 %define _webapp %{name}
30 %define _sysconfdir %{_webapps}/%{_webapp}
31 #%define _appdir %{_datadir}/%{_webapp}
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
37 This .spec is for demonstrating triggers used for linking webapp
38 configuration to webserver config dir.
40 %description -l pl.UTF-8
41 Ten plik .spec służy do pokazania triggerów służących do podłączania
42 konfiguracji aplikacji WWW do katalogu konfiguracyjnego serwera WWW.
47 cat > apache.conf <<'EOF'
48 Alias /%{name} %{_appdir}
49 <Directory %{_appdir}>
51 <IfModule !mod_authz_core.c>
56 <IfModule mod_authz_core.c>
62 cat > lighttpd.conf <<'EOF'
64 "/%{name}" => "%{_appdir}",
69 rm -rf $RPM_BUILD_ROOT
70 install -d $RPM_BUILD_ROOT%{_sysconfdir}
71 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
73 cp -a . $RPM_BUILD_ROOT%{_appdir}
75 cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
76 cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
77 cp -p lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
79 mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/apache.conf
80 mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/lighttpd.conf
81 cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
83 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
84 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
85 cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
88 rm -rf $RPM_BUILD_ROOT
90 # %webapp_* macros usage extracted from /usr/lib/rpm/macros.build:
93 # %%webapp_register HTTPD WEBAPP
94 # %%webapp_unregister HTTPD WEBAPP
96 %triggerin -- apache1 < 1.3.37-3, apache1-base
97 %webapp_register apache %{_webapp}
99 %triggerun -- apache1 < 1.3.37-3, apache1-base
100 %webapp_unregister apache %{_webapp}
102 %triggerin -- apache < 2.2.0, apache-base
103 %webapp_register httpd %{_webapp}
105 %triggerun -- apache < 2.2.0, apache-base
106 %webapp_unregister httpd %{_webapp}
108 %triggerin -- lighttpd
109 %webapp_register lighttpd %{_webapp}
111 %triggerun -- lighttpd
112 %webapp_unregister lighttpd %{_webapp}
115 %defattr(644,root,root,755)
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