a99533e45470afa438fb3635df9265ec8d57dc09
[openwrt/staging/wigyori.git] / package / system / udev / Makefile
1 #
2 # Copyright (C) 2006-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=udev
11 PKG_VERSION:=173
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/hotplug/
16 PKG_MD5SUM:=91a88a359b60bbd074b024883cc0dbde
17 PKG_LICENSE:=GPL-2.0
18
19 include $(INCLUDE_DIR)/package.mk
20
21 PKG_INSTALL=1
22
23 define Package/udev
24 SECTION:=base
25 CATEGORY:=Base system
26 TITLE:=Dynamic device management subsystem
27 URL:=http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
28 MAINTAINER:=Geoff Levand <geoff@infradead.org>
29 MENU:=1
30 DEPENDS:=+librt
31 endef
32
33 define Package/udev/description
34 udev allows Linux users to have a dynamic /dev directory and it
35 provides the ability to have persistent device names.
36 endef
37
38 define Package/udev/conffiles
39 /etc/udev/udev.conf
40 endef
41
42 define Package/udev/config
43 source "$(SOURCE)/Config.in"
44 endef
45
46 udev-args-$(CONFIG_UDEV_DISABLE_LOGGING) += --disable-logging
47 udev-args-$(CONFIG_UDEV_ENABLE_DEBUG) += --enable-debug
48 udev-args-$(CONFIG_UDEV_EXTRA_edd_id) += --enable-edd
49 udev-args-$(CONFIG_UDEV_EXTRA_floppy) += --enable-floppy
50
51 # TODO: make hwdb and introspection work
52
53 CONFIGURE_ARGS += --prefix=/usr --exec-prefix= --sysconfdir=/etc \
54 --disable-hwdb --disable-keymap --disable-gudev --disable-introspection \
55 --libexecdir=/lib/udev --disable-gtk-doc-html \
56 --sbindir=/sbin $(udev-args-y)
57
58 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_accelerometer) += accelerometer
59 udev-extra-rules-$(CONFIG_UDEV_EXTRA_accelerometer) += 61-accelerometer.rules
60
61 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_ata_id) += ata_id
62
63 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_cdrom_id) += cdrom_id
64 udev-extra-rules-$(CONFIG_UDEV_EXTRA_cdrom_id) += 60-cdrom_id.rules
65
66 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_collect) += collect
67
68 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_edd_id) += edd_id
69 udev-extra-rules-$(CONFIG_UDEV_EXTRA_edd_id) += 61-persistent-storage-edd.rules
70
71 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_firmware) += firmware
72 udev-extra-rules-$(CONFIG_UDEV_EXTRA_firmware) += 50-firmware.rules
73
74 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_floppy) += create_floppy_devices
75
76 # TODO: make gudev work
77
78 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_input_id) += input_id
79
80 # TODO: make keymap work
81
82 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_mtd_probe) += mtd_probe
83 udev-extra-rules-$(CONFIG_UDEV_EXTRA_mtd_probe) += 75-probe_mtd.rules
84
85 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_path_id) += path_id
86
87 udev-extra-rules-$(CONFIG_UDEV_EXTRA_qemu) += 42-qemu-usb.rules
88
89 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_rule_generator) += \
90 write_cd_rules write_net_rules
91 udev-extra-lib-data-$(CONFIG_UDEV_EXTRA_rule_generator) += \
92 rule_generator.functions
93 udev-extra-rules-$(CONFIG_UDEV_EXTRA_rule_generator) += \
94 75-cd-aliases-generator.rules 75-persistent-net-generator.rules
95
96 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_scsi_id) += scsi_id
97
98 # TODO: make udev-acl work
99
100 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_usb_id) += usb_id
101
102 udev-extra-lib-bin-$(CONFIG_UDEV_EXTRA_v4l_id) += v4l_id
103 udev-extra-rules-$(CONFIG_UDEV_EXTRA_v4l_id) += 60-persistent-v4l.rules
104
105 define Build/InstallDev
106 $(INSTALL_DIR) $(1)/usr/include
107 $(CP) $(PKG_INSTALL_DIR)/usr/include/libudev.h $(1)/usr/include
108 $(INSTALL_DIR) $(1)/usr/share/pkgconfig
109 $(CP) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/udev.pc $(1)/usr/share/pkgconfig
110 $(INSTALL_DIR) $(1)/lib
111 $(CP) $(PKG_INSTALL_DIR)/lib/libudev.so* $(1)/lib
112 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
113 $(CP) $(PKG_INSTALL_DIR)/lib/pkgconfig/libudev.pc $(1)/usr/lib/pkgconfig
114 endef
115
116 define Package/udev/install
117 $(INSTALL_DIR) $(1)/etc/udev/rules.d
118 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/udev/udev.conf $(1)/etc/udev
119
120 $(INSTALL_DIR) $(1)/sbin
121 $(INSTALL_BIN) \
122 $(PKG_INSTALL_DIR)/sbin/udevadm \
123 $(PKG_INSTALL_DIR)/sbin/udevd \
124 $(1)/sbin
125
126 $(INSTALL_DIR) $(1)/lib/udev/rules.d
127 $(INSTALL_DATA) \
128 $(addprefix $(PKG_INSTALL_DIR)/lib/udev/rules.d/, \
129 $(udev-extra-rules-y)) \
130 $(addprefix $(PKG_INSTALL_DIR)/lib/udev/rules.d/, \
131 50-udev-default.rules \
132 60-persistent-input.rules \
133 60-persistent-serial.rules \
134 60-persistent-storage.rules \
135 80-drivers.rules \
136 95-udev-late.rules) \
137 $(1)/lib/udev/rules.d
138
139 $(INSTALL_DIR) $(1)/lib
140 $(CP) $(PKG_INSTALL_DIR)/lib/libudev.so* $(1)/lib
141
142 $(INSTALL_DIR) $(1)/lib/udev
143 ifneq ($(udev-extra-lib-bin-y),)
144 $(INSTALL_BIN) \
145 $(addprefix $(PKG_INSTALL_DIR)/lib/udev/, \
146 $(udev-extra-lib-bin-y)) \
147 $(1)/lib/udev/
148 endif
149 ifneq ($(udev-extra-lib-data-y),)
150 $(INSTALL_DATA) \
151 $(addprefix $(PKG_INSTALL_DIR)/lib/udev/, \
152 $(udev-extra-lib-data-y)) \
153 $(1)/lib/udev/
154 endif
155 endef
156
157 $(eval $(call BuildPackage,udev))