2 # - system packages for:
3 # - codemirror (htdocs/themes/default/js/codemirror)
6 # - fonts (static/fonts)
8 # - phpqrcode (stikked/application/libraries)
10 %define php_min_version 5.2.4
11 Summary: Stikked is an Open-Source PHP Pastebin
16 Group: Applications/WWW
17 Source0: https://github.com/claudehohl/Stikked/archive/%{version}/%{name}-%{version}.tar.gz
18 # Source0-md5: 60501ac5bf778144304a794118688ae9
20 Source2: lighttpd.conf
22 Patch1: system-geshi.patch
23 Patch2: system-phpqrcode.patch
24 URL: https://github.com/claudehohl/Stikked
25 BuildRequires: rpmbuild(macros) >= 1.553
26 Requires: php(core) >= %{php_min_version}
30 Requires: php-geshi >= 1.0.8.11
32 Requires: webserver(access)
33 Requires: webserver(alias)
34 Requires: webserver(indexfile)
35 Requires: webserver(php)
37 Suggests: php-phpqrcode
38 Suggests: webserver(expires)
39 Suggests: webserver(rewrite)
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 %define _webapps /etc/webapps
44 %define _webapp %{name}
45 %define _sysconfdir %{_webapps}/%{_webapp}
46 %define _appdir %{_datadir}/%{_webapp}
49 Stikked is an Open-Source PHP Pastebin, with the aim of keeping a
50 simple and easy to use user interface.
53 %setup -q -n Stikked-%{version}
56 # access restricted by webserver config
57 rm htdocs/application/config/index.html
58 rm htdocs/application/cache/index.html
59 rm htdocs/application/controllers/index.html
60 rm htdocs/application/core/index.html
61 rm htdocs/application/errors/index.html
62 rm htdocs/application/helpers/index.html
63 rm htdocs/application/hooks/index.html
64 rm htdocs/application/index.html
65 rm htdocs/application/libraries/index.html
66 rm htdocs/application/logs/index.html
67 rm htdocs/application/models/index.html
68 rm htdocs/application/third_party/index.html
69 rm htdocs/application/.htaccess
70 rm htdocs/application/cache/.htaccess
71 rm htdocs/system/.htaccess
73 # this is to simplify install
74 mv htdocs/application/config .
75 mv config/stikked.php{.dist,}
78 rm -r htdocs/application/libraries/geshi
79 rm -r htdocs/application/libraries/phpqrcode
86 rm -rf $RPM_BUILD_ROOT
87 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
89 cp -a htdocs/* $RPM_BUILD_ROOT%{_appdir}
90 cp -a config/* $RPM_BUILD_ROOT%{_sysconfdir}
91 ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/application/config
93 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
94 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
95 cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
98 rm -rf $RPM_BUILD_ROOT
100 %triggerin -- apache1 < 1.3.37-3, apache1-base
101 %webapp_register apache %{_webapp}
103 %triggerun -- apache1 < 1.3.37-3, apache1-base
104 %webapp_unregister apache %{_webapp}
106 %triggerin -- apache < 2.2.0, apache-base
107 %webapp_register httpd %{_webapp}
109 %triggerun -- apache < 2.2.0, apache-base
110 %webapp_unregister httpd %{_webapp}
112 %triggerin -- lighttpd
113 %webapp_register lighttpd %{_webapp}
115 %triggerun -- lighttpd
116 %webapp_unregister lighttpd %{_webapp}
119 %defattr(644,root,root,755)
120 %doc README.md AUTHORS.md CC0 doc
121 %dir %attr(750,root,http) %{_sysconfdir}
122 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
123 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
124 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
125 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
127 %{_appdir}/favicon.ico
132 %dir %{_appdir}/application
133 %{_appdir}/application/cache
134 %{_appdir}/application/controllers
135 %{_appdir}/application/core
136 %{_appdir}/application/errors
137 %{_appdir}/application/helpers
138 %{_appdir}/application/hooks
139 %{_appdir}/application/libraries
140 %{_appdir}/application/logs
141 %{_appdir}/application/models
142 %{_appdir}/application/third_party
143 %{_appdir}/application/config
145 %dir %{_appdir}/application/language
146 %{_appdir}/application/language/english
147 %lang(de) %{_appdir}/application/language/german
148 %lang(es) %{_appdir}/application/language/spanish
149 %lang(fr) %{_appdir}/application/language/french
150 # no iso639-1 code for swissgerman use iso639-2 code for now
151 %lang(gsw) %{_appdir}/application/language/swissgerman
152 %lang(ja) %{_appdir}/application/language/japanese
153 %lang(nb) %{_appdir}/application/language/norwegian
154 %lang(pt) %{_appdir}/application/language/portuguese
155 %lang(ru) %{_appdir}/application/language/russian
156 %lang(tr) %{_appdir}/application/language/turkish
157 %lang(zh_CN) %{_appdir}/application/language/chinese-traditional
158 %lang(zh_TW) %{_appdir}/application/language/chinese-simplified