rpms/python-formencode/devel formencode-translations-system.patch, NONE, 1.1 python-formencode.spec, 1.21, 1.22
Toshio くらとみ
toshio at fedoraproject.org
Fri Aug 29 01:10:57 UTC 2008
- Previous message (by thread): rpms/python-formencode/F-8 formencode-translations-system.patch, NONE, 1.1 .cvsignore, 1.7, 1.8 python-formencode.spec, 1.16, 1.17 sources, 1.7, 1.8 python-formencode-0.7-badurl.patch, 1.1, NONE
- Next message (by thread): rpms/edsadmin/devel edsadmin-1.0-categories.patch, 1.1, 1.2 edsadmin.spec, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: toshio
Update of /cvs/pkgs/rpms/python-formencode/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv2604/devel
Modified Files:
python-formencode.spec
Added Files:
formencode-translations-system.patch
Log Message:
* Thu Aug 28 2008 Toshio Kuratomi <toshio at fedoraproject.org> 1.0.1-2
- Clean up license tag
- Fix executable in %doc
- Move translations to the proper directory
formencode-translations-system.patch:
--- NEW FILE formencode-translations-system.patch ---
Index: FormEncode-1.0.1/formencode/api.py
===================================================================
--- FormEncode-1.0.1.orig/formencode/api.py
+++ FormEncode-1.0.1/formencode/api.py
@@ -17,17 +17,36 @@ __all__ = ['NoDefault', 'Invalid', 'Vali
import gettext
def get_localedir():
+ """
+ Retrieve the location of locales.
+
+ If we're built as an egg, we need to find the resource within the egg.
+ Otherwise, we need to look for the locales on the filesystem or in the
+ system message catalog.
+ """
+ locale_dir = ''
+ # Check the egg first
if resource_filename is not None:
try:
- return resource_filename(__name__, "/i18n")
+ locale_dir = resource_filename(__name__, "/i18n")
except NotImplementedError:
# resource_filename doesn't work with non-egg zip files
pass
- return os.path.join(os.path.dirname(__file__), 'i18n')
+ if os.access(locale_dir, os.R_OK | os.X_OK):
+ # If the resource is present in the egg, use it
+ return locale_dir
+
+ # Otherwise, search the filesystem
+ locale_dir = os.path.join(os.path.dirname(__file__), 'i18n')
+ if not os.access(locale_dir, os.R_OK | os.X_OK):
+ # Fallback on the system catalog
+ locale_dir = os.path.normpath('/usr/share/locale')
+
+ return locale_dir
def set_stdtranslation(domain="FormEncode", languages=None, \
localedir = get_localedir()):
-
+
t = gettext.translation(domain=domain, \
languages=languages, \
localedir=localedir, fallback=True)
Index: python-formencode.spec
===================================================================
RCS file: /cvs/pkgs/rpms/python-formencode/devel/python-formencode.spec,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- python-formencode.spec 11 Jul 2008 16:27:51 -0000 1.21
+++ python-formencode.spec 29 Aug 2008 01:10:27 -0000 1.22
@@ -1,21 +1,26 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?pyver: %define pyver %(%{__python} -c "import sys ; print sys.version[:3]")}
+%define srcname FormEncode
+
Name: python-formencode
Version: 1.0.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: HTML form validation, generation, and convertion package
Group: Development/Libraries
-License: PSF
+License: Python
URL: http://formencode.org/
-Source0: http://cheeseshop.python.org/packages/source/F/FormEncode/FormEncode-%{version}.tar.gz
+Source0: http://cheeseshop.python.org/packages/source/F/%{srcname}/%{srcname}-%{version}.tar.gz
+Patch0: formencode-translations-system.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
Requires: python-setuptools
-BuildRequires: python-devel python-setuptools-devel
+BuildRequires: python-devel
+BuildRequires: python-setuptools-devel
+BuildRequires: python-docutils
%description
@@ -24,7 +29,8 @@
for filling and generating forms.
%prep
-%setup -q -n FormEncode-%{version}
+%setup -q -n %{srcname}-%{version}
+%patch0 -p1 -b .locale
%build
%{__python} setup.py build
@@ -34,18 +40,44 @@
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
+# Build the docs then throw out the script
+pushd docs
+sed -i 's/rst2html.py/rst2html/' build
+./build
+rm -rf build
+popd
+
+# bah. setuptools resource badness
+# Luckily ian bicking wrote the lookup for this to correctly fallback on the
+# system catalog
+for file in $RPM_BUILD_ROOT%{python_sitelib}/formencode/i18n/* ; do
+ if [ -d $file ] ; then
+ if [ -e $file/LC_MESSAGES/%{srcname}.mo ] ; then
+ mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale/`basename $file`/LC_MESSAGES/
+ mv $file/LC_MESSAGES/%{srcname}.mo $RPM_BUILD_ROOT%{_datadir}/locale/`basename $file`/LC_MESSAGES/
+ fi
+ fi
+done
+rm -rf $RPM_BUILD_ROOT%{python_sitelib}/formencode/i18n
+
+%find_lang %{srcname}
%clean
rm -rf $RPM_BUILD_ROOT
-%files
+%files -f %{srcname}.lang
%defattr(-,root,root,-)
%doc PKG-INFO docs
%{python_sitelib}/formencode
-%{python_sitelib}/FormEncode-%{version}-py%{pyver}.egg-info
+%{python_sitelib}/%{srcname}-%{version}-py%{pyver}.egg-info
%changelog
+* Thu Aug 28 2008 Toshio Kuratomi <toshio at fedoraproject.org> 1.0.1-2
+- Clean up license tag
+- Fix executable in %%doc
+- Move translations to the proper directory
+
* Fri Jul 11 2008 Toshio Kuratomi <toshio at fedoraproject.org> 1.0.1-1
- Update to 1.0.1
- Fixes issue where chained_validators were silently ignored. (bz#454988)
@@ -106,7 +138,7 @@
* Tue Oct 13 2005 Oliver Andrich <oliver.andrich at gmail.com> 0.2.2-2
- fixed the too long description line
- add -O1 to the installation process
-- %ghost'ed the *.pyo files
+- %%ghost'ed the *.pyo files
* Tue Oct 06 2005 Oliver Andrich <oliver.andrich at gmail.com> 0.2.2-1
- update to upstream version 0.2.2
- Previous message (by thread): rpms/python-formencode/F-8 formencode-translations-system.patch, NONE, 1.1 .cvsignore, 1.7, 1.8 python-formencode.spec, 1.16, 1.17 sources, 1.7, 1.8 python-formencode-0.7-badurl.patch, 1.1, NONE
- Next message (by thread): rpms/edsadmin/devel edsadmin-1.0-categories.patch, 1.1, 1.2 edsadmin.spec, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list