File curlew-sitelib.patch of Package curlew

diff -ruN curlew-0.2.5.orig/curlew curlew-0.2.5/curlew
--- curlew-0.2.5.orig/curlew	2016-03-04 16:39:47.000000000 +0300
+++ curlew-0.2.5/curlew	2018-06-08 00:57:29.124269779 +0300
@@ -1,9 +1,5 @@
 #!/usr/bin/env python3
 
-from site import addsitedir
-addsitedir('/usr/share/curlew')
-addsitedir('/usr/local/share/curlew')
-
 import sys
-from modules.curlew import main
+from curlew.curlew import main
 main(*sys.argv[1:])
diff -ruN curlew-0.2.5.orig/modules/codecsdialog.py curlew-0.2.5/modules/codecsdialog.py
--- curlew-0.2.5.orig/modules/codecsdialog.py	2018-05-26 06:32:54.000000000 +0300
+++ curlew-0.2.5/modules/codecsdialog.py	2018-06-08 00:58:45.720529325 +0300
@@ -21,7 +21,7 @@
 gi.require_version('Gtk', '3.0')
 
 from gi.repository import Gtk, Pango
-from modules.functions import get_available_codecs
+from curlew.functions import get_available_codecs
 
 class CodecsDialog(Gtk.Dialog):
     def __init__(self, prnt, encoder, title):
diff -ruN curlew-0.2.5.orig/modules/configs.py curlew-0.2.5/modules/configs.py
--- curlew-0.2.5.orig/modules/configs.py	2018-05-26 06:33:01.000000000 +0300
+++ curlew-0.2.5/modules/configs.py	2018-06-08 00:58:45.720529325 +0300
@@ -19,7 +19,7 @@
 
 
 from gi.repository import GLib
-from modules.consts import CONF_FILE
+from curlew.consts import CONF_FILE
 
 GROUP = 'configs'
 
diff -ruN curlew-0.2.5.orig/modules/consts.py curlew-0.2.5/modules/consts.py
--- curlew-0.2.5.orig/modules/consts.py	2018-05-26 06:33:11.000000000 +0300
+++ curlew-0.2.5/modules/consts.py	2018-06-08 00:59:32.468688114 +0300
@@ -26,7 +26,7 @@
 CONF_FILE = join(CONF_PATH, 'curlew.cfg')
 
 PKG_DIR = dirname(realpath(__file__))
-DTA_DIR = join(PKG_DIR, '../')
+DTA_DIR = join(PKG_DIR, '../../../../share/curlew')
 
 SOUND_FILE = join(DTA_DIR, 'done.ogg')
 
diff -ruN curlew-0.2.5.orig/modules/curlew.py curlew-0.2.5/modules/curlew.py
--- curlew-0.2.5.orig/modules/curlew.py	2018-05-26 06:33:18.000000000 +0300
+++ curlew-0.2.5/modules/curlew.py	2018-06-08 01:00:20.820852654 +0300
@@ -39,24 +39,24 @@
     from gi.repository import Gtk, GLib, Gdk, GObject, GdkPixbuf, Gio, Pango
     import dbus.glib, dbus.service
     
-    from modules.customwidgets import LabeledHBox, TimeLayout, HScale, \
+    from curlew.customwidgets import LabeledHBox, TimeLayout, HScale, \
     SpinsFrame, LabeledGrid, ComboWithEntry, ButtonWithIcon, ToggleBtnWithIcon
-    from modules.about import About
-    from modules.functions import show_message, get_format_size, \
+    from curlew.about import About
+    from curlew.functions import show_message, get_format_size, \
     duration_to_time, time_to_duration, check_codec
-    from modules.logdialog import LogDialog
-    from modules.errdialog import ErrDialog
-    from modules.tray import StatusIcon
-    from modules.languages import LANGUAGES
-    from modules.favdialog import FavoriteDialog
-    from modules.waitdialog import WaitDialog
-    from modules.formats import Formats
-    from modules.infobars import InfoBar
-    from modules.codecsdialog import CodecsDialog
-    from modules.consts import CONF_PATH, HOME, CONF_FILE, DTA_DIR, \
+    from curlew.logdialog import LogDialog
+    from curlew.errdialog import ErrDialog
+    from curlew.tray import StatusIcon
+    from curlew.languages import LANGUAGES
+    from curlew.favdialog import FavoriteDialog
+    from curlew.waitdialog import WaitDialog
+    from curlew.formats import Formats
+    from curlew.infobars import InfoBar
+    from curlew.codecsdialog import CodecsDialog
+    from curlew.consts import CONF_PATH, HOME, CONF_FILE, DTA_DIR, \
     ORG_FFILE, USR_FFILE, SOUND_FILE
-    from modules.configs import get_b_config, get_s_config
-    from modules.players import choose_player
+    from curlew.configs import get_b_config, get_s_config
+    from curlew.players import choose_player
 except Exception as e:
     print(e)
     sys.exit(1)
