util-linux: Subpackage for blkdiscard
[openwrt/svn-archive/archive.git] / package / utils / util-linux / Makefile
index 7ce3a774cc59bf77224523aef87328be62be88ae..73903cd92d0cf6fdd0c3851c44613914e4a73806 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2014 OpenWrt.org
+# Copyright (C) 2007-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=util-linux
 PKG_VERSION:=2.25.2
-PKG_RELEASE:=2
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.25
@@ -19,7 +19,12 @@ PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING getopt/COPYING libblkid/COPYING libmount/COPYING Documentation/licenses/COPYING.GPLv2 Documentation/licenses/COPYING.LGPLv2.1 libuuid/COPYING Documentation/licenses/COPYING.BSD-3
 
 PKG_BUILD_PARALLEL:=1
-PKG_BUILD_DEPENDS:=libncurses
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_PACKAGE_cal \
+       CONFIG_PACKAGE_cfdisk \
+       CONFIG_PACKAGE_setterm
+
 PKG_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/package.mk
@@ -31,12 +36,12 @@ define Package/util-linux/Default
 endef
 
 CONFIGURE_ARGS += \
-       --enable-new-mount      \
-       --with-ncurses          \
+       --disable-rpath \
        --disable-tls           \
        --disable-sulogin       \
        --without-python        \
-       --without-udev
+       --without-udev          \
+       $(if $(CONFIG_PACKAGE_cal)$(CONFIG_PACKAGE_cfdisk)$(CONFIG_PACKAGE_setterm),--with-ncurses,--without-ncurses)
 
 TARGET_CFLAGS += $(FPIC) -std=gnu99
 
@@ -132,6 +137,18 @@ define Package/agetty/description
  /bin/login command
 endef
 
+define Package/blkdiscard
+$(call Package/util-linux/Default)
+  TITLE:=discard sectors on a device
+  SUBMENU=disc
+endef
+
+define Package/blkdiscard/description
+ The blkdiscard is used to discard device sectors. This is useful for
+ solid-state drivers (SSDs) and thinly-provisioned storage. Unlike fstrim,
+ this command is used directly on the block device.
+endef
+
 define Package/blkid
 $(call Package/util-linux/Default)
   TITLE:=locate/print block device attributes
@@ -297,6 +314,17 @@ define Package/namei/description
  files, directories, and so forth)
 endef
 
+define Package/prlimit
+$(call Package/util-linux/Default)
+  TITLE:=get and set process resource limits
+  DEPENDS:= +libsmartcols
+endef
+
+define Package/prlimit/description
+  Given a process id and one or more resources, prlimit tries to retrieve
+  and/or modify the limits.
+endef
+
 define Package/rename
 $(call Package/util-linux/Default)
   TITLE:=rename files
@@ -422,22 +450,22 @@ define Package/wipefs/description
 endef
 
 define Package/libblkid/install
-        $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_BUILD_DIR)/.libs/libblkid.so* $(1)/usr/lib/
 endef
 
 define Package/libmount/install
-        $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_BUILD_DIR)/.libs/libmount.so* $(1)/usr/lib/
 endef
 
 define Package/libsmartcols/install
-        $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_BUILD_DIR)/.libs/libsmartcols.so* $(1)/usr/lib/
 endef
 
 define Package/libuuid/install
-        $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_BUILD_DIR)/.libs/libuuid.so* $(1)/usr/lib/
 endef
 
@@ -446,6 +474,11 @@ define Package/agetty/install
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/agetty $(1)/usr/sbin/
 endef
 
+define Package/blkdiscard/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/blkdiscard $(1)/usr/sbin/
+endef
+
 define Package/blkid/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/blkid $(1)/usr/sbin/
@@ -528,6 +561,11 @@ define Package/namei/install
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/namei $(1)/usr/bin/
 endef
 
+define Package/prlimit/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/prlimit $(1)/usr/bin/
+endef
+
 define Package/rename/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/rename $(1)/usr/bin/
@@ -592,6 +630,7 @@ $(eval $(call BuildPackage,libmount))
 $(eval $(call BuildPackage,libsmartcols))
 $(eval $(call BuildPackage,libuuid))
 $(eval $(call BuildPackage,agetty))
+$(eval $(call BuildPackage,blkdiscard))
 $(eval $(call BuildPackage,blkid))
 $(eval $(call BuildPackage,cal))
 $(eval $(call BuildPackage,cfdisk))
@@ -608,6 +647,7 @@ $(eval $(call BuildPackage,lsblk))
 $(eval $(call BuildPackage,mcookie))
 $(eval $(call BuildPackage,mount-utils))
 $(eval $(call BuildPackage,namei))
+$(eval $(call BuildPackage,prlimit))
 $(eval $(call BuildPackage,rename))
 $(eval $(call BuildPackage,partx-utils))
 $(eval $(call BuildPackage,script-utils))