summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0534bca012cfe15d5d0c794bc2075aa0eb1100fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: Danilo Luvizotto <danilo.luvizotto@gmail.com>
# Contributor: Wieland Hoffmann <the_mineo@web.de>
# Contributor: G_Syme <demichan(at)mail(dot)upb(dot)de>
pkgname=p910nd
pkgver=0.97
pkgrel=1
pkgdesc="A small printer daemon intended for diskless workstations that passes jobs directly to the printer"
arch=('i686' 'x86_64' 'armv5' 'armv5h' 'armv6' 'armv6h' 'armv7' 'armv7h')
url="http://p910nd.sourceforge.net"
license=('GPL2')
depends=('glibc')
backup=('etc/conf.d/p910nd')
#options=('emptydirs')
source=(http://downloads.sf.net/$pkgname/$pkgname-$pkgver.tar.bz2 \
        $pkgname.service \
        $pkgname.conf)
md5sums=('69461a6c54dca0b13ecad5b83864b43e'
         'e37030a69b7bf302cfb23d88e25ebbdf'
         'ea1db6d612058532c525efedd54990f2')

CONFIGDIR=/etc/conf.d
INITSCRIPT=""
SCRIPTDIR=""

build() {
  cd "$srcdir/$pkgname-$pkgver"
  # TODO: this should be in its own subdir, but needs to be created at boot 
  sed -i "s|/var/lock/subsys|/run/lock|" $pkgname.c
  # modern linux FSH
  sed -i 's|sbin|bin|' *
  sed -i 's|var/lock|run/lock|' *
  sed -i 's|var/run|run|' *
  sed -i 's|$(INSTALL) $(INITSCRIPT) $(DESTDIR)$(SCRIPTDIR)/$(PROG)||' Makefile
  make CONFIGDIR=$CONFIGDIR INITSCRIPT=$INITSCRIPT SCRIPTDIR=$SCRIPTDIR
  sed -i 's|P910ND_OPTS=""|P910ND_OPTS="-f /dev/usb/lp0"|' $pkgname.conf
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make CONFIGDIR=$CONFIGDIR INITSCRIPT=$INITSCRIPT SCRIPTDIR=$SCRIPTDIR DESTDIR="$pkgdir" install
  #install -dm755 "$pkgdir/run/lock/$pkgname"
  install -Dm644 "$srcdir/$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service"
  install -Dm644 "$srcdir/$pkgname.conf" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
}