]> git.pld-linux.org Git - projects/template-specs.git/blame_incremental - webapp.spec
dokuwiki: add LICENSE README rm example
[projects/template-specs.git] / webapp.spec
... / ...
CommitLineData
1Summary: Package that uses webapps configuration
2Summary(pl.UTF-8): Pakiet używający konfiguracji aplikacji WWW
3Name: template-webapp
4Version: 0.3
5Release: 0.3
6License: GPL
7Group: Applications/WWW
8#Source0: %{name}-%{version}.tar.gz
9# Source0-md5: -
10#Source1: apache.conf
11#Source2: lighttpd.conf
12#URL: -
13BuildRequires: rpmbuild(macros) >= 1.268
14Requires: webapps
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)
25BuildArch: noarch
26BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28%define _webapps /etc/webapps
29%define _webapp %{name}
30%define _sysconfdir %{_webapps}/%{_webapp}
31#%define _appdir %{_datadir}/%{_webapp}
32
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
36%description
37This .spec is for demonstrating triggers used for linking webapp
38configuration to webserver config dir.
39
40%description -l pl.UTF-8
41Ten plik .spec służy do pokazania triggerów służących do podłączania
42konfiguracji aplikacji WWW do katalogu konfiguracyjnego serwera WWW.
43
44%prep
45%setup -q
46
47cat > apache.conf <<'EOF'
48Alias /%{name} %{_appdir}
49<Directory %{_appdir}>
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>
59</Directory>
60EOF
61
62cat > lighttpd.conf <<'EOF'
63alias.url += (
64 "/%{name}" => "%{_appdir}",
65)
66EOF
67
68%install
69rm -rf $RPM_BUILD_ROOT
70install -d $RPM_BUILD_ROOT%{_sysconfdir}
71install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
72
73cp -a . $RPM_BUILD_ROOT%{_appdir}
74
75cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
76cp -p apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
77cp -p lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
78
79mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/apache.conf
80mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/lighttpd.conf
81cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
82
83cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
84cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
85cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
86
87%clean
88rm -rf $RPM_BUILD_ROOT
89
90# %webapp_* macros usage extracted from /usr/lib/rpm/macros.build:
91#
92# Usage:
93# %%webapp_register HTTPD WEBAPP
94# %%webapp_unregister HTTPD WEBAPP
95
96%triggerin -- apache1 < 1.3.37-3, apache1-base
97%webapp_register apache %{_webapp}
98
99%triggerun -- apache1 < 1.3.37-3, apache1-base
100%webapp_unregister apache %{_webapp}
101
102%triggerin -- apache < 2.2.0, apache-base
103%webapp_register httpd %{_webapp}
104
105%triggerun -- apache < 2.2.0, apache-base
106%webapp_unregister httpd %{_webapp}
107
108%triggerin -- lighttpd
109%webapp_register lighttpd %{_webapp}
110
111%triggerun -- lighttpd
112%webapp_unregister lighttpd %{_webapp}
113
114%files
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
121%{_appdir}
This page took 0.064878 seconds and 4 git commands to generate.