packages: pootle/pootle.spec - one sysconfdir (in webapps) - verbose files, ...

glen glen at pld-linux.org
Mon May 10 23:36:09 CEST 2010


Author: glen                         Date: Mon May 10 21:36:09 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- one sysconfdir (in webapps)
- verbose files, categorized for lang tagging
- do not restart services we do not own
- memcache is optional, and can use remote server
- do not package python source files
- we have no initscript by our own

---- Files affected:
packages/pootle:
   pootle.spec (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: packages/pootle/pootle.spec
diff -u packages/pootle/pootle.spec:1.1 packages/pootle/pootle.spec:1.2
--- packages/pootle/pootle.spec:1.1	Mon May 10 18:52:32 2010
+++ packages/pootle/pootle.spec	Mon May 10 23:36:03 2010
@@ -1,11 +1,12 @@
 # $Revision$, $Date$
 # TODO
-# - full webapp (all config to webapps dir)
+# - move %{_datadir}/pootle/mo/* to system localedir as pootle.mo
+# - lang tag languages in /var
 %define		fullname Pootle
 Summary:	Localization and translation management web application
 Name:		pootle
 Version:	2.0.3
-Release:	0.1
+Release:	0.3
 License:	GPL v2+
 Group:		Development/Tools
 URL:		http://translate.sourceforge.net/wiki/pootle/index
@@ -15,27 +16,27 @@
 Patch0:		%{name}-settings.patch
 BuildRequires:	python-devel
 BuildRequires:	rpmbuild(macros) >= 1.228
+BuildRequires:	sed >= 4.0
 BuildRequires:	translate-toolkit >= 1.4.1
-Requires(post,preun):	/sbin/chkconfig
 Requires:	apache-mod_wsgi
 Requires:	group(http)
 Requires:	iso-codes
-Requires:	memcached
 Requires:	python-Levenshtein
 Requires:	python-django >= 1.0
 Requires:	python-djblets
 Requires:	python-lxml
-Requires:	python-memcached
 Requires:	python-xapian >= 1.0.13
-Requires:	rc-scripts
 Requires:	translate-toolkit >= 1.5.1
 Requires:	xapian-core
 Requires:	zip
+Suggests:	memcached
+Suggests:	python-memcached
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define		_webapps	/etc/webapps
 %define		_webapp		%{name}
+%define		_sysconfdir	%{_webapps}/%{_webapp}
 
 %description
 Pootle is web application for managing distributed or crowdsourced
@@ -52,16 +53,21 @@
 %setup -q -n %{fullname}-%{version}
 %patch0 -p1
 
+%{__sed} -i -e 's,^\(INSTALL_CONFIG_DIR\) =.*,\1 = "%{_sysconfdir}",' setup.py
+
 %build
 %{__python} setup.py build
 
 %install
 rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_sbindir},%{_datadir}/pootle,%{_sharedstatedir}/pootle,%{_sysconfdir}}
 %{__python} setup.py install \
 	--skip-build \
 	--optimize=2 \
 	--root=$RPM_BUILD_ROOT
 
