aboutsummaryrefslogtreecommitdiffstats
path: root/testing/usb-modeswitch/APKBUILD
blob: 486d7d4b1ebc5378ded6cd5421823701503d37cf (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
52
53
54
55
56
57
58
59
60
# Maintainer: Leonardo Arena <rnalrd@gmail.com>
pkgname=usb-modeswitch
pkgver=1.1.7
pkgrel=2
_pkgdata=20110227
pkgdesc="A mode switching tool for controlling flip flop (multiple device) USB gear"
url="http://www.draisberghof.de/usb_modeswitch/"
arch="all"
license="GPL"
depends="tcl"
makedepends="libusb-compat-dev"
install=
subpackages="$pkgname-doc"
source="http://www.draisberghof.de/usb_modeswitch/${pkgname}-${pkgver}.tar.bz2
	http://www.draisberghof.de/usb_modeswitch/${pkgname}-data-${_pkgdata}.tar.bz2
	usb_modeswitch.setup
	Makefile.patch"

_builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	cd "$_builddir"
	mkdir -p $pkgdir/lib/udev/usb_modeswitch || return 1
	mkdir -p $pkgdir/etc || return 1
	mkdir -p $pkgdir/usr/share/man/man1 || return 1
	make clean || return 1
	sed -i -e 's/--mode=/-m/' Makefile || return 1
	
	cd ../${pkgname}-data-${_pkgdata}
#	sed -i -e 's%install -m644 -t $(PREFIX)/share/usb_modeswitch ./usb_modeswitch.d/*%cp -R $(PREFIX)/share/usb_modeswitch/* ./usb_modeswitch.d/%' Makefile || return 1
	sed -i -e 's/--mode=/-m/' Makefile || return 1
	patch -p1 < ../Makefile.patch
}

build() {
	cd "$_builddir"
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install
	# adjusting the tcl script location
	# mv ${pkgdir}/lib/udev/usb_modeswitch/usb_modeswitch.tcl \
	#  ${pkgdir}/lib/udev/usb_modeswitch.tcl || return 1
	# rmdir ${pkgdir}/lib/udev/usb_modeswitch || return 1
        # mv ${pkgdir}/lib/udev/usb_modeswitch.tcl \
	#  ${pkgdir}/lib/udev/usb_modeswitch  || return 1

	# installing data
	cd $srcdir/usb-modeswitch-data-${_pkgdata} || return 1
	make DESTDIR=$pkgdir install || return 1
	# installing config
	cp $srcdir/usb_modeswitch.setup $pkgdir/etc/ || return 1
}

md5sums="b75e42b7b2d30e9d4cbd5c159f925247  usb-modeswitch-1.1.7.tar.bz2
2f5e5bfa21a97b705a22f95bec367793  usb-modeswitch-data-20110227.tar.bz2
9a25756669937ac86774bb55733f09cd  usb_modeswitch.setup
84de2517de202c22801b678f49a07e37  Makefile.patch"