1 %define ver %(echo %{version} | tr . _)
2 Summary: TinyMCE spellchecker plugin
3 Name: tinymce-spellchecker
7 Group: Applications/WWW
8 Source0: http://dl.sourceforge.net/tinymce/tinymce_spellchecker_php_%{ver}.zip
9 # Source0-md5: 71ea3f554466fed09530a89fb98e6eee
11 URL: http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker
12 BuildRequires: rpmbuild(macros) >= 1.268
13 BuildRequires: sed >= 4.0
15 Requires: tinymce >= 3.1.1-0.4
17 Requires: webserver(access)
18 Requires: webserver(alias)
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 %define _webapps /etc/webapps
23 %define _webapp %{name}
24 %define _sysconfdir %{_webapps}/%{_webapp}
25 %define _appdir %{_datadir}/%{_webapp}
26 %define _plugindir %{_datadir}/tinymce/plugins/spellchecker
29 This plugin adds spellchecker functionality to TinyMCE by providing a
30 new button that performs a AJAX call to a backend PHP page that uses
31 PSpell/ASpell or Google spellchecker.
36 find '(' -name '*.js' -o -name '*.html' -o -name '*.htm' -o -name '*.php' ')' -print0 | xargs -0 sed -i -e 's,\r$,,'
39 cat <<'EOF' > apache.conf
40 Alias /tiny_mce/plugins/spellchecker/rpc.php %{_appdir}/rpc.php
41 <Directory %{_appdir}>
46 cat > lighttpd.conf <<'EOF'
48 "/tiny_mce/plugins/spellchecker/rpc.php" => "%{_appdir}/rpc.php",
53 rm -rf $RPM_BUILD_ROOT
54 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},%{_plugindir}}
56 cp -a editor_plugin.js css img $RPM_BUILD_ROOT%{_plugindir}
57 cp -a rpc.php $RPM_BUILD_ROOT%{_appdir}
58 cp -a classes includes $RPM_BUILD_ROOT%{_appdir}
59 cp -a config.php $RPM_BUILD_ROOT%{_sysconfdir}
60 cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
61 cp -a apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
62 cp -a lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
65 rm -rf $RPM_BUILD_ROOT
67 %triggerin -- apache1 < 1.3.37-3, apache1-base
68 %webapp_register apache %{_webapp}
70 %triggerun -- apache1 < 1.3.37-3, apache1-base
71 %webapp_unregister apache %{_webapp}
73 %triggerin -- apache < 2.2.0, apache-base
74 %webapp_register httpd %{_webapp}
76 %triggerun -- apache < 2.2.0, apache-base
77 %webapp_unregister httpd %{_webapp}
79 %triggerin -- lighttpd
80 %webapp_register lighttpd %{_webapp}
82 %triggerun -- lighttpd
83 %webapp_unregister lighttpd %{_webapp}
86 %defattr(644,root,root,755)
88 %dir %attr(750,root,http) %{_sysconfdir}
89 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
90 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
91 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
92 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php