+%py_postclean
+
 # Create the manpages
 install -d $RPM_BUILD_ROOT%{_mandir}/man1
 for program in $RPM_BUILD_ROOT%{_bindir}/*; do
@@ -70,34 +76,24 @@
 		;;
 	*)
 		LC_ALL=C PYTHONPATH=. $program --manpage \
-		>  $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $program).1 \
+		> $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $program).1 \
 		|| rm -f $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $program).1
 		;;
 	esac
 done
 
-install -d $RPM_BUILD_ROOT{%{_sbindir},%{_datadir}/pootle,%{_sharedstatedir}/pootle,%{_sysconfdir}/pootle}
-install -p $RPM_BUILD_ROOT%{_bindir}/PootleServer $RPM_BUILD_ROOT%{_sbindir}
-rm $RPM_BUILD_ROOT%{_bindir}/PootleServer
+rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/pootle
+
+mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/PootleServer
 rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/djblets
 install -p wsgi.py $RPM_BUILD_ROOT%{_datadir}/pootle
 
-install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
-cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
+install -d $RPM_BUILD_ROOT%{_sysconfdir}
+cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-%service httpd restart
-%service -q memcached restart
-
-%postun
-if [ "$1" -ge "1" ] ; then
-	%service httpd condrestart
-	%service -q memcached condrestart
-fi
-
 %triggerin -- apache < 2.2.0, apache-base
 %webapp_register httpd %{_webapp}
 
@@ -107,19 +103,57 @@
 %files
 %defattr(644,root,root,755)
 %doc ChangeLog README
-# We exclude docs as the Pootle installer doesn't do ${name}-${version} as expected in Fedora
-%exclude %{_datadir}/doc/pootle
-%dir %attr(750,root,http) %{_webapps}/%{_webapp}
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
-%attr(755,root,root) %{_bindir}/*
-%attr(755,root,root) %{_sbindir}/*
-%{_mandir}/man1/*
-%dir %{_sysconfdir}/pootle
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pootle/localsettings.py
-%{_datadir}/pootle
-%attr(770,root,http) %{_sharedstatedir}/pootle
-
-%{py_sitescriptdir}/*
+%dir %attr(750,root,http) %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/localsettings.py
+%attr(755,root,root) %{_bindir}/import_pootle_prefs
+%attr(755,root,root) %{_bindir}/updatetm
+%attr(755,root,root) %{_sbindir}/PootleServer
+%{_mandir}/man1/updatetm.1*
+
+%dir %{_datadir}/pootle
+%{_datadir}/pootle/mo/README
+%attr(755,root,root) %{_datadir}/pootle/wsgi.py
+%{_datadir}/pootle/html
+%{_datadir}/pootle/templates
+%dir %{_datadir}/pootle/mo
+# TODO: %lang
+%{_datadir}/pootle/mo/[a-z]*
+
+%{py_sitescriptdir}/pootle
+%{py_sitescriptdir}/pootle_app
+%{py_sitescriptdir}/pootle_autonotices
+%{py_sitescriptdir}/pootle_misc
+%{py_sitescriptdir}/pootle_notifications
+%{py_sitescriptdir}/pootle_store
+%{py_sitescriptdir}/profiles
+%{py_sitescriptdir}/registration
+%if "%{py_ver}" > "2.4"
+%{py_sitescriptdir}/Pootle-*.egg-info
+%endif
+
+%dir %{_sharedstatedir}/pootle
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/dbs
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/pootle
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/pootle/templates
+%attr(660,root,http) %{_sharedstatedir}/pootle/po/pootle/templates/pootle.pot
+
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/terminology
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/tutorial
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/tutorial/templates
+%attr(660,root,http) %{_sharedstatedir}/pootle/po/tutorial/templates/tutorial.pot
+
+# TODO %lang
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/pootle/[a-z][a-z]
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/pootle/[a-z][a-z][a-z]
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/pootle/*[@_]*
+
+%attr(660,root,http) %{_sharedstatedir}/pootle/po/pootle/*/*.po
+
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/terminology/*
+%dir %attr(770,root,http) %{_sharedstatedir}/pootle/po/terminology/*/gnome
+%attr(660,root,http) %{_sharedstatedir}/pootle/po/terminology/*/gnome/*.po
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -127,6 +161,13 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.2  2010/05/10 21:36:03  glen
+- one sysconfdir (in webapps)
+- verbose files, categorized for lang tagging
+- do not restart services we do not own
+- memcache is optional, and can use remote server
+- do not package python source files
+- we have no initscript by our own
+
 Revision 1.1  2010/05/10 16:52:32  glen
 - new, based on fc, seems starting up
-
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/pootle/pootle.spec?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list