From 725f36984576220095acf8a219f627cf459bcd50 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 9 Sep 2020 16:19:23 +0200 Subject: [PATCH] Initial import (#1875726) --- .gitignore | 1 + golang-github-openprinting-ipp-usb.spec | 111 ++++++++++++++++++++++++ sources | 1 + 3 files changed, 113 insertions(+) create mode 100644 .gitignore create mode 100644 golang-github-openprinting-ipp-usb.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3520a05 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/ipp-usb-0.9.13.tar.gz diff --git a/golang-github-openprinting-ipp-usb.spec b/golang-github-openprinting-ipp-usb.spec new file mode 100644 index 0000000..ff048cc --- /dev/null +++ b/golang-github-openprinting-ipp-usb.spec @@ -0,0 +1,111 @@ +# Generated by go2rpm 1 +%bcond_without check + +# https://github.com/OpenPrinting/ipp-usb +%global goipath github.com/OpenPrinting/ipp-usb +Version: 0.9.13 +%global tag 0.9.13 + +%gometa + +%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. +} + +%global golicenses LICENSE +%global godocs README.md + +# we ship devel rpm too, which means it needs to require avahi and libusbx +# too to work correctly +%global godevelheader %{expand: +Requires: pkgconfig(avahi-client) >= 0.7 +Requires: pkgconfig(libusb-1.0) >= 1.0 +} + +Name: %{goname} +Release: 1%{?dist} +Summary: HTTP reverse proxy, backed by IPP-over-USB connection to device + +# Upstream license specification: BSD-2-Clause +License: BSD +URL: %{gourl} +Source0: %{gosource} + +# needed for registering device on localhost +BuildRequires: pkgconfig(avahi-client) >= 0.7 +# implements IPP protocol used in ipp-usb +BuildRequires: golang(github.com/OpenPrinting/goipp) +# for functions working with USB devices +BuildRequires: pkgconfig(libusb-1.0) >= 1.0 +# for using pkg-config in spec +BuildRequires: pkgconf-pkg-config +# for macros in rpm scriptlets +BuildRequires: systemd-rpm-macros + + +%package -n ipp-usb +Summary: HTTP reverse proxy capable of IPP-over-USB connection +# 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} + +%description +%{common_description} + +%gopkg + +%prep +%goprep + +%build +%gobuild -o %{gobuilddir}/bin/ipp-usb %{goipath} + +%install +%gopkginstall + +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}%{_mandir}/man8 +install -m 0644 -vp ipp-usb.8 %{buildroot}%{_mandir}/man8 + +%post -n ipp-usb +%systemd_post ipp-usb.service + +%preun -n ipp-usb +%systemd_preun ipp-usb.service + +%postun -n ipp-usb +%systemd_postun_with_restart ipp-usb.service + +%if %{with check} +%check +%gocheck +%endif + +%files -n ipp-usb +%license LICENSE +%doc README.md +%{_sbindir}/* +%{_mandir}/man8/ipp-usb.8.* +%dir %{_sysconfdir}/ipp-usb/ +%config(noreplace) %{_sysconfdir}/ipp-usb/ipp-usb.conf +%{_udevrulesdir}/*.rules +%{_unitdir}/*.service + +%gopkgfiles + +%changelog +* Fri Sep 04 2020 Zdenek Dohnal - 0.9.13-1 +- Initial import (#1875726) + diff --git a/sources b/sources new file mode 100644 index 0000000..5f4e5b1 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (ipp-usb-0.9.13.tar.gz) = ef172a45ba54b847261ed164e300895f8663f37e393eb803eb8ede4ae8175e372196fa14e02257fa8f7ad7165931c5c808c8470f4ccf073479abc2e45599eed5