]>
Commit | Line | Data |
---|---|---|
6f4261a0 ER |
1 | %define pkgname hammer |
2 | Summary: A javascript library for multi-touch gestures | |
3 | Name: js-%{pkgname} | |
4 | Version: 2.0.4 | |
5 | Release: 1 | |
6 | License: MIT | |
7 | Group: Applications/WWW | |
8 | Source0: https://github.com/hammerjs/hammer.js/archive/%{version}/%{pkgname}-%{version}.tar.gz | |
9 | # Source0-md5: 54b592fde78983cee95983bec1673a39 | |
10 | Source1: apache.conf | |
11 | Source2: lighttpd.conf | |
12 | URL: http://hammerjs.github.io/ | |
13 | BuildRequires: rpmbuild(macros) >= 1.553 | |
14 | BuildRequires: sed >= 4.0 | |
15 | Requires: webserver(access) | |
16 | Requires: webserver(alias) | |
17 | BuildArch: noarch | |
18 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
19 | ||
20 | %define _webapps /etc/webapps | |
21 | %define _webapp %{name} | |
22 | %define _sysconfdir %{_webapps}/%{_webapp} | |
23 | %define _appdir %{_datadir}/%{_webapp} | |
24 | ||
25 | %description | |
26 | Add touch gestures to your page. | |
27 | ||
28 | %prep | |
29 | %setup -qn hammer.js-%{version} | |
30 | ||
e99b9ec2 ER |
31 | %{__sed} -i -e '/# sourceMappingURL=/d' %{pkgname}.min.js |
32 | ||
6f4261a0 ER |
33 | %install |
34 | rm -rf $RPM_BUILD_ROOT | |
35 | install -d $RPM_BUILD_ROOT%{_appdir} | |
36 | cp -a %{pkgname}.js $RPM_BUILD_ROOT%{_appdir}/%{pkgname}.src.js | |
37 | cp -a %{pkgname}.min.js $RPM_BUILD_ROOT%{_appdir}/%{pkgname}.min.js | |
38 | ln -s %{pkgname}.min.js $RPM_BUILD_ROOT%{_appdir}/%{pkgname}.js | |
39 | ||
40 | install -d $RPM_BUILD_ROOT%{_sysconfdir} | |
41 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf | |
42 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
43 | cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf | |
44 | ||
45 | %clean | |
46 | rm -rf $RPM_BUILD_ROOT | |
47 | ||
48 | %triggerin -- apache1 < 1.3.37-3, apache1-base | |
49 | %webapp_register apache %{_webapp} | |
50 | ||
51 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
52 | %webapp_unregister apache %{_webapp} | |
53 | ||
54 | %triggerin -- apache < 2.2.0, apache-base | |
55 | %webapp_register httpd %{_webapp} | |
56 | ||
57 | %triggerun -- apache < 2.2.0, apache-base | |
58 | %webapp_unregister httpd %{_webapp} | |
59 | ||
60 | %triggerin -- lighttpd | |
61 | %webapp_register lighttpd %{_webapp} | |
62 | ||
63 | %triggerun -- lighttpd | |
64 | %webapp_unregister lighttpd %{_webapp} | |
65 | ||
66 | %files | |
67 | %defattr(644,root,root,755) | |
68 | %doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE.md | |
69 | %dir %attr(750,root,http) %{_sysconfdir} | |
70 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
71 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
72 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
73 | %{_appdir} |