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