From d8c9ff5727c2632da3cfa573c339827407a188a2 Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Wed, 11 Oct 2023 22:33:04 +0800 Subject: [PATCH] mtr: update Makefile --- trunk/user/mtr/.gitignore | 2 - trunk/user/mtr/Makefile | 50 +++++-------------- .../100-fix-ncurses-lib.patch} | 0 3 files changed, 12 insertions(+), 40 deletions(-) delete mode 100644 trunk/user/mtr/.gitignore rename trunk/user/mtr/{100-fix-ncurses-lib.diff => patches/100-fix-ncurses-lib.patch} (100%) diff --git a/trunk/user/mtr/.gitignore b/trunk/user/mtr/.gitignore deleted file mode 100644 index 38dfefad3af..00000000000 --- a/trunk/user/mtr/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -mtr-*/ -mtr-*.tar.gz \ No newline at end of file diff --git a/trunk/user/mtr/Makefile b/trunk/user/mtr/Makefile index f4d9738aaba..2aa3fedc442 100644 --- a/trunk/user/mtr/Makefile +++ b/trunk/user/mtr/Makefile @@ -1,46 +1,20 @@ -#https://github.com/traviscross/mtr -SRC_NAME = mtr-0.95 -SRC_URL = https://github.com/traviscross/mtr/archive/refs/tags/v0.95.tar.gz -THISDIR = $(shell pwd) +include $(ROOTDIR)/rules.mk -all: download_test extract_test config_test - $(MAKE) -j$(HOST_NCPU) -C $(SRC_NAME) +PKG_NAME:=mtr +PKG_VERSION:=0.95 -download_test: - ( if [ ! -f $(SRC_NAME).tar.gz ]; then \ - wget -t5 --timeout=20 --no-check-certificate -O $(SRC_NAME).tar.gz $(SRC_URL); \ - fi ) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/traviscross/mtr/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=12490fb660ba5fb34df8c06a0f62b4f9cbd11a584fc3f6eceda0a99124e8596f -extract_test: - ( if [ ! -d $(SRC_NAME) ]; then \ - tar xf $(SRC_NAME).tar.gz; \ - cd $(SRC_NAME) ; \ - patch -p1 -i ../100-fix-ncurses-lib.diff ; \ - fi ) +PKG_FIXUP:=autoreconf -config_test: - ( if [ -f ./config_done ]; then \ - echo "the same configuration"; \ - else \ - make configure && touch config_done; \ - fi ) +include $(INCLUDE_DIR)/package.mk -configure: - ( cd $(SRC_NAME) ; \ - ./bootstrap.sh ; \ - ./configure \ - --prefix=/usr \ - --without-gtk \ - --host=$(HOST_TARGET) \ - --build=$(HOST_BUILD) ; \ - ) +CONFIGURE_ARGS += --without-gtk -clean: - if [ -f $(SRC_NAME)/Makefile ] ; then \ - $(MAKE) -C $(SRC_NAME) distclean ; \ - fi ; \ - rm -f config_done +$(eval $(call BuildPackage,mtr)) romfs: - $(ROMFSINST) -p +x $(THISDIR)/$(SRC_NAME)/mtr /usr/bin/mtr - $(ROMFSINST) -p +x $(THISDIR)/$(SRC_NAME)/mtr-packet /usr/bin/mtr-packet + $(INSTALL_DIR) $(ROMFSDIR)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mtr $(ROMFSDIR)/usr/bin/mtr diff --git a/trunk/user/mtr/100-fix-ncurses-lib.diff b/trunk/user/mtr/patches/100-fix-ncurses-lib.patch similarity index 100% rename from trunk/user/mtr/100-fix-ncurses-lib.diff rename to trunk/user/mtr/patches/100-fix-ncurses-lib.patch