[OpenWrt-Devel] [PATCH 5/5] package/network/utils/iputils: Allow smooth install/uninstall alongside busybox

openwrt at daniel.thecshore.com openwrt at daniel.thecshore.com
Thu Jan 21 12:54:45 EST 2016


From: Daniel Dickinson <openwrt at daniel.thecshore.com>

Rather than have packages that behave badly
when used alongside busybox and/or which fails to
cleanly uninstall, make any package for which there
is a busybox applet work cleanly with busybox (taking
over from busybox when installed, and restoring
busybox when removed as well as behaving properly if the
corresponding busybox applet does not exist in busybox
(that is no extraneous symlink).
---
 package/network/utils/iputils/Makefile | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/package/network/utils/iputils/Makefile b/package/network/utils/iputils/Makefile
index 6f75236..3da0d2d 100644
--- a/package/network/utils/iputils/Makefile
+++ b/package/network/utils/iputils/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iputils
 PKG_VERSION:=20101006
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-s$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.skbuff.net/iputils
@@ -42,6 +42,7 @@ define Package/iputils-arping/description
   Sends ARP REQUEST to a neighbour host.
 endef
 
+$(eval $(call Package/BusyBoxReplacement/Default,iputils-arping,/usr/sbin,/sbin,../../bin,arping))
 
 define Package/iputils-clockdiff
 $(call Package/iputils/Default)
@@ -64,6 +65,7 @@ define Package/iputils-ping/description
   Sends ICMP ECHO_REQUEST to network hosts (IPv4).
 endef
 
+$(eval $(call Package/BusyBoxReplacement/Default,iputils-ping,/bin,/usr/bin,,ping))
 
 define Package/iputils-ping6
 $(call Package/iputils/Default)
@@ -76,6 +78,7 @@ define Package/iputils-ping6/description
   Sends ICMP ECHO_REQUEST to network hosts (IPv6).
 endef
 
+$(eval $(call Package/BusyBoxReplacement/Default,iputils-ping6,/bin,/usr/bin,,ping6))
 
 define Package/iputils-tftpd
 $(call Package/iputils/Default)
@@ -87,6 +90,7 @@ define Package/iputils-tftpd/description
   Trivial File Transfer Protocol server.
 endef
 
+$(eval $(call Package/BusyBoxReplacement/Default,iputils-tftpd,/usr/sbin,/sbin,../../bin,tftpd))
 
 define Package/iputils-tracepath
 $(call Package/iputils/Default)
@@ -122,6 +126,8 @@ define Package/iputils-traceroute6/description
   Traces path to a network host (IPv6).
 endef
 
+$(eval $(call Package/BusyBoxReplacement/Default,iputils-traceroute6,/usr/bin,/bin,../../bin,traceroute6))
+
 ifdef CONFIG_USE_MUSL
   TARGET_CFLAGS += -D__UCLIBC__
 endif
@@ -132,8 +138,8 @@ MAKE_FLAGS += \
 	CONFIG_USE_UCLIBC="$(CONFIG_USE_UCLIBC)$(CONFIG_USE_MUSL)" \
 
 define Package/iputils-arping/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/arping $(1)/usr/bin/
+	$(INSTALL_DIR) $(1)/sbin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/arping $(1)/sbin/
 endef
 
 define Package/iputils-clockdiff/install
@@ -152,8 +158,8 @@ define Package/iputils-ping6/install
 endef
 
 define Package/iputils-tftpd/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tftpd $(1)/usr/sbin/
+	$(INSTALL_DIR) $(1)/sbin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tftpd $(1)/sbin/
 endef
 
 define Package/iputils-tracepath/install
@@ -167,8 +173,8 @@ define Package/iputils-tracepath6/install
 endef
 
 define Package/iputils-traceroute6/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/traceroute6 $(1)/usr/bin/
+	$(INSTALL_DIR) $(1)/bin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/traceroute6 $(1)/bin/
 endef
 
 $(eval $(call BuildPackage,iputils-arping))
-- 
2.4.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list