23.1.0-1
[arch-packages.git] / ipp-usb / trunk / PKGBUILD
blob21304d9b46d6f17881787ff7dd03a0cf3817b314
1 # Maintainer: Andreas Radke <andyrtr@archlinux.org>
3 pkgname=ipp-usb
4 pkgver=0.9.23
5 pkgrel=1
6 pkgdesc="allows using the IPP protocol, normally designed for network printers, to be used with USB printers as well"
7 arch=('x86_64')
8 url="https://github.com/OpenPrinting/ipp-usb"
9 license=('custom: BSD')
10 depends=('avahi' 'libusb')
11 makedepends=('go')
12 backup=(etc/ipp-usb/ipp-usb.conf)
13 # ToDo: package goipp and fix ipp-usb - keeps downloading goipp even if present in build system
14 #makedepends=('go' 'golang-github-openprinting-goipp')
15 source=("$pkgname-$pkgver.tar.gz"::https://github.com/OpenPrinting/ipp-usb/archive/$pkgver.tar.gz
16         systemd-service.patch)
17 sha256sums=('81f325abc45b4d2b8812022d93dfcebc807c2b0688e2a9f7052f0bddfadf5b01'
18             '8cec95d5de1fcc95187c6521971a0239a5503bbc08162e5d67cfef2439e07a76')
20 prepare() {
21         cd "$pkgname-$pkgver"
22         # fix systemd service file; FS#67526
23         patch -Np1 -i ../systemd-service.patch
24         # fix Makefile
25         sed -i "s/sbin/bin/g" Makefile
28 build() {
29         cd "$pkgname-$pkgver"
30         export CGO_CPPFLAGS="${CPPFLAGS}"
31         export CGO_CFLAGS="${CFLAGS}"
32         export CGO_CXXFLAGS="${CXXFLAGS}"
33         export CGO_LDFLAGS="${LDFLAGS}"
34         export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
36         #go build -o "$pkgname" .
37         make
40 check() {
41         cd "$pkgname-$pkgver"
42         go test
45 package() {
46         cd "$pkgname-$pkgver"
47         # https://github.com/OpenPrinting/ipp-usb/blob/master/Makefile
48         # DESTDIR and PREFIX are fully f... up so do it our own
49         #make DESTDIR="${pkgdir}" install
51         install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
52         install -Dm644 ipp-usb.conf "$pkgdir"/etc/ipp-usb/ipp-usb.conf
53         install -Dm644 systemd-udev/71-ipp-usb.rules "$pkgdir"/usr/lib/udev/rules.d/71-ipp-usb.rules
54         install -Dm644 systemd-udev/ipp-usb.service "$pkgdir"/usr/lib/systemd/system/ipp-usb.service
55         install -Dm644 ipp-usb.8 "$pkgdir"/usr/share/man/man8/ipp-usb.8
56         install -Dm644 ipp-usb-quirks/* -t "$pkgdir"/usr//share/ipp-usb/quirks
57         
58         install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"