rpms/python-tgcaptcha/devel python-tgcaptcha-system-tuffy.patch, NONE, 1.1 python-tgcaptcha.spec, 1.4, 1.5

Felix Schwarz fschwarz at fedoraproject.org
Wed Apr 8 15:21:13 UTC 2009


Author: fschwarz

Update of /cvs/pkgs/rpms/python-tgcaptcha/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29727

Modified Files:
	python-tgcaptcha.spec 
Added Files:
	python-tgcaptcha-system-tuffy.patch 
Log Message:
closes bz 477447


python-tgcaptcha-system-tuffy.patch:

--- NEW FILE python-tgcaptcha-system-tuffy.patch ---
diff -r 9d6932712735 tgcaptcha/plugins/image/mcdermott.py
--- a/tgcaptcha/plugins/image/mcdermott.py	Wed Mar 04 08:26:10 2009 +0100
+++ b/tgcaptcha/plugins/image/mcdermott.py	Wed Mar 04 08:28:14 2009 +0100
@@ -12,6 +12,8 @@
 if not font_path:
     font_path = os.path.abspath(
                 resource_filename('tgcaptcha', 'static/fonts/tuffy/Tuffy.ttf'))
+if not os.path.exists(font_path):
+    font_path = os.path.normpath('/usr/share/fonts/tulrich-tuffy/Tuffy.ttf')
 assert os.path.exists(font_path), \
                 'The font_path "%s" does not exist' % (font_path,)
     
@@ -44,4 +46,4 @@
 	d.text((3,3), text, font=font, fill=fgcolor)
 	im = im.filter(ImageFilter.EDGE_ENHANCE_MORE)
 	# save the image to a file
-	im.save(file_obj, format='JPEG')
\ No newline at end of file
+	im.save(file_obj, format='JPEG')
diff -r 9d6932712735 tgcaptcha/plugins/image/vanasco_dowty/__init__.py
--- a/tgcaptcha/plugins/image/vanasco_dowty/__init__.py	Wed Mar 04 08:26:10 2009 +0100
+++ b/tgcaptcha/plugins/image/vanasco_dowty/__init__.py	Wed Mar 04 08:28:14 2009 +0100
@@ -14,9 +14,7 @@
 font_size_min = int(config.get(plugin_name + 'font_size_min', 30))
 font_size_max = int(config.get(plugin_name + 'font_size_min', 45))
 font_paths = config.get(plugin_name + 'font_paths',
-                [os.path.abspath(resource_filename('tgcaptcha', 
-                                'static/fonts/tuffy/Tuffy.ttf'))])
-
+                [os.path.normpath('/usr/share/fonts/tulrich-tuffy/Tuffy.ttf')])
 captcha.font__paths = font_paths
 captcha.captcha__text__render_mode = config.get(plugin_name +
         'text_render_mode', 'by_letter')
@@ -28,4 +26,4 @@
     fg = random.choice(fg_color)
     ci = captcha._Captcha__Img(text, width, height, font_size, fg, bg_color)
     image = ci.render()
-    image.save(file_, format='JPEG')
\ No newline at end of file
+    image.save(file_, format='JPEG')


Index: python-tgcaptcha.spec
===================================================================
RCS file: /cvs/pkgs/rpms/python-tgcaptcha/devel/python-tgcaptcha.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- python-tgcaptcha.spec	26 Feb 2009 23:42:05 -0000	1.4
+++ python-tgcaptcha.spec	8 Apr 2009 15:20:43 -0000	1.5
@@ -4,13 +4,14 @@
 
 Name:           python-tgcaptcha
 Version:        0.11
-Release:        5%{?dist}
+Release:        6%{?dist}
 Summary:        A TurboGears CAPTCHA widget for forms
 
 Group:          Development/Libraries
 License:        MIT
 URL:            http://code.google.com/p/tgcaptcha
 Source0:        http://tgcaptcha.googlecode.com/files/%{eggname}-%{version}.tar.gz
+Patch0:         python-tgcaptcha-system-tuffy.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 
@@ -18,6 +19,7 @@
 Requires:       TurboGears >= 1.0.1
 Requires:       python-crypto >= 2.0.1
 Requires:       python-imaging
+Requires:       tulrich-tuffy-fonts
 
 %description
 TGCaptcha is a TurboGears widget that provides an easy way to incorporate a
@@ -26,16 +28,17 @@
 
 %prep
 %setup -q -n %{eggname}-%{version}
-chmod -x tgcaptcha/static/fonts/tuffy/*
+%patch0 -p1 -b .tuffy
 
 
 %build
-%{__python} setup.py build
+rm -rf tgcaptcha/static/fonts/
 
+%{__python} setup.py build
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT 
+%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT 
 
 
 %clean
@@ -50,8 +53,8 @@
 
 
 %changelog
-* Thu Feb 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.11-5
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+* Tue Mar 03 2009 Felix Schwarz <felix.schwarz at oss.schwarz.eu> - 0.11-6
+- Use system installed tuffy (patch by Toshio Kuratomi)
 
 * Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm at gmail.com> - 0.11-4
 - Rebuild for Python 2.6




More information about the fedora-extras-commits mailing list