Makefile 2.4 KB

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