@@ -74,7 +74,7 @@
 
 # Localization.
 DOMAIN = 'curlew'
-LOCALDIR = join(DTA_DIR, 'locale')
+LOCALDIR = join(DTA_DIR, '../locale')
 gettext.install(DOMAIN, LOCALDIR)
 
 # Treeview cols nbrs
diff -ruN curlew-0.2.5.orig/modules/formateditor.py curlew-0.2.5/modules/formateditor.py
--- curlew-0.2.5.orig/modules/formateditor.py	2018-05-26 06:33:53.000000000 +0300
+++ curlew-0.2.5/modules/formateditor.py	2018-06-08 00:58:45.748529420 +0300
@@ -24,9 +24,9 @@
 
 from gi.repository import Gtk, GLib
 
-from modules.customwidgets import LabeledGrid, ButtonWithIcon
-from modules.consts import CONF_FILE, ORG_FFILE
-from modules.functions import show_message
+from curlew.customwidgets import LabeledGrid, ButtonWithIcon
+from curlew.consts import CONF_FILE, ORG_FFILE
+from curlew.functions import show_message
 
 
 class FormatEditor(Gtk.Dialog):
diff -ruN curlew-0.2.5.orig/modules/formats.py curlew-0.2.5/modules/formats.py
--- curlew-0.2.5.orig/modules/formats.py	2018-05-26 06:34:00.000000000 +0300
+++ curlew-0.2.5/modules/formats.py	2018-06-08 00:58:45.720529325 +0300
@@ -21,8 +21,8 @@
 gi.require_version('Gtk', '3.0')
 
 from gi.repository import Gtk
-from modules.formateditor import FormatEditor
-from modules.customwidgets import ButtonWithIcon
+from curlew.formateditor import FormatEditor
+from curlew.customwidgets import ButtonWithIcon
 
 class Formats(Gtk.Popover):
     
diff -ruN curlew-0.2.5.orig/modules/__init__.py curlew-0.2.5/modules/__init__.py
--- curlew-0.2.5.orig/modules/__init__.py	2018-05-26 06:32:44.000000000 +0300
+++ curlew-0.2.5/modules/__init__.py	2018-06-08 00:58:45.720529325 +0300
@@ -19,7 +19,7 @@
 
 from gi.repository import GLib
 
-from modules.consts import CONF_FILE, USR_FFILE, CONF_PATH
+from curlew.consts import CONF_FILE, USR_FFILE, CONF_PATH
 from os.path import exists
 import os
 
diff -ruN curlew-0.2.5.orig/modules/players.py curlew-0.2.5/modules/players.py
--- curlew-0.2.5.orig/modules/players.py	2018-05-26 06:34:39.000000000 +0300
+++ curlew-0.2.5/modules/players.py	2018-06-08 00:58:45.720529325 +0300
@@ -18,7 +18,7 @@
 # http://waqf.ojuba.org/license
 
 from shutil import which
-from modules.configs import set_s_config
+from curlew.configs import set_s_config
 
 PLAYERS_LIST = [
     'mpv',
diff -ruN curlew-0.2.5.orig/setup.py curlew-0.2.5/setup.py
--- curlew-0.2.5.orig/setup.py	2018-05-26 06:31:20.000000000 +0300
+++ curlew-0.2.5/setup.py	2018-06-08 01:02:30.029293820 +0300
@@ -17,8 +17,6 @@
 doc_files  = ['LICENSE-ar.txt', 'LICENSE-en.txt', 'AUTHORS', 'THANKS', 'changelog', 'README']
 data_files = [('share/applications/', ['curlew.desktop']),
               ('share/icons/hicolor/scalable/apps', ['curlew.svg']),
-              ('share/pixmaps', ['curlew.svg']),
-              ('share/doc/curlew', doc_files),
               ('share/curlew', ['formats.cfg', 'done.ogg']),
               #('share/curlew', ['formats.cfg', 'ffmpeg']), # Portable version
               ('share/curlew/modules', glob("modules/*.py"))
@@ -58,7 +56,7 @@
         # Generate mo files
         call("msgfmt {} -o {}".format(po_file, mo_path), shell=True)
     
-    locales = map(lambda i: ('share/curlew/'+i, [i+'/curlew.mo', ]), glob('locale/*/LC_MESSAGES'))
+    locales = map(lambda i: ('share/'+i, [i+'/curlew.mo', ]), glob('locale/*/LC_MESSAGES'))
     data_files.extend(locales)
     
     return 0
@@ -168,5 +166,7 @@
                      'Topic :: Desktop Environment :: Gnome',
                      'Topic :: Multimedia :: Sound/Audio :: Conversion',
                      'Topic :: Utilities'],
-      data_files=data_files
+      data_files=data_files,
+      packages=['curlew'],
+      package_dir={"curlew" : "modules"}
       )