Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #
  2. # Copyright (C) 2006 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:=util-linux
  10. PKG_VERSION:=2.12r
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=ftp://ftp.kernel.org/pub/linux/utils/$(PKG_NAME)/ \
  14. http://ftp.kernel.org/pub/linux/utils/$(PKG_NAME)/ \
  15. ftp://ftp.de.kernel.org/pub/linux/utils/$(PKG_NAME)/ \
  16. http://ftp.de.kernel.org/pub/linux/utils/$(PKG_NAME)/
  17. PKG_MD5SUM:=c261230b27fc0fbcc287c76884caf2d3
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/util-linux/Default
  20. SECTION:=utils
  21. CATEGORY:=Utilities
  22. URL:=http://www.kernel.org/pub/linux/utils/util-linux/
  23. endef
  24. define Package/fdisk
  25. $(call Package/util-linux/Default)
  26. TITLE:=Partition table manipulation utility
  27. DESCRIPTION:=\
  28. This package contains an utility for managing disk partition tables.
  29. URL:=http://www.kernel.org/pub/linux/utils/util-linux/
  30. endef
  31. define Package/losetup
  32. $(call Package/util-linux/Default)
  33. TITLE:=Loopback devices setup and control utility
  34. DESCRIPTION:=\
  35. This package contains an utility for managing loopback devices.
  36. endef
  37. define Package/swap-utils
  38. $(call Package/util-linux/Default)
  39. TITLE:=Swap space management utilities
  40. DESCRIPTION:=\
  41. This package contains a collection of tools for managing swap space: \\\
  42. - mkswap\\\
  43. - swapon\\\
  44. - swapoff
  45. endef
  46. TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/lib
  47. define Build/Compile
  48. $(call Build/Compile/Default, \
  49. OPT="$(TARGET_CFLAGS)" \
  50. INSTALLSUID="install -m 4755" \
  51. DESTDIR="$(PKG_INSTALL_DIR)" \
  52. all install \
  53. )
  54. endef
  55. define Package/Template
  56. @if [ \! -f "$(PKG_INSTALL_DIR)/$(1)" ]; then \
  57. rm -f $(PKG_BUILD_DIR)/.built; \
  58. $(MAKE) $(PKG_BUILD_DIR)/.built; \
  59. fi
  60. $(INSTALL_DIR) $(2)
  61. $(CP) $(PKG_INSTALL_DIR)/$(1) $(2)/
  62. endef
  63. define Package/fdisk/install
  64. $(call Package/Template,sbin/fdisk,$(1)/usr/sbin)
  65. endef
  66. define Package/losetup/install
  67. $(call Package/Template,sbin/losetup,$(1)/usr/sbin)
  68. endef
  69. define Package/swap-utils/install
  70. $(call Package/Template,sbin/mkswap,$(1)/usr/sbin)
  71. $(call Package/Template,sbin/swapon,$(1)/usr/sbin)
  72. $(call Package/Template,sbin/swapoff,$(1)/usr/sbin)
  73. endef
  74. $(eval $(call BuildPackage,fdisk))
  75. $(eval $(call BuildPackage,losetup))
  76. $(eval $(call BuildPackage,swap-utils))