Description: Install docs files in correct path, don't install COPYING file and NEWS file are installed from d/rules.
Forwarded: no
Author: Daniel Echeverry <epsilon77@gmail.com>
Origin: vendor
Last-Update: 2018-11-17
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@
 from sys import argv, exit, prefix, version_info
 
 
-DOC_FILES = ['COPYING', 'README', 'NEWS', 'TODO']
+DOC_FILES = ['README', 'TODO']
 CONFIG_FILES = ['etc/lfm-default.keys', 'etc/lfm-default.theme']
 MAN_FILES = ['lfm.1']
 
@@ -71,8 +71,8 @@
           license='GPL3+',
           packages=['lfm'],
           scripts=['lfm/lfm'],
-          data_files=[(join(prefix, 'share/man/man1'), MAN_FILES)],
-          package_data={'': CONFIG_FILES + [join('doc', f) for f in DOC_FILES]},
+          data_files=[(join(prefix, 'share/man/man1'), MAN_FILES), (join(prefix, 'share/doc/lfm'), DOC_FILES)],
+          package_data={'': CONFIG_FILES },
     )
 finally:
     shutil.rmtree('lfm/doc')
--- a/lfm/actions.py
+++ b/lfm/actions.py
@@ -13,7 +13,7 @@
                        DialogEntry, DialogDoubleEntry, DialogFindGrep, TreeView, \
                        DialogPerms, DialogOwner, InternalView
 from common import *
-
+import gzip
 
 ########################################################################
 ##### Module variables
@@ -1099,7 +1099,6 @@
     menu = ['r    Readme',
             'n    News',
             't    Todo',
-            'l    License',
             'k    Key bindings']
     ret = SelectItem('Help Menu', menu, min_height=True).run()
     if ret != -1:
@@ -1109,10 +1108,13 @@
             filename = DUMP_KEYS_FILE
             utils.run_on_current_file(app.cfg.programs['pager'], filename)
         else:
-            docfile = {'r': 'README', 'n': 'NEWS', 't': 'TODO', 'l': 'COPYING'}.get(ret[0])
+            docfile = {'r': 'README', 'n': 'changelog', 't': 'TODO'}.get(ret[0])
             try:
-                filename = pkg_resources.resource_filename('lfm', 'doc/' + docfile)
-                utils.run_on_current_file(app.cfg.programs['pager'], filename)
+                filename = '/usr/share/doc/lfm/' + docfile + '.gz'
+                with gzip.open(filename, 'r') as f:
+                  file_content = f.read().decode("utf-8")
+                f.close()
+                InternalView(docfile, [(l, 'view_white_on_black') for l in file_content.splitlines()], center=False).run()
             except NotImplementedError:
                 buf = str(pkg_resources.resource_string('lfm', 'doc/' + docfile), 'UTF-8')
                 InternalView(docfile, [(l, 'view_white_on_black') for l in buf.splitlines()], center=False).run()
