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