summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0914d32492180f84257ecb3423a2d30caef71967 (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
47
48
49
50
51
# $Id: PKGBUILD 266875 2017-11-15 14:29:11Z foutrelis $
# Maintainer: Jeff Mickey <j@codemac.net>
# Contributor: Shadowhand <woody.gilk@gmail.com>

pkgname=lomoco
pkgver=1.0
pkgrel=11
url="https://launchpad.net/ubuntu/+source/lomoco"
pkgdesc="Logitech USB mouse configuration program"
license=('GPL')
depends=('libusb-compat')
replaces=('lmctl')
arch=('x86_64')
backup=(etc/udev/lomoco_mouse.conf)
source=(http://http.debian.net/debian/pool/main/l/lomoco/lomoco_$pkgver.0.orig.tar.gz
	http://http.debian.net/debian/pool/main/l/lomoco/lomoco_$pkgver.0-1.debian.tar.gz
	"lomoco_mxair.patch::https://bugs.archlinux.org/task/36657?getfile=10920"
	lomoco_mouse.conf
	lomoco.sh)
md5sums=('f5197d0a3ee81229c3eecc1e03f7b08d'
         'b616b29dfe183b74f43072c22a470b8b'
         'd0390dfcadae6e54a4af3e6227d24201'
         '182b10a7e4a1828a93c1d55ef7f81b97'
         'bc92f661641265b33b27895ef24028fd')

prepare() {
  cd "$srcdir"/${pkgname}-${pkgver}
  for i in $(cat ../debian/patches/series); do
    patch -p1 <../debian/patches/$i
  done
  patch -p0 <"$srcdir"/lomoco_mxair.patch
}

build() {
  cd "$srcdir"/${pkgname}-${pkgver}
  ./autogen.sh --prefix=/usr --mandir=/usr/share/man
  make
  make udev-rules
}

package() {
  cd "$srcdir"/${pkgname}-${pkgver}
  make DESTDIR="$pkgdir" install

  # Fix and install udev rules and helpers
  sed -i 's|RUN+="udev.lomoco"|RUN+="lomoco.sh"|g' udev/lomoco.rules
  sed -i 's|SYSFS|ATTR|' udev/lomoco.rules
  install -D -m 644 udev/lomoco.rules "$pkgdir"/usr/lib/udev/rules.d/80-lomoco.rules
  install -D -m 755 ../lomoco.sh "$pkgdir"/usr/lib/udev/lomoco.sh
  install -D -m 644 ../lomoco_mouse.conf "$pkgdir"/etc/udev/lomoco_mouse.conf
}