Skip to contentSkip to conversation

package/system-config-printer: new package

PATCH In review James Hilliard 2 participants 3 messages Jul 31, 2021 – Aug 1, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 package/system-config-printer: new package

This package has some udev tools to assist with printer autodetection.

---
Changes v2 -> v3:
- add autoreconf
- add host-intltool for autoreconf

Changes v1 -> v2:
- update patch to merged upstream version

---
 package/Config.in                             |  1 +
 ...n-to-disable-xmlto-manual-generation.patch | 73 +++++++++++++++++++
 package/system-config-printer/Config.in       |  7 ++
 .../system-config-printer.hash                |  3 +
 .../system-config-printer.mk                  | 33 +++++++++
 5 files changed, 117 insertions(+)
 create mode 100644 package/system-config-printer/0001-Add-option-to-disable-xmlto-manual-generation.patch
 create mode 100644 package/system-config-printer/Config.in
 create mode 100644 package/system-config-printer/system-config-printer.hash
 create mode 100644 package/system-config-printer/system-config-printer.mk
package/Config.in +1 -0
index 5941e35c05..fa916370f0 100644
@@ -2120,6 +2120,7 @@ menu "Networking applications"
 	source "package/ctorrent/Config.in"
 	source "package/cups/Config.in"
 	source "package/cups-filters/Config.in"
+	source "package/system-config-printer/Config.in"
 	source "package/dante/Config.in"
 	source "package/darkhttpd/Config.in"
 	source "package/dehydrated/Config.in"
package/system-config-printer/0001-Add-option-to-disable-xmlto-manual-generation.patch new file +73 -0

73 lines not on this page · raw message

package/system-config-printer/Config.in new file +7 -0
new file mode 100644
index 0000000000..8ebc4d060c
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_SYSTEM_CONFIG_PRINTER
+	bool "system-config-printer"
+	depends on BR2_PACKAGE_CUPS
+	help
+	  Graphical user interface for CUPS administration
+
+	  https://github.com/OpenPrinting/system-config-printer
package/system-config-printer/system-config-printer.hash new file +3 -0
new file mode 100644
index 0000000000..56b7e47650
@@ -0,0 +1,3 @@
+# Locally calculated:
+sha256  fbd226ce215bf014213dded81b43b9d4d90470524f5bf7cd21ecc71d4aefa689  system-config-printer-1.5.15.tar.xz
+sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
package/system-config-printer/system-config-printer.mk new file +33 -0
new file mode 100644
index 0000000000..05dd2f5b46
@@ -0,0 +1,33 @@
+################################################################################
+#
+# system-config-printer
+#
+################################################################################
+
+SYSTEM_CONFIG_PRINTER_VERSION = 1.5.15
+SYSTEM_CONFIG_PRINTER_SOURCE = system-config-printer-$(SYSTEM_CONFIG_PRINTER_VERSION).tar.xz
+SYSTEM_CONFIG_PRINTER_SITE = https://github.com/OpenPrinting/system-config-printer/releases/download/v$(SYSTEM_CONFIG_PRINTER_VERSION)
+SYSTEM_CONFIG_PRINTER_LICENSE = GPL-2.0
+SYSTEM_CONFIG_PRINTER_LICENSE_FILES = COPYING
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES = cups host-intltool
+SYSTEM_CONFIG_PRINTER_AUTORECONF = YES
+
+ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES += libglib2
+endif
+
+ifeq ($(BR2_PACKAGE_LIBGLIB2)$(BR2_PACKAGE_LIBUSB)$(BR2_PACKAGE_HAS_UDEV),yyy)
+SYSTEM_CONFIG_PRINTER_CONF_OPTS = --with-udev-rules=yes
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES += libusb udev
+else
+SYSTEM_CONFIG_PRINTER_CONF_OPTS = --with-udev-rules=no
+endif
+
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+SYSTEM_CONFIG_PRINTER_CONF_OPTS += --with-systemdsystemunitdir=/usr/lib/systemd/system
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES += systemd
+else
+SYSTEM_CONFIG_PRINTER_CONF_OPTS += --with-systemdsystemunitdir=no
+endif
+
+$(eval $(autotools-package))
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#1 lore raw

James, All,

On 2021-07-31 16:27 -0600, James Hilliard spake thusly:

Quoted 1 line

This package has some udev tools to assist with printer autodetection.

Sorry, but this is still not enough:

    $ make check-package
    package/Config.in:2123: Packages in: menu "Networking applications",
                            are not alphabetically ordered;
                            correct order: '-', '_', digits, capitals, lowercase;
                            first incorrect package: dante

Also:

    $ make system-config-printer-configure
    [...]
    ./configure: line 7043: cups-config: command not found
    [...]

This is needed to set the path to the CUPS server executable (I guess):

    $ cat -n configure.ac
    [...]
       36 cupsserverbindir="`cups-config --serverbin`"
       37 AC_SUBST(cupsserverbindir)
    [...]

And thus:

    $ grep cupsserverbin config.status
    S["cupsserverbindir"]=""

