]> git.pld-linux.org Git - SPECS.git/blob - pykota.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / pykota.spec
1 # NOTE:
2 #       - only apache is supported (feel free to add support for other httpds)
3 #       - CGI scripts must be run with uid/gid pykota/pykota privs
4 #       - that's why they're placed in /home/services/httpd/cgi-bin (suexec req)
5 #
6 # Conditional build:
7 %bcond_without  doc     # don't build HTML/PDF documentation
8
9 Summary:        Print Quota and Accounting Software Solution
10 Summary(pl.UTF-8):      Narzędzie do limitowania i rozliczania wydruków
11 Name:           pykota
12 Version:        1.26
13 Release:        12
14 License:        GPL v2
15 Group:          Applications/Printing
16 # NOTE: from svn:
17 # svn co svn://svn.librelogiciel.com/pykota/tags/1.26/
18 Source0:        %{name}-%{version}.tar.bz2
19 # Source0-md5:  6e4b3232420592695388cbb27511e668
20 Source1:        %{name}-apache.conf
21 Source2:        %{name}-httpd.conf
22 Patch0:         %{name}-conf.patch
23 Patch1:         %{name}-css.patch
24 URL:            http://www.pykota.com/
25 %if %{with doc}
26 BuildRequires:  docbook-dtd41-sgml
27 BuildRequires:  docbook-utils
28 BuildRequires:  texlive-fonts-jknappen
29 BuildRequires:  texlive-fonts-marvosym
30 BuildRequires:  texlive-fonts-other
31 BuildRequires:  texlive-fonts-stmaryrd
32 BuildRequires:  texlive-fonts-type1-urw
33 BuildRequires:  texlive-latex-cyrillic
34 BuildRequires:  texlive-latex-marvosym
35 BuildRequires:  texlive-xmltex
36 %endif
37 BuildRequires:  sqlite3
38 Requires:       %{name}-common = %{version}-%{release}
39 Requires:       %{name}-storage = %{version}-%{release}
40 Requires:       cups >= 1:1.2.0
41 Requires:       ghostscript
42 Requires:       python-PIL
43 Requires:       python-PyPAM
44 Requires:       python-ReportLab
45 Requires:       python-chardet
46 Requires:       python-jaxml
47 Requires:       python-mx-DateTime >= 2.0.3
48 Requires:       python-pkipplib
49 Requires:       python-pkpgcounter
50 Requires:       python-pyosd
51 Requires:       python-pysnmp >= 3.4.2
52 Suggests:       net-snmp-utils >= 4.2.5
53 Suggests:       netatalk
54 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
56 %define         cups_serverbin  %{_prefix}/lib/cups
57 %define         schemadir       /usr/share/openldap/schema
58 %define         httpdir         /home/services/httpd
59 %define         _webapps        /etc/webapps
60 %define         _webapp         %{name}
61
62 %description
63 Print Quota and Accounting Software Solution.
64
65 %description -l pl.UTF-8
66 Narzędzie do limitowania i rozliczania wydruków.
67
68 %package common
69 Summary:        Common files for pykota
70 Summary(pl.UTF-8):      Wspólne pliki dla pytkoty
71 Group:          Applications/Printing
72 Provides:       group(pykota)
73 Provides:       user(pykota)
74
75 %description common
76 Common files for pykota.
77
78 %description common -l pl.UTF-8
79 Wspólne pliki dla pytkoty.
80
81 %package cgi
82 Summary:        CGI interface for pykota
83 Summary(pl.UTF-8):      Interfejs CGI dla pytkoty
84 Group:          Applications/Printing
85 Requires:       %{name} = %{version}-%{release}
86 Requires:       webapps
87 Requires:       webserver
88 Requires:       webserver(access)
89 Requires:       webserver(cgi)
90 Conflicts:      apache-base < 2.4.0-1
91
92 %description cgi
93 CGI interface for pykota.
94
95 %description cgi -l pl.UTF-8
96 Interfejs CGI dla pykoty.
97
98 %package storage-ldap
99 Summary:        LDAP storage backend for pykota
100 Summary(pl.UTF-8):      Backend przechowywania danych w LDAP dla pykoty
101 Group:          Applications/Printing
102 Requires:       %{name}-common = %{version}-%{release}
103 Requires:       python-ldap
104 Provides:       %{name}-storage = %{version}-%{release}
105
106 %description storage-ldap
107 LDAP storage backend for pykota.
108
109 %description storage-ldap -l pl.UTF-8
110 Backend przechowywania danych w LDAP dla pykoty.
111
112 %package storage-mysql
113 Summary:        MySQL storage backend for pykota
114 Summary(pl.UTF-8):      Backend przechowywania danych w MySQL dla pykoty
115 Group:          Applications/Printing
116 Requires:       %{name}-common = %{version}-%{release}
117 Requires:       python-MySQLdb >= 1.2
118 Provides:       %{name}-storage = %{version}-%{release}
119
120 %description storage-mysql
121 MySQL storage backend for pykota.
122
123 %description storage-mysql -l pl.UTF-8
124 Backend przechowywania danych w MySQL dla pykoty.
125
126 %package storage-postgres
127 Summary:        PostgreSQL storage backend for pykota
128 Summary(pl.UTF-8):      Backend przechowywania danych w PostgreSQL dla pykoty
129 Group:          Applications/Printing
130 Requires:       %{name}-common = %{version}-%{release}
131 Requires:       python-PyGreSQL
132 Provides:       %{name}-storage = %{version}-%{release}
133
134 %description storage-postgres
135 PostgreSQL storage backend for pykota.
136
137 %description storage-postgres -l pl.UTF-8
138 Backend przechowywania danych w PostgreSQL dla pykoty.
139
140 %package storage-sqlite
141 Summary:        SQLite storage backend for pykota
142 Summary(pl.UTF-8):      Backend przechowywania danych w SQLite dla pykoty
143 Group:          Applications/Printing
144 Requires:       %{name}-common = %{version}-%{release}
145 Requires:       python-sqlite >= 2.0.5
146 Provides:       %{name}-storage = %{version}-%{release}
147
148 %description storage-sqlite
149 SQLite storage backend for pykota.
150
151 %description storage-sqlite -l pl.UTF-8
152 Backend przechowywania danych w SQLite dla pykoty.
153
154 %package -n openldap-schema-pykota
155 Summary:        pykota LDAP chema
156 Summary(pl.UTF-8):      Schemat LDAP dla pykoty
157 Group:          Networking/Daemons
158 Requires(post,postun):  sed >= 4.0
159 Requires:       openldap-servers
160 BuildArch:      noarch
161
162 %description -n openldap-schema-pykota
163 This package contains pykota.schema for openldap.
164
165 %description -n openldap-schema-pykota -l pl.UTF-8
166 Ten pakiet zawiera schemat pykoty dla openldapa.
167
168 %prep
169 %setup -q
170 %patch0 -p1
171 %patch1 -p1
172
173 mv po/{el_GR,el}
174 mv po/{nb_NO,nb}
175 mv po/{sv_SE,sv}
176
177 mv man/{el_GR,el}
178 mv man/{nb_NO,nb}
179 mv man/{sv_SE,sv}
180
181 find -name .svn | xargs rm -rf
182
183 %build
184 %py_build
185
186 %if %{with doc}
187 cd docs
188 mkdir html
189 docbook2html -o html pykota.sgml
190 docbook2pdf pykota.sgml
191 %endif
192
193 %install
194 rm -rf $RPM_BUILD_ROOT
195 install -d $RPM_BUILD_ROOT{%{schemadir},%{_sysconfdir}/%{name}} \
196         $RPM_BUILD_ROOT%{cups_serverbin}/backend \
197         $RPM_BUILD_ROOT/var/lib/%{name} \
198         $RPM_BUILD_ROOT%{httpdir}/cgi-bin/%{name} \
199         $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
200
201 %py_install
202
203 install -p cgi-bin/*.cgi $RPM_BUILD_ROOT%{httpdir}/cgi-bin/%{name}
204 install -p stylesheets/pykota.css $RPM_BUILD_ROOT%{httpdir}/cgi-bin/%{name}
205
206 cp -p initscripts/ldap/pykota.schema $RPM_BUILD_ROOT%{schemadir}
207
208 cp -p conf/pykota.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pykota.conf
209 cp -p conf/pykotadmin.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pykotadmin.conf
210
211 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
212 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
213
214 ln -s %{_datadir}/%{name}/cupspykota $RPM_BUILD_ROOT%{cups_serverbin}/backend/cupspykota
215
216 sqlite3 $RPM_BUILD_ROOT/var/lib/%{name}/pykota.db <initscripts/sqlite/pykota-sqlite.sql
217
218 rm -rf $RPM_BUILD_ROOT%{_datadir}/{doc/%{name},%{name}/{conf,ldap,mysql,postgresql,sqlite,stylesheets}}
219
220 %find_lang %{name}
221
222 %clean
223 rm -rf $RPM_BUILD_ROOT
224
225 %pre common
226 %groupadd -r -g 501 pykota
227 %useradd -r -u 501 -d /etc/%{name} -s /bin/sh -c "PyKota User" -g pykota pykota
228
229 %postun common
230 if [ "$1" = "0" ]; then
231         %userremove %{name}
232         %groupremove %{name}
233 fi
234
235 %triggerin cgi -- apache1 < 1.3.37-3, apache1-base
236 %webapp_register apache %{_webapp}
237
238 %triggerun cgi -- apache1 < 1.3.37-3, apache1-base
239 %webapp_unregister apache %{_webapp}
240
241 %triggerin cgi -- apache-base
242 %webapp_register httpd %{_webapp}
243
244 %triggerun cgi -- apache-base
245 %webapp_unregister httpd %{_webapp}
246
247 %post -n openldap-schema-pykota
248 # dependant schemas: cosine(uid) inetorgperson(displayName) nis(gidNumber)
249 %openldap_schema_register %{schemadir}/pykota.schema -d cosine,inetorgperson,nis
250 %service -q ldap restart
251
252 %postun -n openldap-schema-pykota
253 if [ "$1" = "0" ]; then
254         %openldap_schema_unregister %{schemadir}/pykota.schema
255         %service -q ldap restart
256 fi
257
258 %files -f %{name}.lang
259 %defattr(644,root,root,755)
260 %doc CREDITS FAQ LICENSE README SECURITY TODO
261 %doc openoffice qa-assistant docs/*.sxi
262 %{?with_doc:%doc docs/*.pdf docs/html}
263 %attr(750,lp,pykota) %dir %{_sysconfdir}/%{name}
264 %attr(640,lp,pykota) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/pykota.conf
265 %attr(640,lp,pykota) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/pykotadmin.conf
266 %attr(755,root,root) %{_bindir}/*
267 %{py_sitescriptdir}/%{name}/*.py*
268 %{py_sitescriptdir}/%{name}/storages/__init__.py*
269 %{py_sitescriptdir}/%{name}/storages/sql.py*
270 %dir %{py_sitescriptdir}/%{name}/reporters
271 %{py_sitescriptdir}/%{name}/reporters/*.py*
272 %dir %{py_sitescriptdir}/%{name}/loggers
273 %{py_sitescriptdir}/%{name}/loggers/*.py*
274 %dir %{py_sitescriptdir}/%{name}/accounters
275 %{py_sitescriptdir}/%{name}/accounters/*.py*
276 %{py_sitescriptdir}/*.egg-info
277 %dir %{_datadir}/%{name}
278 %attr(755,root,root) %{_datadir}/%{name}/*.sh
279 %attr(755,root,root) %{_datadir}/%{name}/*.py
280 %attr(755,root,root) %{_datadir}/%{name}/cupspykota
281 %{_datadir}/%{name}/*.pjl
282 %{_datadir}/%{name}/*.ps
283 %{_datadir}/%{name}/logos
284
285 %attr(755,root,root) %{cups_serverbin}/backend/cupspykota
286
287 %{_mandir}/man?/*
288 # commented out fake placeholders
289 #%lang(de) %{_mandir}/de/man?/*
290 #%lang(el) %{_mandir}/el/man?/*
291 #%lang(es) %{_mandir}/es/man?/*
292 %lang(fr) %{_mandir}/fr/man?/*
293 #%lang(it) %{_mandir}/it/man?/*
294 #%lang(nb) %{_mandir}/nb/man?/*
295 #%lang(pl) %{_mandir}/pl/man?/*
296 #%lang(pt) %{_mandir}/pt/man?/*
297 #%lang(pt_BR) %{_mandir}/pt_BR/man?/*
298 #%lang(sv) %{_mandir}/sv/man?/*
299 #%lang(th) %{_mandir}/th/man?/*
300 #%lang(tr) %{_mandir}/tr/man?/*
301 #%lang(zh_TW) %{_mandir}/zh_TW/man?/*
302
303 %files cgi
304 %defattr(644,root,root,755)
305 %doc cgi-bin/README
306 %dir %{_webapps}/%{_webapp}
307 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
308 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
309 %attr(755,pykota,pykota) %dir %{httpdir}/cgi-bin/%{name}
310 %attr(755,pykota,pykota) %{httpdir}/cgi-bin/%{name}/*.cgi
311 %{httpdir}/cgi-bin/%{name}/*.css
312
313 %files common
314 %defattr(644,root,root,755)
315 %dir %{py_sitescriptdir}/%{name}
316 %dir %{py_sitescriptdir}/%{name}/storages
317
318 %files storage-ldap
319 %defattr(644,root,root,755)
320 %{py_sitescriptdir}/%{name}/storages/ldap*.py*
321
322 %files storage-mysql
323 %defattr(644,root,root,755)
324 %doc initscripts/mysql/*
325 %{py_sitescriptdir}/%{name}/storages/mysql*.py*
326
327 %files storage-postgres
328 %defattr(644,root,root,755)
329 %doc initscripts/postgresql/*
330 %{py_sitescriptdir}/%{name}/storages/pg*.py*
331
332 %files storage-sqlite
333 %defattr(644,root,root,755)
334 %doc initscripts/sqlite/*
335 %{py_sitescriptdir}/%{name}/storages/sqlite*.py*
336 %attr(750,lp,pykota) %dir /var/lib/%{name}
337 %attr(660,lp,pykota) %config(noreplace) %verify(not md5 mtime size) /var/lib/%{name}/pykota.db
338
339 %files -n openldap-schema-pykota
340 %defattr(644,root,root,755)
341 %doc initscripts/ldap/{README.ldap,pykota-sample.ldif}
342 %{schemadir}/pykota.schema
This page took 0.720224 seconds and 3 git commands to generate.