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)
7 %bcond_without doc # don't build HTML/PDF documentation
9 Summary: Print Quota and Accounting Software Solution
10 Summary(pl.UTF-8): Narzędzie do limitowania i rozliczania wydruków
15 Group: Applications/Printing
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/
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
37 BuildRequires: sqlite3
38 Requires: %{name}-common = %{version}-%{release}
39 Requires: %{name}-storage = %{version}-%{release}
40 Requires: cups >= 1:1.2.0
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
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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}
63 Print Quota and Accounting Software Solution.
65 %description -l pl.UTF-8
66 Narzędzie do limitowania i rozliczania wydruków.
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)
76 Common files for pykota.
78 %description common -l pl.UTF-8
79 Wspólne pliki dla pytkoty.
82 Summary: CGI interface for pykota
83 Summary(pl.UTF-8): Interfejs CGI dla pytkoty
84 Group: Applications/Printing
85 Requires: %{name} = %{version}-%{release}
88 Requires: webserver(access)
89 Requires: webserver(cgi)
90 Conflicts: apache-base < 2.4.0-1
93 CGI interface for pykota.
95 %description cgi -l pl.UTF-8
96 Interfejs CGI dla pykoty.
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}
106 %description storage-ldap
107 LDAP storage backend for pykota.
109 %description storage-ldap -l pl.UTF-8
110 Backend przechowywania danych w LDAP dla pykoty.
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}
120 %description storage-mysql
121 MySQL storage backend for pykota.
123 %description storage-mysql -l pl.UTF-8
124 Backend przechowywania danych w MySQL dla pykoty.
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}
134 %description storage-postgres
135 PostgreSQL storage backend for pykota.
137 %description storage-postgres -l pl.UTF-8
138 Backend przechowywania danych w PostgreSQL dla pykoty.
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}
148 %description storage-sqlite
149 SQLite storage backend for pykota.
151 %description storage-sqlite -l pl.UTF-8
152 Backend przechowywania danych w SQLite dla pykoty.
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
162 %description -n openldap-schema-pykota
163 This package contains pykota.schema for openldap.
165 %description -n openldap-schema-pykota -l pl.UTF-8
166 Ten pakiet zawiera schemat pykoty dla openldapa.
181 find -name .svn | xargs rm -rf
189 docbook2html -o html pykota.sgml
190 docbook2pdf pykota.sgml
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}
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}
206 cp -p initscripts/ldap/pykota.schema $RPM_BUILD_ROOT%{schemadir}
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
211 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
212 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
214 ln -s %{_datadir}/%{name}/cupspykota $RPM_BUILD_ROOT%{cups_serverbin}/backend/cupspykota
216 sqlite3 $RPM_BUILD_ROOT/var/lib/%{name}/pykota.db <initscripts/sqlite/pykota-sqlite.sql
218 rm -rf $RPM_BUILD_ROOT%{_datadir}/{doc/%{name},%{name}/{conf,ldap,mysql,postgresql,sqlite,stylesheets}}
223 rm -rf $RPM_BUILD_ROOT
226 %groupadd -r -g 501 pykota
227 %useradd -r -u 501 -d /etc/%{name} -s /bin/sh -c "PyKota User" -g pykota pykota
230 if [ "$1" = "0" ]; then
235 %triggerin cgi -- apache1 < 1.3.37-3, apache1-base
236 %webapp_register apache %{_webapp}
238 %triggerun cgi -- apache1 < 1.3.37-3, apache1-base
239 %webapp_unregister apache %{_webapp}
241 %triggerin cgi -- apache-base
242 %webapp_register httpd %{_webapp}
244 %triggerun cgi -- apache-base
245 %webapp_unregister httpd %{_webapp}
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
252 %postun -n openldap-schema-pykota
253 if [ "$1" = "0" ]; then
254 %openldap_schema_unregister %{schemadir}/pykota.schema
255 %service -q ldap restart
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
285 %attr(755,root,root) %{cups_serverbin}/backend/cupspykota
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?/*
304 %defattr(644,root,root,755)
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
314 %defattr(644,root,root,755)
315 %dir %{py_sitescriptdir}/%{name}
316 %dir %{py_sitescriptdir}/%{name}/storages
319 %defattr(644,root,root,755)
320 %{py_sitescriptdir}/%{name}/storages/ldap*.py*
323 %defattr(644,root,root,755)
324 %doc initscripts/mysql/*
325 %{py_sitescriptdir}/%{name}/storages/mysql*.py*
327 %files storage-postgres
328 %defattr(644,root,root,755)
329 %doc initscripts/postgresql/*
330 %{py_sitescriptdir}/%{name}/storages/pg*.py*
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
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