desktop/usb-modeswitch/PKGBUILD
Neofytos Kolokotronis ccb9b4f40d usb-modeswitch: 2.5.0
2017-06-03 19:23:28 +02:00

55 lines
1.8 KiB
Bash

# Contributions from ArchLinux: https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/usb_modeswitch
pkgname=usb-modeswitch
_pkgname=usb_modeswitch
pkgver=2.5.0
pkgrel=1
_pkgdata=20170205
pkgdesc="Activating switchable USB devices on Linux."
arch=('x86_64')
url="http://www.draisberghof.de/usb_modeswitch/"
license=('GPL3')
depends=('libusb' 'tcl')
makedepends=('gcc' 'make')
conflicts=(usb_modeswitch)
replaces=(usb_modeswitch)
categories=('system')
backup=("etc/$_pkgname.conf")
source=("http://www.draisberghof.de/$_pkgname/$pkgname-$pkgver.tar.bz2"
"http://www.draisberghof.de/$_pkgname/$pkgname-data-$_pkgdata.tar.bz2"
"usb-modeswitch-${pkgver}-device_reference.txt::http://www.draisberghof.de/$_pkgname/device_reference.txt")
sha256sums=('31c0be280d49a99ec3dc0be3325bef320d9c04b50714ef0ce1e36a614d687633'
'e2dcfd9d28928d8d8f03381571a23442b3c50d48d343bc40a1a07d01662738d1'
'846b45a82a31c9755ab86d9c051e706aff445e1e793575b7ae195a4edeb4d594')
prepare() {
cd "$srcdir"/usb-modeswitch-$pkgver/
sed -i 's|/usr/sbin/usb_mode|/usr/bin/usb_mode|g' usb_modeswitch.{conf,tcl,sh}
}
build() {
cd "$srcdir"/usb-modeswitch-$pkgver/
make clean
make SBINDIR=/usr/bin
}
package() {
cd "$srcdir"/usb-modeswitch-$pkgver/
mkdir -p "$pkgdir"/usr/lib/udev
mkdir -p "$pkgdir"/etc
mkdir -p "$pkgdir"/usr/share/man/man1
mkdir -p "$pkgdir"/usr/lib/systemd/system
make \
DESTDIR="$pkgdir" \
UDEVDIR="$pkgdir"/usr/lib/udev \
SBINDIR="$pkgdir"/usr/bin \
SYSDIR="$pkgdir"/usr/lib/systemd/system \
install
cp "$srcdir"/usb-modeswitch-${pkgver}-device_reference.txt "$pkgdir"/etc/usb_modeswitch.setup
cd "$srcdir"/usb-modeswitch-data-${_pkgdata}
make DESTDIR="$pkgdir" install RULESDIR="$pkgdir"/usr/lib/udev/rules.d
}