which is later used to locate the CUPS filters:

    $ grep -nr cupsserverbindir .
    ./cupshelpers/cupshelpers.py:873: [...] config.cupsserverbindir + "/filter:"
    ./cupshelpers/cupshelpers.py:876: [...] add_missing (config.cupsserverbindir + "/filter/" + exe)
    ./cupshelpers/config.py.in:24:cupsserverbindir="@cupsserverbindir@"

So, maybe you have a cups-config in your PATH already, and that happens to provide the correct setting...

[--SNIP--]

package/Config.in menu "Networking applications" · line 2123

Quoted 9 lines
package/Config.in +1 -0
index 5941e35c05..fa916370f0 100644
@@ -2120,6 +2120,7 @@ menu "Networking applications"
 	source "package/ctorrent/Config.in"
 	source "package/cups/Config.in"
 	source "package/cups-filters/Config.in"
+	source "package/system-config-printer/Config.in"

Alphabetical order, please. Reported by: make check-package

[--SNIP--]

Quoted 6 lines
package/system-config-printer/system-config-printer.mk new file +0 -0
new file mode 100644
index 0000000000..05dd2f5b46

package/system-config-printer/system-config-printer.mk line 10

Quoted 10 lines
package/system-config-printer/system-config-printer.mk new file +10 -0
@@ -0,0 +1,33 @@
+################################################################################
+#
+# system-config-printer
+#
+################################################################################
+
+SYSTEM_CONFIG_PRINTER_VERSION = 1.5.15
+SYSTEM_CONFIG_PRINTER_SOURCE = system-config-printer-$(SYSTEM_CONFIG_PRINTER_VERSION).tar.xz
+SYSTEM_CONFIG_PRINTER_SITE = https://github.com/OpenPrinting/system-config-printer/releases/download/v$(SYSTEM_CONFIG_PRINTER_VERSION)
+SYSTEM_CONFIG_PRINTER_LICENSE = GPL-2.0

It really seems to be GPL-2.0-or-later, as specified in many files:

In check-device-ids.py:

## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version.

At a cursory glance, I could not spot a file that was GPL-2.0-only...

package/system-config-printer/system-config-printer.mk line 12

Quoted 2 lines
package/system-config-printer/system-config-printer.mk new file +2 -0
+SYSTEM_CONFIG_PRINTER_LICENSE_FILES = COPYING
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES = cups host-intltool

configure.ac also uses PKG_CHECK_MODULES(), so it needs to depend on host-pkgconf.

package/system-config-printer/system-config-printer.mk line 13

Quoted 1 line
package/system-config-printer/system-config-printer.mk new file +1 -0
+SYSTEM_CONFIG_PRINTER_AUTORECONF = YES

This needs an explanation why autoreconf is needed. We usually just name the patch that touches it:

# 0001-Add-option-to-disable-xmlto-manual-generation.patch SYSTEM_CONFIG_PRINTER_AUTORECONF = YES

