2 # - handle plugin languages
3 Summary: The text editor for Internet
4 Summary(pl.UTF-8): Edytor tekstowy dla Internetu
9 Group: Applications/WWW
10 Source0: http://download.cksource.com/CKEditor/CKEditor/CKEditor%20%{version}/%{name}_%{version}.tar.gz
11 # Source0-md5: 9c4a9e54f756e24c6aac24888c4599d0
12 URL: http://www.ckeditor.com/
14 BuildRequires: rpmbuild(macros) > 1.268
15 BuildRequires: sed >= 4.0
16 Requires: webserver(access)
17 Requires: webserver(alias)
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 %define _webapps /etc/webapps
22 %define _webapp %{name}
23 %define _sysconfdir %{_webapps}/%{_webapp}
24 %define _appdir %{_datadir}/%{name}
26 %define find_lang sh %{SOURCE1}
29 This HTML text editor brings to the web many of the powerful
30 functionalities of desktop editors like MS Word. It's lightweight and
31 doesn't require any kind of installation on the client computer.
33 %description -l pl.UTF-8
34 Ten edytor tekstu HTML udostępnia stronom WWW wiele potężnych funkcji
35 edytorów biurowych, takich jak MS Word. Jest lekki i nie wymaga żadnej
36 inicjalizacji na komputerze klienckim.
42 mv ckeditor/.htaccess config/htaccess
48 mv ckeditor_php5.php ckeditor.php
50 find -name _source | xargs rm -rf
53 rm lang/_translationstatus.txt
56 %{__sed} -i -e 's,\r$,,' ckeditor*
57 find '(' -name '*.js' -o -name '*.css' -o -name '*.txt' -o -name '*.html' -o -name '*.php' ')' -print0 | xargs -0 sed -i -e 's,\r$,,'
59 # apache1/apache2 conf
60 cat > config/apache.conf <<'EOF'
61 Alias /%{name} %{_appdir}
62 <Directory %{_appdir}>
68 cat > config/lighttpd.conf <<'EOF'
70 "/%{name}" => "%{_appdir}",
75 rm -rf $RPM_BUILD_ROOT
76 install -d $RPM_BUILD_ROOT%{_appdir}
78 cp -a ckeditor.js $RPM_BUILD_ROOT%{_appdir}
79 cp -a plugins skins themes lang $RPM_BUILD_ROOT%{_appdir}
81 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
82 cp -a samples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
84 install -d $RPM_BUILD_ROOT%{_sysconfdir}
85 cp -a config/apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
86 cp -a config/apache.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
87 cp -a config/lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
89 %find_lang %{name}.lang
91 %triggerin -- apache1 < 1.3.37-3, apache1-base
92 %webapp_register apache %{_webapp}
94 %triggerun -- apache1 < 1.3.37-3, apache1-base
95 %webapp_unregister apache %{_webapp}
97 %triggerin -- apache < 2.2.0, apache-base
98 %webapp_register httpd %{_webapp}
100 %triggerun -- apache < 2.2.0, apache-base
101 %webapp_unregister httpd %{_webapp}
103 %triggerin -- lighttpd
104 %webapp_register lighttpd %{_webapp}
106 %triggerun -- lighttpd
107 %webapp_unregister lighttpd %{_webapp}
110 rm -rf $RPM_BUILD_ROOT
112 %files -f %{name}.lang
113 %defattr(644,root,root,755)
114 %dir %attr(750,root,http) %{_sysconfdir}
115 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
116 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
117 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
123 %{_appdir}/lang/_languages.js
125 %{_examplesdir}/%{name}-%{version}