Source: usbview
Version: 2.0-21-g6fe2f4f-2
Severity: wishlist
Tags: patch

Hi,

the current debian directory ships some file that shadows files provided
by upstream (e.g. the desktop file and the icons), and ships some files
that are not needed. Hence, the provided patch simplify things a bit:
- drop our own icons, as upstream now installs all the XDG icon themes
  icons properly (PNG and SVG)
- drop the old Debian menu file, as a desktop file is provided, so by
  Policy the menu file ought to not be shipped; furthermore, the old
  menu system has been deprecated for 6 years
- use su-to-root in the desktop file as a patch rather than using a copy
  of it: this reduces the maintenance cost, and it clearly separates
  the changes applied to it
- use a debian/upstream/metadata file to reference the upstream Git
  repository, according to DEP 12 (replacing the X- field)

The debdiff between a rebuild of 2.0-21-g6fe2f4f-2 and the provided
2.0-21-g6fe2f4f-3 is the following:

Files in first .deb but not in second
-------------------------------------
-rw-r--r--  root/root   /usr/share/icons/hicolor/32x32/apps/usbview.xpm
-rw-r--r--  root/root   /usr/share/menu/usbview
-rwxr-xr-x  root/root   DEBIAN/postinst
-rwxr-xr-x  root/root   DEBIAN/postrm

Control files: lines which differ (wdiff format)
------------------------------------------------
Installed-Size: [-1201-] {+1191+}
Version: [-2.0-21-g6fe2f4f-2-] {+2.0-21-g6fe2f4f-3+}

Which is expected, as the XPM icon and the old Debian menu are to not
be shipped anymore.

Of course, I'm available to edit any part of it -- I personally see
these changes as improvement and cleanups.

Thanks,
-- 
Pino
diff -Nru usbview-2.0-21-g6fe2f4f/debian/changelog 
usbview-2.0-21-g6fe2f4f/debian/changelog
--- usbview-2.0-21-g6fe2f4f/debian/changelog    2018-06-04 11:52:41.000000000 
+0200
+++ usbview-2.0-21-g6fe2f4f/debian/changelog    2021-04-17 10:41:34.000000000 
+0200
@@ -1,3 +1,19 @@
+usbview (2.0-21-g6fe2f4f-3) UNRELEASED; urgency=medium
+
+  [ Pino Toscano ]
+  * Drop debian/usbview.manpages, as upstream already installs the man page.
+  * Drop menu file, as usbview already provides a .desktop file.
+  * Drop our own copy of usbview.svg, as it is provided by upstream already.
+  * Stop manually convering icons, as upstream already installs all the needed
+    hicolor icons.
+  * Make the usage of su-to-root for the desktop file as patch to the desktop
+    file provided by upstream, rather than as fork of that file; this way,
+    there is no need to maintain it.
+  * Create a debian/upstream/metadata with references to the upstream Git
+    repository, removing the X-Vcs-Upstream-Git field from debian/control.
+
+ -- Mark Brown <broo...@debian.org>  Sat, 17 Apr 2021 10:41:34 +0200
+
 usbview (2.0-21-g6fe2f4f-2) unstable; urgency=low
 
    * Add build dependency on librsvg2-bin since the imagemagick