(but I had to add another patch, so I've also listed it).

package/system-config-printer/system-config-printer.mk line 20

Quoted 7 lines
package/system-config-printer/system-config-printer.mk new file +7 -0
+
+ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES += libglib2
+endif
+
+ifeq ($(BR2_PACKAGE_LIBGLIB2)$(BR2_PACKAGE_LIBUSB)$(BR2_PACKAGE_HAS_UDEV),yyy)
+SYSTEM_CONFIG_PRINTER_CONF_OPTS = --with-udev-rules=yes

In conditional blocks, always use append-assignement:

    SYSTEM_CONFIG_PRINTER_CONF_OPTS += --with-udev-rules=yes

This caused issues as I had to add this, earlier on the file:

    SYSTEM_CONFIG_PRINTER_CONF_OPTS = --with-cups-config=...

And I add to add the asociated patch that adds --with-cups-config.

With all those changes: applied to master, thanks. Please review what I did in case I really borked something...

Also, could you push that new patch 0002-configure-accept-non-system-cups-config.patch I added, to upstream, please?

Regards,
Yann E. MORIN.

Quoted 20 lines
package/system-config-printer/system-config-printer.mk new file +13 -0
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES += libusb udev
+else
+SYSTEM_CONFIG_PRINTER_CONF_OPTS = --with-udev-rules=no
+endif
+
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+SYSTEM_CONFIG_PRINTER_CONF_OPTS += --with-systemdsystemunitdir=/usr/lib/systemd/system
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES += systemd
+else
+SYSTEM_CONFIG_PRINTER_CONF_OPTS += --with-systemdsystemunitdir=no
+endif
+
+$(eval $(autotools-package))
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#2 lore raw
Quoted 118 lines · Yann E. MORIN

James, All,

On 2021-07-31 16:27 -0600, James Hilliard spake thusly:

Quoted 1 line

This package has some udev tools to assist with printer autodetection.

Sorry, but this is still not enough:

    $ make check-package
    package/Config.in:2123: Packages in: menu "Networking applications",
                            are not alphabetically ordered;
                            correct order: '-', '_', digits, capitals, lowercase;
                            first incorrect package: dante

Also:

    $ make system-config-printer-configure
    [...]
    ./configure: line 7043: cups-config: command not found
    [...]

This is needed to set the path to the CUPS server executable (I guess):

    $ cat -n configure.ac
    [...]
       36 cupsserverbindir="`cups-config --serverbin`"
       37 AC_SUBST(cupsserverbindir)
    [...]

And thus:

    $ grep cupsserverbin config.status
    S["cupsserverbindir"]=""

which is later used to locate the CUPS filters:

    $ grep -nr cupsserverbindir .
    ./cupshelpers/cupshelpers.py:873: [...] config.cupsserverbindir + "/filter:"
    ./cupshelpers/cupshelpers.py:876: [...] add_missing (config.cupsserverbindir + "/filter/" + exe)
    ./cupshelpers/config.py.in:24:cupsserverbindir="@cupsserverbindir@"

So, maybe you have a cups-config in your PATH already, and that happens to provide the correct setting...

[--SNIP--]

package/Config.in menu "Networking applications" · line 2123

Quoted 9 lines
package/Config.in +1 -0
index 5941e35c05..fa916370f0 100644
@@ -2120,6 +2120,7 @@ menu "Networking applications"
      source "package/ctorrent/Config.in"
      source "package/cups/Config.in"
      source "package/cups-filters/Config.in"
+     source "package/system-config-printer/Config.in"

Alphabetical order, please. Reported by: make check-package

[--SNIP--]

Quoted 6 lines
package/system-config-printer/system-config-printer.mk new file +0 -0
new file mode 100644
index 0000000000..05dd2f5b46

package/system-config-printer/system-config-printer.mk line 10

Quoted 10 lines
package/system-config-printer/system-config-printer.mk new file +10 -0
@@ -0,0 +1,33 @@
+################################################################################
+#
+# system-config-printer
+#
+################################################################################
+
+SYSTEM_CONFIG_PRINTER_VERSION = 1.5.15
+SYSTEM_CONFIG_PRINTER_SOURCE = system-config-printer-$(SYSTEM_CONFIG_PRINTER_VERSION).tar.xz
+SYSTEM_CONFIG_PRINTER_SITE = https://github.com/OpenPrinting/system-config-printer/releases/download/v$(SYSTEM_CONFIG_PRINTER_VERSION)
+SYSTEM_CONFIG_PRINTER_LICENSE = GPL-2.0

It really seems to be GPL-2.0-or-later, as specified in many files:

In check-device-ids.py:

## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version.

At a cursory glance, I could not spot a file that was GPL-2.0-only...

package/system-config-printer/system-config-printer.mk line 12

Quoted 2 lines
package/system-config-printer/system-config-printer.mk new file +2 -0
+SYSTEM_CONFIG_PRINTER_LICENSE_FILES = COPYING
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES = cups host-intltool

configure.ac also uses PKG_CHECK_MODULES(), so it needs to depend on host-pkgconf.

package/system-config-printer/system-config-printer.mk line 13

Quoted 1 line
package/system-config-printer/system-config-printer.mk new file +1 -0
+SYSTEM_CONFIG_PRINTER_AUTORECONF = YES

This needs an explanation why autoreconf is needed. We usually just name the patch that touches it:

# 0001-Add-option-to-disable-xmlto-manual-generation.patch SYSTEM_CONFIG_PRINTER_AUTORECONF = YES

(but I had to add another patch, so I've also listed it).

package/system-config-printer/system-config-printer.mk line 20

Quoted 7 lines
package/system-config-printer/system-config-printer.mk new file +7 -0
+
+ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES += libglib2
+endif
+
+ifeq ($(BR2_PACKAGE_LIBGLIB2)$(BR2_PACKAGE_LIBUSB)$(BR2_PACKAGE_HAS_UDEV),yyy)
+SYSTEM_CONFIG_PRINTER_CONF_OPTS = --with-udev-rules=yes

In conditional blocks, always use append-assignement:

    SYSTEM_CONFIG_PRINTER_CONF_OPTS += --with-udev-rules=yes

This caused issues as I had to add this, earlier on the file:

    SYSTEM_CONFIG_PRINTER_CONF_OPTS = --with-cups-config=...
Quoted 7 lines

And I add to add the asociated patch that adds --with-cups-config.

With all those changes: applied to master, thanks. Please review what I did in case I really borked something...

Also, could you push that new patch 0002-configure-accept-non-system-cups-config.patch I added, to upstream, please?

Pull request opened:
https://github.com/OpenPrinting/system-config-printer/pull/234

Quoted 27 lines

Regards,
Yann E. MORIN.

Quoted 16 lines
package/system-config-printer/system-config-printer.mk new file +13 -1
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES += libusb udev
+else
+SYSTEM_CONFIG_PRINTER_CONF_OPTS = --with-udev-rules=no
+endif
+
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+SYSTEM_CONFIG_PRINTER_CONF_OPTS += --with-systemdsystemunitdir=/usr/lib/systemd/system
+SYSTEM_CONFIG_PRINTER_DEPENDENCIES += systemd
+else
+SYSTEM_CONFIG_PRINTER_CONF_OPTS += --with-systemdsystemunitdir=no
+endif
+
+$(eval $(autotools-package))
--

2.25.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

Quoted 5 lines
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot