From: Stefano Rivera <stefanor@debian.org>
Date: Thu, 8 Oct 2015 10:29:38 -0700
Subject: Use Debian's figlet fonts.

Look in /usr/share/figlet rather than using pkg_resources to find fonts.

Forwarded: not-needed
Last-Update: 2014-07-26
---
 pyfiglet/__init__.py | 10 +++++-----
 pyfiglet/test.py     |  6 +++---
 setup.py             |  3 +--
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/pyfiglet/__init__.py b/pyfiglet/__init__.py
index 7329746..a33eaf8 100755
--- a/pyfiglet/__init__.py
+++ b/pyfiglet/__init__.py
@@ -7,7 +7,7 @@ Python FIGlet adaption
 
 from __future__ import print_function, unicode_literals
 
-import pkg_resources
+import os.path
 import re
 import sys
 from optparse import OptionParser
@@ -97,8 +97,8 @@ class FigletFont(object):
         """
         for extension in ('tlf', 'flf'):
             fn = '%s.%s' % (font, extension)
-            if pkg_resources.resource_exists('pyfiglet.fonts', fn):
-                data = pkg_resources.resource_string('pyfiglet.fonts', fn)
+            if os.path.isfile(os.path.join('/usr/share/figlet', fn)):
+                data = open(os.path.join('/usr/share/figlet', fn), 'rb').read()
                 data = data.decode('UTF-8', 'replace')
                 return data
         else:
@@ -108,7 +108,7 @@ class FigletFont(object):
     def isValidFont(cls, font):
         if not font.endswith(('.flf', '.tlf')):
             return False
-        f = pkg_resources.resource_stream('pyfiglet.fonts', font)
+        f = open(os.path.join('/usr/share/figlet', font), 'rb')
         header = f.readline().decode('UTF-8', 'replace')
         f.close()
         return cls.reMagicNumber.search(header)
@@ -116,7 +116,7 @@ class FigletFont(object):
     @classmethod
     def getFonts(cls):
         return [font.rsplit('.', 2)[0] for font
-                in pkg_resources.resource_listdir('pyfiglet', 'fonts')
+                in os.listdir('/usr/share/figlet')
                 if cls.isValidFont(font)]
 
     @classmethod
diff --git a/pyfiglet/test.py b/pyfiglet/test.py
index 6872201..fe28087 100755
--- a/pyfiglet/test.py
+++ b/pyfiglet/test.py
@@ -38,9 +38,9 @@ class Test(object):
 
     def outputUsingFigletorToilet(self, text, font, fontpath):
         if os.path.isfile(fontpath + '.flf'):
-            cmd = ('figlet', '-d', 'pyfiglet/fonts', '-f', font, text)
+            cmd = ('figlet', '-d', '/usr/share/figlet', '-f', font, text)
         elif os.path.isfile(fontpath + '.tlf'):
-            cmd = ('toilet', '-d', 'pyfiglet/fonts', '-f', font, text)
+            cmd = ('toilet', '-d', '/usr/share/figlet', '-f', font, text)
         else:
             raise Exception('Missing font file: '+fontpath)
 
@@ -71,7 +71,7 @@ class Test(object):
     def check_font(self, text, font):
         if font in self.skip:
             return
-        fontpath = os.path.join('pyfiglet', 'fonts', font)
+        fontpath = os.path.join('/usr/share/figlet', font)
 
         self.f.setFont(font=font)
 
diff --git a/setup.py b/setup.py
index 43cba4d..10095c6 100755
--- a/setup.py
+++ b/setup.py
@@ -46,8 +46,7 @@ setup(
     author='Peter Waller (Thanks to Christopher Jones and Stefano Rivera)',
     author_email='peter.waller@gmail.com',
     url='https://github.com/pwaller/pyfiglet',
-    packages=['pyfiglet', 'pyfiglet.fonts'],
-    package_data={'pyfiglet.fonts': ['*.flf']},
+    packages=['pyfiglet'],
     entry_points={
         'console_scripts': [
             'pyfiglet = pyfiglet:main',
