2 # - move %{_datadir}/pootle/mo/* to system localedir as pootle.mo
3 %define fullname Pootle
4 Summary: Localization and translation management web application
9 Group: Development/Tools
10 Source0: https://github.com/translate/pootle/releases/download/%{version}/Pootle-%{version}.tar.bz2
11 # Source0-md5: b1bac7ae18dc3632c471c63e72852949
13 Patch0: settings.patch
16 URL: http://pootle.translatehouse.org/
17 BuildRequires: python-modules
18 BuildRequires: rpm-pythonprov
19 BuildRequires: rpmbuild(macros) >= 1.714
20 BuildRequires: sed >= 4.0
21 BuildRequires: translate-toolkit >= 1.4.1
22 Requires: apache-mod_alias
23 Requires: apache-mod_authz_host
24 Requires: apache-mod_mime
25 Requires: apache-mod_wsgi
28 Requires: python-Levenshtein
29 Requires: python-django >= 1.0
30 Requires: python-django-south
31 Requires: python-djblets
33 Requires: translate-toolkit >= 1.8.0
36 Suggests: python(sqlite)
37 Suggests: python-memcached
38 Suggests: python-xapian
39 Conflicts: python-xapian < 1.0.13
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 %define _webapps /etc/webapps
44 %define _webapp %{name}
45 %define _sysconfdir %{_webapps}/%{_webapp}
48 Pootle is web application for managing distributed or crowdsourced
51 It's features include::
52 - Translation of Gettext PO and XLIFF files.
53 - Submitting to remote version control systems (VCS).
54 - Managing groups of translators
55 - Online webbased or offline translation
59 %setup -q -n %{fullname}-%{version}
64 #%{__sed} -i -e '1s,#!.*env python,#!%{__python},' wsgi.py
70 rm -rf $RPM_BUILD_ROOT
71 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_datadir}/pootle,%{_sharedstatedir}/pootle/po/.tmp,%{_sysconfdir}}
75 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/tests
77 # install_dirs.py was modified _after_ install completed, so compile again
79 # TODO. compile only install_dirs.py
80 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
81 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
85 install -d $RPM_BUILD_ROOT%{_mandir}/man1
86 for program in $RPM_BUILD_ROOT%{_bindir}/*; do
87 case $(basename $program) in
88 PootleServer|import_pootle_prefs)
91 LC_ALL=C PYTHONPATH=. $program --manpage \
92 > $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $program).1 \
93 || rm -f $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $program).1
99 # application language
100 for a in $RPM_BUILD_ROOT%{_datadir}/pootle/mo/[a-z]*; do
102 p=${a#$RPM_BUILD_ROOT} l=${a##*/}
103 echo "%lang($l) $p" >> %{name}.lang
106 # such recursive magic is because we need to have different permissions for
107 # directories and files and we want to language tag both of them
110 # skip bad globs (happens when we recurse)
111 [ -e "$obj" ] || continue
113 path=${obj#$RPM_BUILD_ROOT} lang=${MO_LANG:-${obj##*/}}
116 attr='%dir %attr(770,root,http)'
118 attr='%attr(660,root,http) %config(noreplace) %verify(not md5 mtime size)'
122 echo "$attr $path" >> %{name}.lang
125 echo "%lang($lang) $attr $path" >> %{name}.lang
129 MO_LANG=$lang scan_mo $obj/*
134 scan_mo $RPM_BUILD_ROOT%{_sharedstatedir}/pootle/po/{pootle,terminology,tutorial}/* >> %{name}.lang
137 # don't clobber user $PATH
138 #mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/PootleServer
139 #install -p manage.py $RPM_BUILD_ROOT%{_sbindir}/pootle-manage
140 #install -p wsgi.py $RPM_BUILD_ROOT%{_datadir}/pootle
142 install -d $RPM_BUILD_ROOT%{_sysconfdir}
143 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
146 rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
149 #rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/djblets
152 rm -rf $RPM_BUILD_ROOT
154 %triggerin -- apache < 2.2.0, apache-base
155 %webapp_register httpd %{_webapp}
157 %triggerun -- apache < 2.2.0, apache-base
158 %webapp_unregister httpd %{_webapp}
160 %files -f %{name}.lang
161 %defattr(644,root,root,755)
163 %dir %attr(750,root,http) %{_sysconfdir}
164 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
165 #%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/localsettings.py
166 %attr(755,root,root) %{_bindir}/pootle
169 %dir %{_datadir}/pootle
170 %{_datadir}/pootle/mo/README
171 %attr(755,root,root) %{_datadir}/pootle/wsgi.py
172 %{_datadir}/pootle/html
173 %{_datadir}/pootle/templates
174 %dir %{_datadir}/pootle/mo
177 %{py_sitescriptdir}/pootle
178 %{py_sitescriptdir}/Pootle-%{version}-py*.egg-info
180 %dir %{_sharedstatedir}/pootle
181 #%dir %attr(770,root,http) %{_sharedstatedir}/pootle/dbs
182 %dir %attr(770,root,http) %{_sharedstatedir}/pootle/po
183 # setup a tempdir inside the PODIRECTORY heirarchy, this way we have
184 # reasonable guarantee that temp files will be created on the same
185 # filesystem as translation files (required for save operations).
186 %dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/.tmp
188 # base translations from pootle itself
190 %dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/pootle
191 %dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/terminology
192 %dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/tutorial