]>
Commit | Line | Data |
---|---|---|
4391dd54 | 1 | Summary: JavaScript display engine for mathematics |
4391dd54 | 2 | Name: MathJax |
14b438af | 3 | Version: 1.1a |
48fc5bfb | 4 | Release: 3 |
4391dd54 JR |
5 | License: Apache v2.0 |
6 | Group: Applications/WWW | |
14b438af JR |
7 | # https://github.com/mathjax/MathJax/zipball/v1.1a |
8 | Source0: %{name}-%{version}.zip | |
9 | # Source0-md5: 63a0401cbf84bbeb173072d77c127299 | |
4391dd54 JR |
10 | URL: http://www.mathjax.org/ |
11 | BuildRequires: rpmbuild(macros) >= 1.268 | |
d38386b9 | 12 | BuildRequires: unzip |
4391dd54 JR |
13 | Requires: webapps |
14 | Requires: webserver(access) | |
15 | Requires: webserver(alias) | |
48fc5bfb | 16 | Conflicts: apache-base < 2.4.0-1 |
4391dd54 JR |
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 | |
d38386b9 | 27 | that works in all modern browsers. |
4391dd54 | 28 | |
4391dd54 | 29 | %prep |
14b438af | 30 | %setup -q -n mathjax-MathJax-f5cd294 |
4391dd54 JR |
31 | |
32 | cat > apache.conf <<'EOF' | |
33 | Alias /%{name} %{_appdir} | |
34 | <Directory %{_appdir}> | |
35 | Allow from all | |
36 | </Directory> | |
37 | EOF | |
38 | ||
ec08939d JR |
39 | cat > httpd.conf <<'EOF' |
40 | Alias /%{name} %{_appdir} | |
41 | <Directory %{_appdir}> | |
42 | Require all granted | |
43 | </Directory> | |
44 | EOF | |
45 | ||
4391dd54 JR |
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 | ||
ec08939d | 68 | %triggerin -- apache-base |
4391dd54 JR |
69 | %webapp_register httpd %{_webapp} |
70 | ||
ec08939d | 71 | %triggerun -- apache-base |
4391dd54 JR |
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) | |
14b438af | 85 | %doc README.* docs test unpacked |
4391dd54 JR |
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} |