Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. # $Id$
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=udev
  10. PKG_VERSION:=106
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/hotplug/
  14. PKG_MD5SUM:=320ccd2d0f4540d10e021bafa14f8985
  15. include $(INCLUDE_DIR)/package.mk
  16. define Package/udev
  17. SECTION:=utils
  18. CATEGORY:=Utilities
  19. DEPENDS:=@LINUX_2_6
  20. TITLE:=Dynamic device management subsystem
  21. URL:=http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
  22. endef
  23. define Package/udev/description
  24. udev provides a dynamic device directory containing only the files for
  25. actually present devices. It creates or removes device node files in
  26. the /dev directory, or it renames network interfaces.
  27. endef
  28. define Package/udevtrigger
  29. $(call Package/udev)
  30. TITLE:=Small utility to request kernel devices events for coldplug
  31. endef
  32. define Package/udevextras
  33. $(call Package/udev)
  34. TITLE:=Utilities for udev scripts, for general device discovery
  35. DEPENDS:=udev
  36. MENU:=1
  37. endef
  38. define Package/udevextras/config
  39. source "$(SOURCE)/udevextras-config.in"
  40. endef
  41. UDEV_ALL_EXTRAS=ata_id cdrom_id dasd_id scsi_id path_id usb_id volume_id
  42. UDEV_EXTRAS=$(strip $(foreach e, $(UDEV_ALL_EXTRAS), \
  43. $(if $(CONFIG_UDEVEXTRAS_$(e)),extras/$(e))))
  44. define Build/Compile
  45. $(MAKE) -C $(PKG_BUILD_DIR) \
  46. CROSS_COMPILE="$(TARGET_CROSS)" \
  47. STRIP="/bin/true" \
  48. OPTFLAGS="$(TARGET_CFLAGS)" \
  49. DESTDIR="$(PKG_INSTALL_DIR)" \
  50. INSTALL="install -c" \
  51. EXTRAS="$(UDEV_EXTRAS)" \
  52. VOLUME_ID_STATIC=true \
  53. all install
  54. endef
  55. define Package/udev/install
  56. install -d -m0775 $(1)/etc/udev
  57. $(CP) $(PKG_INSTALL_DIR)/etc/udev/* $(1)/etc/udev/
  58. install -d -m0775 $(1)/lib/udev
  59. install -d -m0775 $(1)/sbin/
  60. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/udevcontrol $(1)/sbin/
  61. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/udevd $(1)/sbin/
  62. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/udevsettle $(1)/sbin/
  63. install -d -m0775 $(1)/usr/bin/
  64. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/udevinfo $(1)/usr/bin/
  65. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/udevtest $(1)/usr/bin/
  66. install -d -m0775 $(1)/usr/sbin/
  67. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/udevmonitor $(1)/usr/sbin/
  68. install -d -m0775 $(1)/etc/udev/rules.d
  69. $(CP) files/20-input-grouping.rules $(1)/etc/udev/rules.d/
  70. endef
  71. define Package/udevtrigger/install
  72. $(INSTALL_DIR) $(1)/sbin
  73. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/udevtrigger $(1)/sbin/
  74. endef
  75. define Package/udevextras/install
  76. $(INSTALL_DIR) $(1)/etc/udev
  77. $(CP) $(PKG_BUILD_DIR)/etc/udev/rules.d $(1)/etc/udev/
  78. $(INSTALL_DIR) $(1)/lib/udev
  79. $$(foreach f, $$(shell $(FIND) $(PKG_INSTALL_DIR)/lib/udev/ -type f), \
  80. $(CP) $$(f) $(1)/lib/udev/ ; \
  81. )
  82. endef
  83. $(eval $(call BuildPackage,udev))
  84. $(eval $(call BuildPackage,udevtrigger))
  85. $(eval $(call BuildPackage,udevextras))