notepadqq / notepadqq-packaging

Packaging scripts and files for Notepadqq
MIT License
21 stars 12 forks source link

Ubuntu: Lintian warnings for notepadqq-common package #50

Closed darealshinji closed 9 years ago

darealshinji commented 9 years ago

I get Lintian warnings for the notepadqq-common package:

djcj: ~/Downloads $ lintian notepadqq-common_0.50.1-0~vivid1_all.deb 
W: notepadqq-common: embedded-javascript-library usr/share/notepadqq/extension_tools/node_modules/archiver/node_modules/async/lib/async.js please use libjs-async
W: notepadqq-common: extra-license-file usr/share/notepadqq/extension_tools/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/LICENCE
W: notepadqq-common: unusual-interpreter usr/share/notepadqq/extension_tools/node_modules/archiver/node_modules/async/support/sync-package-managers.js #!node
W: notepadqq-common: script-not-executable usr/share/notepadqq/extension_tools/node_modules/archiver/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh
W: notepadqq-common: script-not-executable usr/share/notepadqq/extension_tools/node_modules/archiver/node_modules/tar-stream/node_modules/bl/test/sauce.js
W: notepadqq-common: unusual-interpreter usr/share/notepadqq/extension_tools/node_modules/archiver/node_modules/tar-stream/node_modules/bl/test/sauce.js #!node
W: notepadqq-common: unusual-interpreter usr/share/notepadqq/extension_tools/node_modules/shelljs/bin/shjs #!node
W: notepadqq-common: unusual-interpreter usr/share/notepadqq/extension_tools/node_modules/shelljs/scripts/generate-docs.js #!node
W: notepadqq-common: unusual-interpreter usr/share/notepadqq/extension_tools/node_modules/shelljs/scripts/run-tests.js #!node
N: 1 tag overridden (1 warning)

I assume these files can be removed from usr/share/notepadqq/extension_tools:

node_modules/archiver/node_modules/tar-stream/node_modules/xtend/LICENCE
node_modules/archiver/node_modules/async/support
node_modules/shelljs/scripts
node_modules/archiver/node_modules/lazystream/test
node_modules/archiver/node_modules/glob/node_modules/once/node_modules/wrappy/test
node_modules/archiver/node_modules/glob/node_modules/once/test
node_modules/archiver/node_modules/glob/node_modules/inflight/node_modules/wrappy/test
node_modules/archiver/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test
node_modules/archiver/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test
node_modules/archiver/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test
node_modules/archiver/node_modules/buffer-crc32/tests
node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/node_modules/wrappy/test
node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/test
node_modules/archiver/node_modules/tar-stream/node_modules/bl/test

And I guess these can be overridden:

W: notepadqq-common: embedded-javascript-library usr/share/notepadqq/extension_tools/node_modules/archiver/node_modules/async/lib/async.js please use libjs-async
W: notepadqq-common: unusual-interpreter usr/share/notepadqq/extension_tools/node_modules/shelljs/bin/shjs #!node
darealshinji commented 9 years ago

Here's a proposed fix.

diff --git a/Debian/debian/notepadqq-common.lintian-overrides b/Debian/debian/notepadqq-common.lintian-overrides
index e2e475b..916d5bf 100644
--- a/Debian/debian/notepadqq-common.lintian-overrides
+++ b/Debian/debian/notepadqq-common.lintian-overrides
@@ -1,3 +1,7 @@
-# jquery in the repositories is outdated
+# we use newer versions than those in the repositories
 notepadqq-common binary: embedded-javascript-library usr/share/notepadqq/editor/libs/jquery/jquery.min.js*
+notepadqq-common binary: embedded-javascript-library usr/share/notepadqq/extension_tools/node_modules/archiver/node_modules/async/lib/async.js*
+
+# unusual, but required
+notepadqq-common binary: unusual-interpreter usr/share/notepadqq/extension_tools/node_modules/shelljs/bin/shjs #!node

diff --git a/Debian/debian/rules b/Debian/debian/rules
index 7860301..7c4f7e1 100755
--- a/Debian/debian/rules
+++ b/Debian/debian/rules
@@ -3,6 +3,8 @@
 export LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed
 export QT_SELECT=qt5

+EXTDIR=debian/tmp/usr/share/notepadqq/extension_tools/node_modules
+

 %:
    dh ${@} --parallel
@@ -12,9 +14,11 @@ override_dh_auto_clean:
    rm -rf out

 override_dh_install:
-   dh_install -XLICENSE -XAUTHORS -X.md
+   rm -rf `find $(EXTDIR) -type d -name test*` \
+       $(EXTDIR)/archiver/node_modules/async/support $(EXTDIR)/shelljs/scripts
+   dh_install -XLICENSE -XLICENCE -XAUTHORS -X.md
    install -m755 debian/tmp/usr/bin/notepadqq \
-   $(CURDIR)/debian/notepadqq/usr/lib/notepadqq/notepadqq.sh
+       $(CURDIR)/debian/notepadqq/usr/lib/notepadqq/notepadqq.sh

 override_dh_installdocs:
    dh_installdocs --link-doc=notepadqq-common
danieleds commented 9 years ago

Nice catch! I'll take care of it as soon as the next version comes out.