raelgc / scudcloud

ScudCloud - Slack for Linux
https://launchpad.net/~rael-gc/+archive/ubuntu/scudcloud
MIT License
1.22k stars 99 forks source link

Some files not properly listed by setup #601

Open UnitedMarsupials-zz opened 6 years ago

UnitedMarsupials-zz commented 6 years ago

While preparing the FreeBSD port of scudcloud, I found it necessary to patch setup.py as follows addressing several packaging-problems:

Some of the below changes may be considered FreeBSD-specific, but you may wish to consider addressing the first four items...

Updated version of the patch:

--- setup.py    2017-09-12 12:02:28
+++ setup.py    2017-09-28 15:36:56
@@ -39,6 +39,6 @@
         yield directory, files

-    yield os.path.join('share', 'doc', 'scudcloud'), \
-        ['LICENSE', 'README']
+    yield os.getenv('DOCSDIR_REL', os.path.join('share', 'doc', 'scudcloud')), \
+        ['README']
     yield os.path.join('share', 'applications'), \
         glob.glob(os.path.join('share', '*.desktop'))
@@ -46,5 +46,4 @@
         glob.glob(os.path.join('scudcloud', 'resources', 'scudcloud.png'))

-
 setup(name='scudcloud',
       author='Rael Gugelmin Cunha',
@@ -61,5 +60,5 @@
       package_data = {
           # *.js will be processed separately
-          'scudcloud': ['resources/*.css', 'resources/*.html', 'resources/*.png',]
+          'scudcloud': ['resources/*.css', 'resources/*.html', 'resources/*.js']
       },
       packages=['scudcloud',],
raelgc commented 6 years ago

Well, the python install section was contributed by several users, so a lot of room to improve (like avoid copy the JS files in icon folders).

The other point: maybe the proper way to handle BSD and non BSD environment is check if DATADIR_REL is defined and use it in positive case. Use the current folders if not defined.

UnitedMarsupials-zz commented 6 years ago

Oh, something like this is needed too, if the scudcloud.png is to live only in share/pixmaps/:

--- scudcloud/resources.py      2017-09-12 12:02:28.000000000 +0000
+++ scudcloud/resources.py      2017-09-28 16:16:16.490033000 +0000
@@ -14,4 +14,5 @@

     SPELL_LIMIT = 6
+    INSTALL_PREFIX = '/usr'
     SPELL_DICT_PATH  = '/usr/share/hunspell'
     DEFAULT_CONFDIR  = '~/.config/scudcloud'
@@ -22,3 +23,6 @@

     def get_path(filename):
-        return os.path.join(Resources.INSTALL_DIR, 'resources', filename)
+        if filename.endswith('.png'):
+           return os.path.join(Resources.INSTALL_PREFIX, 'share', 'pixmaps', filename)
+        else:
+           return os.path.join(Resources.INSTALL_DIR, 'resources', filename)

Regarding the hardcoding of /usr as the prefix -- the FreeBSD port will simply replace /usr with $PREFIX during port-building. But you may wish to do this in setup.py, when files are "installed" into build_lib.