]> git.pld-linux.org Git - packages/pootle.git/blob - pootle.spec
60c8e790efd16bd5ca6c48508e004c86fe7ce12d
[packages/pootle.git] / pootle.spec
1 # TODO
2 # - move %{_datadir}/pootle/mo/* to system localedir as pootle.mo
3 %define         subver  b3
4 %define         fullname Pootle
5 Summary:        Localization and translation management web application
6 Name:           pootle
7 Version:        2.8.0
8 Release:        0.10
9 License:        GPL v2
10 Group:          Development/Tools
11 Source0:        https://github.com/translate/pootle/releases/download/%{version}%{subver}/Pootle-%{version}%{subver}.tar.bz2
12 # Source0-md5:  c7e86066f78f8a04823309c1b3cf0134
13 Source1:        apache.conf
14 Source2:        find-lang.sh
15 Patch0:         settings.patch
16 Patch1:         paths.patch
17 Patch2:         homedir.patch
18 URL:            http://pootle.translatehouse.org/
19 BuildRequires:  python-modules >= 1:2.7
20 BuildRequires:  rpm-pythonprov
21 BuildRequires:  rpmbuild(macros) >= 1.714
22 BuildRequires:  sed >= 4.0
23 BuildRequires:  translate-toolkit >= 1.4.1
24 Requires:       apache-mod_alias
25 Requires:       apache-mod_authz_host
26 Requires:       apache-mod_mime
27 Requires:       apache-mod_wsgi
28 Requires:       group(http)
29 Requires:       iso-codes
30 Requires:       zip
31 Suggests:       memcached
32 Suggests:       python(sqlite)
33 Suggests:       python-memcached
34 BuildArch:      noarch
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %define         find_lang       sh %{_sourcedir}/find-lang.sh %{buildroot}
38
39 %define         _webapps        /etc/webapps
40 %define         _webapp         %{name}
41 %define         _sysconfdir     %{_webapps}/%{_webapp}
42
43 %description
44 Pootle is web application for managing distributed or crowdsourced
45 translation.
46
47 It's features include::
48 - Translation of Gettext PO and XLIFF files.
49 - Submitting to remote version control systems (VCS).
50 - Managing groups of translators
51 - Online webbased or offline translation
52 - Quality checks
53
54 %prep
55 %setup -q -n %{fullname}-%{version}%{?subver}
56 %patch0 -p1
57 #%patch1 -p1
58 #%patch2 -p1
59
60 #%{__sed} -i -e '1s,#!.*env python,#!%{__python},' wsgi.py
61
62 # not packaging for Travis CI
63 rm pootle/settings/91-travis.conf
64
65 rm pootle/log/README
66 rm pootle/dbs/README
67
68 %build
69 %py_build
70
71 %install
72 rm -rf $RPM_BUILD_ROOT
73 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_datadir}/%{name},%{_sharedstatedir}/%{name}/{dbs,po/.tmp},/var/log/%{name},%{_sysconfdir}}
74
75 %py_install
76 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/tests
77 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pytest_pootle
78
79 # move these to /var/lib/pootle/po
80 mv $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/translations/{terminology,tutorial} \
81         $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}/po
82 rmdir $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/translations
83
84 # move to data dir
85 mv $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/{locale,static,assets} \
86         $RPM_BUILD_ROOT%{_datadir}/%{name}
87
88 # install_dirs.py was modified _after_ install completed, so compile again
89 # before py_postclean
90 # TODO. compile only install_dirs.py
91 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
92 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
93 %py_postclean
94
95 %find_lang %{name}.lang
96
97 # don't clobber user $PATH
98 #mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/PootleServer
99 #install -p manage.py $RPM_BUILD_ROOT%{_sbindir}/pootle-manage
100 #install -p wsgi.py $RPM_BUILD_ROOT%{_datadir}/pootle
101
102 install -d $RPM_BUILD_ROOT%{_sysconfdir}
103 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
104
105 # we do doc in rpm
106 rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
107
108 # external pkg
109 #rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/djblets
110
111 %clean
112 rm -rf $RPM_BUILD_ROOT
113
114 %triggerin -- apache < 2.2.0, apache-base
115 %webapp_register httpd %{_webapp}
116
117 %triggerun -- apache < 2.2.0, apache-base
118 %webapp_unregister httpd %{_webapp}
119
120 %files -f %{name}.lang
121 %defattr(644,root,root,755)
122 %doc README.rst INSTALL CONTRIBUTING.rst
123 %dir %attr(750,root,http) %{_sysconfdir}
124 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
125 #%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/localsettings.py
126 %attr(755,root,root) %{_bindir}/pootle
127
128 %dir %{_datadir}/%{name}
129 %{_datadir}/%{name}/assets
130 %{_datadir}/%{name}/static
131 %dir %{_datadir}/%{name}/locale
132 %{_datadir}/%{name}/locale/LINGUAS
133 %{_datadir}/%{name}/locale/templates
134 %if 0
135 %attr(755,root,root) %{_datadir}/pootle/wsgi.py
136 %endif
137
138 %{py_sitescriptdir}/%{name}
139 %{py_sitescriptdir}/Pootle-%{version}%{?subver}-py*.egg-info
140
141 %dir %{_sharedstatedir}/%{name}
142 %dir %attr(770,root,http) %{_sharedstatedir}/%{name}/dbs
143 %dir %attr(770,root,http) %{_sharedstatedir}/%{name}/po
144 # setup a tempdir inside the PODIRECTORY heirarchy, this way we have
145 # reasonable guarantee that temp files will be created on the same
146 # filesystem as translation files (required for save operations).
147 %dir %attr(770,root,http) %{_sharedstatedir}/%{name}/po/.tmp
148
149 # base translations from pootle itself
150 #%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/pootle
151 # terminology and tutorial po files
152 %dir %attr(770,root,http) %{_sharedstatedir}/%{name}/po/terminology
153 %dir %attr(770,root,http) %{_sharedstatedir}/%{name}/po/tutorial
154
155 %dir %attr(770,root,http) /var/log/%{name}
This page took 0.063225 seconds and 2 git commands to generate.