diff -Nru usbview-2.0-21-g6fe2f4f/debian/clean 
usbview-2.0-21-g6fe2f4f/debian/clean
--- usbview-2.0-21-g6fe2f4f/debian/clean        2017-02-04 12:24:38.000000000 
+0100
+++ usbview-2.0-21-g6fe2f4f/debian/clean        1970-01-01 01:00:00.000000000 
+0100
@@ -1 +0,0 @@
-debian/icons/*/*
diff -Nru usbview-2.0-21-g6fe2f4f/debian/control 
usbview-2.0-21-g6fe2f4f/debian/control
--- usbview-2.0-21-g6fe2f4f/debian/control      2018-06-04 11:52:41.000000000 
+0200
+++ usbview-2.0-21-g6fe2f4f/debian/control      2021-04-17 10:41:34.000000000 
+0200
@@ -6,7 +6,6 @@
 Homepage: http://www.kroah.com/linux-usb/
 Build-Depends: debhelper (>= 9), dh-autoreconf, autoconf-archive,
   imagemagick, libmagickcore-6.q16-2-extra, libgtk-3-dev, librsvg2-bin
-X-Vcs-Upstream-Git: git://github.com/gregkh/usbview.git
 
 Package: usbview
 Architecture: any
diff -Nru usbview-2.0-21-g6fe2f4f/debian/patches/desktop-use-su-to-exec.diff 
usbview-2.0-21-g6fe2f4f/debian/patches/desktop-use-su-to-exec.diff
--- usbview-2.0-21-g6fe2f4f/debian/patches/desktop-use-su-to-exec.diff  
1970-01-01 01:00:00.000000000 +0100
+++ usbview-2.0-21-g6fe2f4f/debian/patches/desktop-use-su-to-exec.diff  
2021-04-17 10:41:34.000000000 +0200
@@ -0,0 +1,15 @@
+Author: Mark Brown <broo...@debian.org>
+Description: Make desktop entry use su-wrapper.
+Last-Update: 2015-04-25
+
+--- a/usbview.desktop
++++ b/usbview.desktop
+@@ -2,7 +2,7 @@
+ Name=USBView
+ GenericName=USB Device Viewer
+ Comment=View USB devices attached to system
+-Exec=pkexec /usr/bin/usbview
++Exec=su-to-root -X -c /usr/bin/usbview
+ Icon=usbview
+ Terminal=false
+ Type=Application
diff -Nru usbview-2.0-21-g6fe2f4f/debian/patches/series 
usbview-2.0-21-g6fe2f4f/debian/patches/series
--- usbview-2.0-21-g6fe2f4f/debian/patches/series       1970-01-01 
01:00:00.000000000 +0100
+++ usbview-2.0-21-g6fe2f4f/debian/patches/series       2021-04-17 
10:41:34.000000000 +0200
@@ -0,0 +1 @@
+desktop-use-su-to-exec.diff
diff -Nru usbview-2.0-21-g6fe2f4f/debian/rules 
usbview-2.0-21-g6fe2f4f/debian/rules
--- usbview-2.0-21-g6fe2f4f/debian/rules        2017-02-04 12:24:38.000000000 
+0100
+++ usbview-2.0-21-g6fe2f4f/debian/rules        2021-04-17 10:41:34.000000000 
+0200
@@ -2,12 +2,3 @@
 
 %:
        dh $@ --with autoreconf --parallel
-
-bitmaps=debian/icons/32x32/usbview.xpm debian/icons/64x64/usbview.png
-
-override_dh_install: $(bitmaps)
-       dh_install
-
-$(bitmaps): debian/usbview.svg
-       mkdir -p $$(dirname $@)
-       convert -geometry $$(basename $$(dirname $@)) $< $@
diff -Nru usbview-2.0-21-g6fe2f4f/debian/upstream/metadata 
usbview-2.0-21-g6fe2f4f/debian/upstream/metadata
--- usbview-2.0-21-g6fe2f4f/debian/upstream/metadata    1970-01-01 
01:00:00.000000000 +0100
+++ usbview-2.0-21-g6fe2f4f/debian/upstream/metadata    2021-04-17 
10:41:34.000000000 +0200
@@ -0,0 +1,2 @@
+Repository: https://github.com/gregkh/usbview.git
+Repository-Browse: https://github.com/gregkh/usbview/
diff -Nru usbview-2.0-21-g6fe2f4f/debian/usbview.desktop 
usbview-2.0-21-g6fe2f4f/debian/usbview.desktop
--- usbview-2.0-21-g6fe2f4f/debian/usbview.desktop      2017-02-04 
12:24:38.000000000 +0100
+++ usbview-2.0-21-g6fe2f4f/debian/usbview.desktop      1970-01-01 
01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-[Desktop Entry]
-Name=USBView
-Comment=View USB devices attached to system
-Exec=su-to-root -X -c /usr/bin/usbview
-Icon=usbview
-Terminal=false
-Type=Application
-Keywords=USB;devices;connected;removable;
-Categories=GTK;HardwareSettings;Settings;
diff -Nru usbview-2.0-21-g6fe2f4f/debian/usbview.install 
usbview-2.0-21-g6fe2f4f/debian/usbview.install
--- usbview-2.0-21-g6fe2f4f/debian/usbview.install      2017-02-04 
12:24:38.000000000 +0100
+++ usbview-2.0-21-g6fe2f4f/debian/usbview.install      1970-01-01 
01:00:00.000000000 +0100
@@ -1,4 +0,0 @@
-debian/usbview.desktop /usr/share/applications/
-debian/icons/32x32/usbview.xpm /usr/share/icons/hicolor/32x32/apps/
-debian/icons/64x64/usbview.png /usr/share/icons/hicolor/64x64/apps/
-debian/usbview.svg /usr/share/icons/hicolor/scalable/apps/
diff -Nru usbview-2.0-21-g6fe2f4f/debian/usbview.manpages 
usbview-2.0-21-g6fe2f4f/debian/usbview.manpages
--- usbview-2.0-21-g6fe2f4f/debian/usbview.manpages     2017-02-04 
12:24:38.000000000 +0100
+++ usbview-2.0-21-g6fe2f4f/debian/usbview.manpages     1970-01-01 
01:00:00.000000000 +0100
@@ -1 +0,0 @@
-usbview.8
diff -Nru usbview-2.0-21-g6fe2f4f/debian/usbview.menu 
usbview-2.0-21-g6fe2f4f/debian/usbview.menu
--- usbview-2.0-21-g6fe2f4f/debian/usbview.menu 2017-02-04 12:24:38.000000000 
+0100
+++ usbview-2.0-21-g6fe2f4f/debian/usbview.menu 1970-01-01 01:00:00.000000000 
+0100
@@ -1,3 +0,0 @@
-?package(usbview):needs="X11" section="Applications/System/Hardware" \
-  title="USB View" command="su-to-root -X -c /usr/bin/usbview" \
-  icon="/usr/share/icons/hicolor/32x32/apps/usbview.xpm"
diff -Nru usbview-2.0-21-g6fe2f4f/debian/usbview.svg 
usbview-2.0-21-g6fe2f4f/debian/usbview.svg
--- usbview-2.0-21-g6fe2f4f/debian/usbview.svg  2017-02-04 12:24:38.000000000 
+0100
+++ usbview-2.0-21-g6fe2f4f/debian/usbview.svg  1970-01-01 01:00:00.000000000 
+0100
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/";
-   xmlns:cc="http://creativecommons.org/ns#";
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
-   xmlns:svg="http://www.w3.org/2000/svg";
-   xmlns="http://www.w3.org/2000/svg";
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
-   width="64px"
-   height="64px"
-   id="svg2985"
-   version="1.1"
-   inkscape:version="0.48.5 r10040"
-   sodipodi:docname="New document 2">
-  <defs
-     id="defs2987" />
-  <sodipodi:namedview
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1.0"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="7.1276363"
-     inkscape:cx="8.9147202"
-     inkscape:cy="26.700074"
-     inkscape:current-layer="layer1"
-     showgrid="true"
-     inkscape:document-units="px"
-     inkscape:grid-bbox="true"
-     inkscape:snap-global="false"
-     inkscape:window-width="1600"
-     inkscape:window-height="834"
-     inkscape:window-x="0"
-     inkscape:window-y="27"
-     inkscape:window-maximized="1" />
-  <metadata
-     id="metadata2990">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
-        <dc:title></dc:title>
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <g
-     id="layer1"
-     inkscape:label="Layer 1"
-     inkscape:groupmode="layer">
-    <rect
-       
style="fill:#67bfef;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.95700002;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-       id="rect3111"
-       width="62.055035"
-       height="62.055035"
-       x="1.1009438"
-       y="1.124616"
-       ry="12.767206" />
-    <path
-       id="path1334"
-       d="m 59.757253,31.012666 -6.076826,-3.509323 0,2.50338 -31.060353,0 
6.047801,-6.389553 c 0.514692,-0.412553 1.188114,-0.701962 1.880845,-0.717993 
2.802382,0 4.466566,-7.28e-4 5.079145,-0.0019 0.415225,1.183011 
1.530592,2.036904 2.856546,2.036904 1.677422,0 3.038717,-1.361174 
3.038717,-3.039203 0,-1.678759 -1.361174,-3.039447 -3.038717,-3.039447 
-1.325954,0 -2.441321,0.853407 -2.856546,2.035447 l -5.019635,-8.51e-4 c 
-1.360447,0 -2.785988,0.746412 -3.693316,1.621436 0.02478,-0.02599 
0.05052,-0.05368 -0.0014,4.86e-4 -0.01919,0.02162 -6.416513,6.778424 
-6.416513,6.778424 -0.513597,0.411947 -1.186655,0.699533 -1.878901,0.716051 l 
-3.513696,0 c -0.465749,-2.321211 -2.515525,-4.070043 -4.974335,-4.070043 
-2.8033537,0 -5.0757426,2.272388 -5.0757426,5.074892 0,2.803354 
2.2723889,5.075864 5.0757426,5.075864 2.459296,0 4.509072,-1.750289 
4.97482,-4.073443 l 3.452123,0 c 0.0089,0 0.01773,4.85e-4 0.02672,0 l 
7.635474,0 c 0.69091,0.01761 1.363117,0.30556 1.87623,0.717993 0,0 
6.395868,6.756321 6.415664,6.778182 0.05125,0.05429 0.02575,0.02599 
4.85e-4,4.85e-4 0.907329,0.874902 2.333477,1.620827 3.694166,1.620827 l 
4.837463,-0.0011 0,2.03751 6.078407,0 0,-6.077797 -6.078407,0 0,2.034839 c 0,0 
-1.274098,-0.0023 -4.896729,-0.0023 -0.692854,-0.01591 -1.367005,-0.304953 
-1.881452,-0.717507 l -6.049142,-6.390725 23.464591,0 0,2.507388 
6.076827,-3.508837 z"
-       inkscape:connector-curvature="0"
-       style="fill:#ffffff;fill-opacity:1" />
-  </g>
-</svg>

Reply via email to