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
16 Requires(triggerpostun): sed >= 4.0
18 # see packages/webapps/webapps.README for description and complete listing
19 #Requires: webserver(access)
20 #Requires: webserver(alias)
21 #Requires: webserver(auth)
22 #Requires: webserver(cgi)
23 #Requires: webserver(indexfile)
24 #Requires: webserver(php)
25 #Requires: webserver(setenv)
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 %define _webapps /etc/webapps
30 %define _webapp %{name}
31 %define _sysconfdir %{_webapps}/%{_webapp}
32 #%define _appdir %{_datadir}/%{_webapp}
34 # in case _sysconfdir is not in webapps dir, run this replace pattern
35 # before copy-pasting to your spec: :%s#%{_sysconfdir}#%{_webapps}/%{_webapp}#g
38 This .spec is for demonstrating triggers used for linking webapp
39 configuration to webserver config dir.
41 %description -l pl.UTF-8
42 Ten plik .spec służy do pokazania triggerów służących do podłączania
43 konfiguracji aplikacji WWW do katalogu konfiguracyjnego serwera WWW.
48 cat > apache.conf <<'EOF'
49 Alias /%{name} %{_appdir}
50 <Directory %{_appdir}>
55 cat > lighttpd.conf <<'EOF'
57 "/%{name}" => "%{_appdir}",
62 rm -rf $RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT%{_sysconfdir}
64 #install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
66 #cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
67 cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
68 cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
69 cp -a lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
71 mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/apache.conf
72 mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/lighttpd.conf
73 cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
75 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
76 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
77 cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
79 # %webapp_* macros usage extracted from /usr/lib/rpm/macros.build:
82 # %%webapp_register HTTPD WEBAPP
83 # %%webapp_unregister HTTPD WEBAPP
85 %triggerin -- apache1 < 1.3.37-3, apache1-base
86 %webapp_register apache %{_webapp}
88 %triggerun -- apache1 < 1.3.37-3, apache1-base
89 %webapp_unregister apache %{_webapp}
91 %triggerin -- apache < 2.2.0, apache-base
92 %webapp_register httpd %{_webapp}
94 %triggerun -- apache < 2.2.0, apache-base
95 %webapp_unregister httpd %{_webapp}
97 %triggerin -- lighttpd
98 %webapp_register lighttpd %{_webapp}
100 %triggerun -- lighttpd
101 %webapp_unregister lighttpd %{_webapp}
104 rm -rf $RPM_BUILD_ROOT
107 %defattr(644,root,root,755)
108 %dir %attr(750,root,http) %{_sysconfdir}
109 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
110 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
111 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
112 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php