]> git.pld-linux.org Git - packages/stikked.git/blob - stikked.spec
use system phpqrcode
[packages/stikked.git] / stikked.spec
1 # TODO
2 # - system packages for:
3 #  - codemirror (htdocs/themes/default/js/codemirror)
4 #  - crypto-js
5 #  - lz-string
6 # - fonts (static/fonts)
7 # - qrcode
8 # - phpqrcode (stikked/application/libraries)
9
10 %define         php_min_version 5.2.4
11 Summary:        Stikked is an Open-Source PHP Pastebin
12 Name:           stikked
13 Version:        0.9.0
14 Release:        0.2
15 License:        CC0
16 Group:          Applications/WWW
17 Source0:        https://github.com/claudehohl/Stikked/archive/%{version}/%{name}-%{version}.tar.gz
18 # Source0-md5:  60501ac5bf778144304a794118688ae9
19 Source1:        apache.conf
20 Source2:        lighttpd.conf
21 Patch0:         config.patch
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}
27 Requires:       php(mysql)
28 Requires:       php(pcre)
29 Requires:       php(xml)
30 Requires:       php-geshi >= 1.0.8.11
31 Requires:       webapps
32 Requires:       webserver(access)
33 Requires:       webserver(alias)
34 Requires:       webserver(indexfile)
35 Requires:       webserver(php)
36 Suggests:       php(gd)
37 Suggests:       php-phpqrcode
38 Suggests:       webserver(expires)
39 Suggests:       webserver(rewrite)
40 BuildArch:      noarch
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %define         _webapps        /etc/webapps
44 %define         _webapp         %{name}
45 %define         _sysconfdir     %{_webapps}/%{_webapp}
46 %define         _appdir         %{_datadir}/%{_webapp}
47
48 %description
49 Stikked is an Open-Source PHP Pastebin, with the aim of keeping a
50 simple and easy to use user interface.
51
52 %prep
53 %setup -q -n Stikked-%{version}
54 %undos -f php
55
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
72
73 # this is to simplify install
74 mv htdocs/application/config .
75 mv config/stikked.php{.dist,}
76
77 # use system packages
78 rm -r htdocs/application/libraries/geshi
79 rm -r htdocs/application/libraries/phpqrcode
80
81 %patch0 -p1
82 %patch1 -p1
83 %patch2 -p1
84
85 %install
86 rm -rf $RPM_BUILD_ROOT
87 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
88
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
92
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
96
97 %clean
98 rm -rf $RPM_BUILD_ROOT
99
100 %triggerin -- apache1 < 1.3.37-3, apache1-base
101 %webapp_register apache %{_webapp}
102
103 %triggerun -- apache1 < 1.3.37-3, apache1-base
104 %webapp_unregister apache %{_webapp}
105
106 %triggerin -- apache < 2.2.0, apache-base
107 %webapp_register httpd %{_webapp}
108
109 %triggerun -- apache < 2.2.0, apache-base
110 %webapp_unregister httpd %{_webapp}
111
112 %triggerin -- lighttpd
113 %webapp_register lighttpd %{_webapp}
114
115 %triggerun -- lighttpd
116 %webapp_unregister lighttpd %{_webapp}
117
118 %files
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
126 %dir %{_appdir}
127 %{_appdir}/favicon.ico
128 %{_appdir}/index.php
129 %{_appdir}/static
130 %{_appdir}/system
131 %{_appdir}/themes
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
144
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
This page took 0.293967 seconds and 3 git commands to generate.