]>
Commit | Line | Data |
---|---|---|
1 | Summary: JavaScript display engine for mathematics | |
2 | Name: MathJax | |
3 | Version: 1.1a | |
4 | Release: 3 | |
5 | License: Apache v2.0 | |
6 | Group: Applications/WWW | |
7 | # https://github.com/mathjax/MathJax/zipball/v1.1a | |
8 | Source0: %{name}-%{version}.zip | |
9 | # Source0-md5: 63a0401cbf84bbeb173072d77c127299 | |
10 | URL: http://www.mathjax.org/ | |
11 | BuildRequires: rpmbuild(macros) >= 1.268 | |
12 | BuildRequires: unzip | |
13 | Requires: webapps | |
14 | Requires: webserver(access) | |
15 | Requires: webserver(alias) | |
16 | Conflicts: apache-base < 2.4.0-1 | |
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 | MathJax is an open source JavaScript display engine for mathematics | |
27 | that works in all modern browsers. | |
28 | ||
29 | %prep | |
30 | %setup -q -n mathjax-MathJax-f5cd294 | |
31 | ||
32 | cat > apache.conf <<'EOF' | |
33 | Alias /%{name} %{_appdir} | |
34 | <Directory %{_appdir}> | |
35 | Allow from all | |
36 | </Directory> | |
37 | EOF | |
38 | ||
39 | cat > httpd.conf <<'EOF' | |
40 | Alias /%{name} %{_appdir} | |
41 | <Directory %{_appdir}> | |
42 | Require all granted | |
43 | </Directory> | |
44 | EOF | |
45 | ||
46 | cat > lighttpd.conf <<'EOF' | |
47 | alias.url += ( | |
48 | "/%{name}" => "%{_appdir}", | |
49 | ) | |
50 | EOF | |
51 | ||
52 | %install | |
53 | rm -rf $RPM_BUILD_ROOT | |
54 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}} | |
55 | ||
56 | cp -a MathJax.js config extensions fonts jax $RPM_BUILD_ROOT%{_appdir} | |
57 | ||
58 | cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf | |
59 | cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
60 | cp -a lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
61 | ||
62 | %triggerin -- apache1 < 1.3.37-3, apache1-base | |
63 | %webapp_register apache %{_webapp} | |
64 | ||
65 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
66 | %webapp_unregister apache %{_webapp} | |
67 | ||
68 | %triggerin -- apache-base | |
69 | %webapp_register httpd %{_webapp} | |
70 | ||
71 | %triggerun -- apache-base | |
72 | %webapp_unregister httpd %{_webapp} | |
73 | ||
74 | %triggerin -- lighttpd | |
75 | %webapp_register lighttpd %{_webapp} | |
76 | ||
77 | %triggerun -- lighttpd | |
78 | %webapp_unregister lighttpd %{_webapp} | |
79 | ||
80 | %clean | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %files | |
84 | %defattr(644,root,root,755) | |
85 | %doc README.* docs test unpacked | |
86 | %dir %attr(750,root,http) %{_sysconfdir} | |
87 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
88 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
89 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
90 | %{_appdir} |