Bug 271226 - [NEW PORT] print/ipp-usb: IPP-over-USB printer support
Summary: [NEW PORT] print/ipp-usb: IPP-over-USB printer support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Robert Clausecker
URL: https://github.com/OpenPrinting/ipp-usb
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-03 13:49 UTC by chuanwei.foo
Modified: 2023-05-11 23:29 UTC (History)
2 users (show)

See Also:


Attachments
ipp-usb.patch (4.97 KB, patch)
2023-05-03 13:49 UTC, chuanwei.foo
no flags Details | Diff
ipp-usb.patch (v2) (5.02 KB, patch)
2023-05-04 14:20 UTC, chuanwei.foo
chuanwei.foo: maintainer-approval+
Details | Diff
ipp-usb.patch (v3) (4.98 KB, patch)
2023-05-11 08:00 UTC, chuanwei.foo
chuanwei.foo: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chuanwei.foo 2023-05-03 13:49:15 UTC
Created attachment 241953 [details]
ipp-usb.patch

Add support for printing and scanning via IPP-over-USB.
With this port, FreeBSD will have support for most printer models sold today.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2023-05-03 18:41:22 UTC
Super cool!  I like it!

Here are some things to check:

 - please set MAINTAINER, preferably to your own email address
 - you forgot to install the ipp-usb rc.d script
 - the order of variables is incorrect, please check with portlint or use
   portfmt to format your port
 - your patch file is lacking a time stamp.  Use make makepatch to regenerate
   it in the correct format

Please check and resubmit as needed.
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2023-05-03 18:41:53 UTC
Also, please make sure to set the "maintainer-approval" flag on patches you submit.  This makes it so that they are more likely to be looked at.
Comment 3 chuanwei.foo 2023-05-04 14:20:37 UTC
Created attachment 241970 [details]
ipp-usb.patch (v2)

Edited the patch as requested by comment #1.

>you forgot to install the ipp-usb rc.d script

Isn't print/ipp-usb/files/ipp-usb.in automatically installed as /usr/local/etc/rc.d/ipp-usb?
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2023-05-04 14:52:33 UTC
Thank you for the update.

> Isn't print/ipp-usb/files/ipp-usb.in automatically installed as /usr/local/etc/rc.d/ipp-usb?


The .in mechanism merely means that %%...%% placeholders get substituted automatically, producing a substituted file in ${WRKDIR}.  It's the job of the Makefile to install it into the right place.

However, USE_RC_SUBR is what takes care of having the file install.  I now also found the actual error: USE_RC_SUBR automatically adds the rc.d script to the plist.  If you have listed it manually, too, the plist has a duplicate entry leading to the error I observed.

I'll fix this on commit.

I've also seen that you have set MAINTAINER to ports@FreeBSD.org.  This indicates "no maintainer."  As per policy, we do not accept ports if the submitter doesn't also accept to maintain this port.  Please let me know if you wish to maintain the port, in which case I can commit it with

    MAINTAINER= chuanwei.foo@hotmail.com
Comment 5 chuanwei.foo 2023-05-05 06:15:43 UTC
Additional issues:

* I noticed that "%%DBUS_DAEMON%%" and "%%AVAHI_DAEMON%%" are not expanded. By default, ipp-usb expects a running Avahi daemon, but ipp-usb will still work without Avahi if one's printer setup does not require DNS-SD. Should the ipp-usb port depend on the avahi port?

* Should I patch the ipp-usb.8 man page? e.g. replace "/etc/ipp-usb" with "/usr/local/etc/ipp-usb".
Comment 6 Robert Clausecker freebsd_committer freebsd_triage 2023-05-05 09:31:16 UTC
(In reply to chuanwei.foo from comment #5)

Hi,

> I noticed that "%%DBUS_DAEMON%%" and "%%AVAHI_DAEMON%%" are not expanded. By
> default, ipp-usb expects a running Avahi daemon, but ipp-usb will still work
> without Avahi if one's printer setup does not require DNS-SD. Should the
> ipp-usb port depend on the avahi port?

Yes, there is no automatism, you have to define these yourself using SUB_LIST.
Adding a dependency on Avahi and DBUS is a good idea.  If it is not strictly required, consider making it an option that is enabled by default.

> Should I patch the ipp-usb.8 man page? e.g. replace "/etc/ipp-usb" with
> "/usr/local/etc/ipp-usb".

You can do so but don't have to.  Note that it's %%PREFIX%%/etc/ipp-usb; PREFIX doesn't have to be /usr/local.  The user can configure his or her own prefix.
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2023-05-05 12:01:20 UTC
Postponed pending submission of a new patch by maintainer.
Comment 8 chuanwei.foo 2023-05-11 08:00:56 UTC
Created attachment 242117 [details]
ipp-usb.patch (v3)

New patch submitted.
Comment 9 Robert Clausecker freebsd_committer freebsd_triage 2023-05-11 08:48:39 UTC
Will commit with my next batch.
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-05-11 23:27:09 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c30e4415453a5d3c5c0cd00d253250b8f7e2054d

commit c30e4415453a5d3c5c0cd00d253250b8f7e2054d
Author:     Foo Chuan Wei <chuanwei.foo@hotmail.com>
AuthorDate: 2023-05-11 07:54:49 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-05-11 23:23:30 +0000

    print/ipp-usb: Add port

    ipp-usb daemon enables driver-less printing and scanning on USB-only
    AirPrint-compatible printers and MFPs.  It works by connecting to the device by
    USB using IPP-over-USB protocol, and exposing the device to the network,
    including DNS-SD (ZeroConf) advertising.  IPP printing, eSCL scanning and web
    console are fully supported.

    WWW: https://github.com/OpenPrinting/ipp-usb

    PR:             271226

 print/Makefile                                  |  1 +
 print/ipp-usb/Makefile (new)                    | 37 +++++++++++++++++++++++++
 print/ipp-usb/distinfo (new)                    |  5 ++++
 print/ipp-usb/files/ipp-usb.in (new)            | 25 +++++++++++++++++
 print/ipp-usb/files/patch-dnssd__avahi.go (new) |  8 ++++++
 print/ipp-usb/pkg-descr (new)                   |  5 ++++
 print/ipp-usb/pkg-plist (new)                   |  8 ++++++
 7 files changed, 89 insertions(+)
Comment 11 Robert Clausecker freebsd_committer freebsd_triage 2023-05-11 23:29:08 UTC
Thank you for your contribution.