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