aboutsummaryrefslogtreecommitdiffstats
path: root/main/udev/APKBUILD
blob: 20dcc3bfb5504314662865e07e20a38ef0a66698 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=udev
pkgver=180
pkgrel=0
pkgdesc="The userspace dev tools (udev)"
url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
arch="all"
license="GPL"
subpackages="$pkgname-dev $pkgname-doc libudev libgudev"
depends=
makedepends="gobject-introspection-dev glib-dev gperf acl-dev libusb-compat-dev
	usbutils pciutils-dev libtool util-linux-dev kmod-dev
	autoconf automake"
install=
source="http://www.kernel.org/pub/linux/utils/kernel/hotplug/$pkgname-$pkgver.tar.bz2
	0001-make-support-for-tar-without-J-option.patch
	0001-make-link-udevd-with-lrt.patch
	write_root_link_rule
	udev-mount.initd
	udev-postmount.initd
	udev.initd"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	aclocal -I m4 && autoconf && automake
}

build() { 
	cd "$srcdir"/$pkgname-$pkgver
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--sbindir=/sbin \
		--libdir=/usr/lib \
		--with-rootlibdir=/lib \
		--libexecdir=/lib/udev \
		|| return 1
	make || return 1
}

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

	# Upstream moved udevd to /lib/udev
	ln -s "../lib/udev/udevd" "$pkgdir"/sbin/udevd

	# multipath-tools expect scsi_id in /sbin
	ln -s "../lib/udev/scsi_id" "$pkgdir"/sbin/scsi_id

	mkdir -p "$pkgdir"/usr/lib/pkgconfig
	chmod +x "$pkgdir"/lib/udev/write_*_rules
	for _i in write_root_link_rule; do
		install -Dm755 ../$_i "$pkgdir"/lib/udev/$_i
	done
	for _i in udev udev-mount udev-postmount; do
		install -Dm755 ../$_i.initd "$pkgdir"/etc/init.d/$_i
	done
	# provided by bluez
	rm -f "$pkgdir"/lib/udev/hid2hci

	# remove libtool archives
	rm "$pkgdir"/usr/lib/*.la
}

libudev() {
	pkgdesc="Dynamic library to access udev device information"
	replaces="udev"
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/libudev.so.* "$subpkgdir"/lib/
}

libgudev() {
	pkgdesc="A GObject wrapper of the library gudev"
	replaces="udev"
	mkdir -p "$subpkgdir"/lib/ \
		"$subpkgdir"/usr/lib || return 1
	mv "$pkgdir"/lib/libgudev* "$subpkgdir"/lib/ || return 1
	mv "$pkgdir"/usr/lib/girepository-* \
		"$subpkgdir"/usr/lib/
}

md5sums="9ebccedefcd3ae15c35ba6f8bee0d102  udev-180.tar.bz2
6890dbebe3f150c1908dd19bbc33b8d0  0001-make-support-for-tar-without-J-option.patch
d108d502dd979691bc5598771f2f41e5  0001-make-link-udevd-with-lrt.patch
c9de7581099cdfdcd105666cd98a0f0a  write_root_link_rule
884d7faaaa149a323b14e907ea1934f4  udev-mount.initd
e99c87e62e7cb5acc4c55bf065944a11  udev-postmount.initd
c11fb3517a567db9994d5f9dbc88ecae  udev.initd"