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