# Generated by go2rpm 1.18.0 %bcond check 1 # https://github.com/OpenPrinting/ipp-usb %global goipath github.com/OpenPrinting/ipp-usb Version: 0.9.30 %global tag 0.9.30 %gometa -L -f %global common_description %{expand: HTTP reverse proxy, backed by IPP-over-USB connection to device. It enables driverless support for USB devices capable of using IPP-over-USB protocol. } Name: ipp-usb # keep the release from golang-github-openprinting-ipp-usb to have clean upgrade path # without Obsoletes/Provides, because the previous component already provided RPM ipp-usb Release: 9%{?dist} Summary: HTTP reverse proxy, backed by IPP-over-USB connection to device # Generated by go-vendor-tools License: BSD-2-Clause URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools # archive generated by go-vendor-tools - bundled all deps needed # for compilation - dependencies are downloaded from upstream in versions # defined go.mod Source1: %{archivename}-vendor.tar.bz2 # go-vendor-tools configuration - currently it sets license scanner to askalono Source2: go-vendor-tools.toml # for working with bundled (vendored) deps BuildRequires: go-vendor-tools # needed for registering device on localhost BuildRequires: pkgconfig(avahi-client) >= 0.7 # for functions working with USB devices BuildRequires: pkgconfig(libusb-1.0) >= 1.0 # for macros in rpm scriptlets BuildRequires: systemd-rpm-macros # remove old -devel package if installed Obsoletes: golang-github-openprinting-ipp-usb-devel < 0.9.30-9 # ipp-usb is a systemd service Requires: systemd # ipp-usb is started when USB device shows up and has a udev rule for it Requires: systemd-udev %description -n ipp-usb %{common_description} %prep %goprep -p1 tar -xf %{SOURCE1} %generate_buildrequires %go_vendor_license_buildrequires -c %{SOURCE2} %build # enables Go modules mode for managing depedencies %global gomodulesmode GO111MODULE=on # uses C code inside Golang (CGO) - set the correct flags export CGO_CFLAGS="%{build_cflags}" CGO_LDFLAGS="%{build_ldflags}" # -mod=vendor is default as of go 1.14; go.mod is set to 1.11 %gobuild -mod=vendor -o %{gobuilddir}/bin/ipp-usb %{goipath} %install %go_vendor_license_install -c %{SOURCE2} install -m 0755 -vd %{buildroot}%{_sbindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_sbindir}/ install -m 0755 -vd %{buildroot}%{_udevrulesdir} install -m 0644 -vp systemd-udev/*.rules %{buildroot}%{_udevrulesdir} install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0644 -vp systemd-udev/*.service %{buildroot}%{_unitdir} install -m 0755 -vd %{buildroot}%{_sysconfdir}/ipp-usb install -m 0644 -vp ipp-usb.conf %{buildroot}%{_sysconfdir}/ipp-usb/ install -m 0755 -vd %{buildroot}%{_sysconfdir}/ipp-usb/quirks install -m 0755 -vd %{buildroot}%{_mandir}/man8 install -m 0644 -vp ipp-usb.8 %{buildroot}%{_mandir}/man8 install -m 0755 -vd %{buildroot}%{_datadir}/ipp-usb install -m 0755 -vd %{buildroot}%{_datadir}/ipp-usb/quirks install -m 0644 -vp ipp-usb-quirks/* %{buildroot}%{_datadir}/ipp-usb/quirks %post %systemd_post ipp-usb.service %preun %systemd_preun ipp-usb.service %postun %systemd_postun_with_restart ipp-usb.service %check %go_vendor_license_check -c %{SOURCE2} %if %{with check} # uses C code inside Golang (CGO) - set the correct flags export CGO_CFLAGS="%{build_cflags}" CGO_LDFLAGS="%{build_ldflags}" %gotest -mod=vendor ./... %endif %files -f %{go_vendor_license_filelist} %doc README.md %dir %{_datadir}/ipp-usb %dir %{_datadir}/ipp-usb/quirks %{_datadir}/ipp-usb/quirks/* %{_mandir}/man8/ipp-usb.8.* %{_sbindir}/ipp-usb %dir %{_sysconfdir}/ipp-usb/ %config(noreplace) %{_sysconfdir}/ipp-usb/ipp-usb.conf %dir %{_sysconfdir}/ipp-usb/quirks %{_udevrulesdir}/71-ipp-usb.rules %{_unitdir}/ipp-usb.service %changelog * Tue Jan 20 2026 Zdenek Dohnal - 0.9.30-9 - initial import - renamed from golang-github-openprinting-ipp-usb to ipp-usb