]> git.pld-linux.org Git - packages/pootle.git/blame - pootle.spec
- use macros for build/install
[packages/pootle.git] / pootle.spec
CommitLineData
83e18d77 1# TODO
d254aee3 2# - move %{_datadir}/pootle/mo/* to system localedir as pootle.mo
83e18d77
ER
3%define fullname Pootle
4Summary: Localization and translation management web application
5Name: pootle
c9d9939e 6Version: 2.1.6
a6adb95b 7Release: 6
6a03db66 8License: GPL v2
83e18d77 9Group: Development/Tools
05a1e280 10Source0: http://downloads.sourceforge.net/translate/%{fullname}-%{version}.tar.bz2
c9d9939e 11# Source0-md5: 1dc69e42cd93f9174443af350df57491
4f752939 12Source1: apache.conf
710cf04b
ER
13Patch0: settings.patch
14Patch1: paths.patch
098c6911 15Patch2: homedir.patch
22a51b49 16Patch3: iso-codes-message.patch
6a03db66 17Patch4: bug-2005.patch
b042bedc 18URL: http://translate.sourceforge.net/wiki/pootle/index
83e18d77 19BuildRequires: python-devel
631c177e 20BuildRequires: python-modules
21BuildRequires: rpm-pythonprov
83e18d77 22BuildRequires: rpmbuild(macros) >= 1.228
d254aee3 23BuildRequires: sed >= 4.0
83e18d77 24BuildRequires: translate-toolkit >= 1.4.1
60d8d4b5
ER
25Requires: apache-mod_alias
26Requires: apache-mod_authz_host
3712e06b 27Requires: apache-mod_mime
04b20369 28Requires: apache(mod_wsgi)
83e18d77
ER
29Requires: group(http)
30Requires: iso-codes
83e18d77
ER
31Requires: python-Levenshtein
32Requires: python-django >= 1.0
264704ca 33Requires: python-django-south
83e18d77
ER
34Requires: python-djblets
35Requires: python-lxml
264704ca 36Requires: translate-toolkit >= 1.8.0
83e18d77 37Requires: zip
d254aee3 38Suggests: memcached
098c6911 39Suggests: python(sqlite)
d254aee3 40Suggests: python-memcached
710cf04b
ER
41Suggests: python-xapian
42Conflicts: python-xapian < 1.0.13
83e18d77
ER
43BuildArch: noarch
44BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46%define _webapps /etc/webapps
47%define _webapp %{name}
d254aee3 48%define _sysconfdir %{_webapps}/%{_webapp}
83e18d77
ER
49
50%description
51Pootle is web application for managing distributed or crowdsourced
52translation.
53
54It's features include::
55- Translation of Gettext PO and XLIFF files.
56- Submitting to remote version control systems (VCS).
57- Managing groups of translators
58- Online webbased or offline translation
59- Quality checks
60
61%prep
62%setup -q -n %{fullname}-%{version}
63%patch0 -p1
710cf04b 64%patch1 -p1
098c6911 65%patch2 -p1
22a51b49 66%patch3 -p1
6a03db66 67%patch4 -p1
83e18d77 68
710cf04b 69%{__sed} -i -e '1s,#!.*env python,#!%{__python},' wsgi.py
d254aee3 70
83e18d77 71%build
a6adb95b 72%py_build
83e18d77
ER
73
74%install
75rm -rf $RPM_BUILD_ROOT
710cf04b
ER
76install -d $RPM_BUILD_ROOT{%{_sbindir},%{_datadir}/pootle,%{_sharedstatedir}/pootle/po/.tmp,%{_sysconfdir}}
77
a6adb95b 78%py_install
83e18d77 79
5a25dfdc
ER
80# install_dirs.py was modified _after_ install completed, so compile again
81# before py_postclean
82# TODO. compile only install_dirs.py
83%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
84%py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
d254aee3
ER
85%py_postclean
86
83e18d77
ER
87# Create the manpages
88install -d $RPM_BUILD_ROOT%{_mandir}/man1
89for program in $RPM_BUILD_ROOT%{_bindir}/*; do
90 case $(basename $program) in
91 PootleServer|import_pootle_prefs)
92 ;;
93 *)
94 LC_ALL=C PYTHONPATH=. $program --manpage \
d254aee3 95 > $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $program).1 \
83e18d77
ER
96 || rm -f $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $program).1
97 ;;
98 esac
99done
100
f69840c8
ER
101> %{name}.lang
102# application language
103for a in $RPM_BUILD_ROOT%{_datadir}/pootle/mo/[a-z]*; do
104 # path file and lang
105 p=${a#$RPM_BUILD_ROOT} l=${a##*/}
106 echo "%lang($l) $p" >> %{name}.lang
107done
108
109# such recursive magic is because we need to have different permissions for
110# directories and files and we want to language tag both of them
111scan_mo() {
112 for obj in "$@"; do
113 # skip bad globs (happens when we recurse)
114 [ -e "$obj" ] || continue
115 # path file and lang
116 path=${obj#$RPM_BUILD_ROOT} lang=${MO_LANG:-${obj##*/}}
117
118 if [ -d $obj ]; then
119 attr='%dir %attr(770,root,http)'
120 else
d5c71442 121 attr='%attr(660,root,http) %config(noreplace) %verify(not md5 mtime size)'
f69840c8
ER
122 fi
123 case $lang in
124 templates)
125 echo "$attr $path" >> %{name}.lang
126 ;;
127 *)
128 echo "%lang($lang) $attr $path" >> %{name}.lang
129 ;;
130 esac
131 if [ -d $obj ]; then
132 MO_LANG=$lang scan_mo $obj/*
133 unset MO_LANG
134 fi
135 done
136}
264704ca 137scan_mo $RPM_BUILD_ROOT%{_sharedstatedir}/pootle/po/{pootle,terminology,tutorial}/* >> %{name}.lang
f69840c8 138
710cf04b 139# don't clobber user $PATH
d254aee3 140mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/PootleServer
6a03db66 141install -p manage.py $RPM_BUILD_ROOT%{_sbindir}/pootle-manage
83e18d77
ER
142install -p wsgi.py $RPM_BUILD_ROOT%{_datadir}/pootle
143
d254aee3
ER
144install -d $RPM_BUILD_ROOT%{_sysconfdir}
145cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
83e18d77 146
710cf04b 147# we do doc in rpm
b042bedc 148rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
710cf04b
ER
149
150# external pkg
151rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/djblets
152
83e18d77
ER
153%clean
154rm -rf $RPM_BUILD_ROOT
155
4f752939 156%triggerin -- apache < 2.2.0, apache-base
83e18d77
ER
157%webapp_register httpd %{_webapp}
158
4f752939 159%triggerun -- apache < 2.2.0, apache-base
83e18d77
ER
160%webapp_unregister httpd %{_webapp}
161
f69840c8 162%files -f %{name}.lang
83e18d77 163%defattr(644,root,root,755)
6a03db66 164%doc ChangeLog CREDITS README
d254aee3
ER
165%dir %attr(750,root,http) %{_sysconfdir}
166%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
167%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/localsettings.py
168%attr(755,root,root) %{_bindir}/import_pootle_prefs
169%attr(755,root,root) %{_bindir}/updatetm
170%attr(755,root,root) %{_sbindir}/PootleServer
171%{_mandir}/man1/updatetm.1*
172
173%dir %{_datadir}/pootle
174%{_datadir}/pootle/mo/README
175%attr(755,root,root) %{_datadir}/pootle/wsgi.py
176%{_datadir}/pootle/html
177%{_datadir}/pootle/templates
178%dir %{_datadir}/pootle/mo
d254aee3 179
264704ca 180%{py_sitescriptdir}/contact_form_i18n
d254aee3
ER
181%{py_sitescriptdir}/pootle
182%{py_sitescriptdir}/pootle_app
183%{py_sitescriptdir}/pootle_autonotices
264704ca 184%{py_sitescriptdir}/pootle_language
d254aee3
ER
185%{py_sitescriptdir}/pootle_misc
186%{py_sitescriptdir}/pootle_notifications
264704ca
ER
187%{py_sitescriptdir}/pootle_profile
188%{py_sitescriptdir}/pootle_project
189%{py_sitescriptdir}/pootle_statistics
d254aee3 190%{py_sitescriptdir}/pootle_store
264704ca
ER
191%{py_sitescriptdir}/pootle_terminology
192%{py_sitescriptdir}/pootle_translationproject
d254aee3
ER
193%{py_sitescriptdir}/profiles
194%{py_sitescriptdir}/registration
195%if "%{py_ver}" > "2.4"
196%{py_sitescriptdir}/Pootle-*.egg-info
197%endif
198
199%dir %{_sharedstatedir}/pootle
200%dir %attr(770,root,http) %{_sharedstatedir}/pootle/dbs
201%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po
710cf04b
ER
202# setup a tempdir inside the PODIRECTORY heirarchy, this way we have
203# reasonable guarantee that temp files will be created on the same
204# filesystem as translation files (required for save operations).
205%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/.tmp
206
f69840c8 207# base translations from pootle itself
d254aee3 208%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/pootle
d254aee3
ER
209%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/terminology
210%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/tutorial
This page took 0.13535 seconds and 4 git commands to generate.