From 3363e6e06dee366ce2acb95da63d1b35f1ddfef0 Mon Sep 17 00:00:00 2001 From: zxlhhyccc <45259624+zxlhhyccc@users.noreply.github.com> Date: Thu, 23 Mar 2023 23:29:54 +0800 Subject: [PATCH] adapt new rust build standard --- contrib/openwrt/Makefile | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/contrib/openwrt/Makefile b/contrib/openwrt/Makefile index 99253f9b..90c227ef 100644 --- a/contrib/openwrt/Makefile +++ b/contrib/openwrt/Makefile @@ -12,8 +12,8 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/mokeyish/smartdns-rs.git -PKG_SOURCE_VERSION:=9a4691e224c418d9474aa74a890a92d7d62f151d -PKG_MIRROR_HASH:=abe9b00da257fa5f7607cc72d7f0798ed6ce5ab8c7b79599442adfe6172aa9e3 +PKG_SOURCE_VERSION:=e96c4577e8cff1ff810e96e93eb7dba9bbd25353 +PKG_MIRROR_HASH:=a653849bf7f6962270f73f9cb5554c1d0e2cd4afd05764e5c9de1d860e8bb405 PKG_MAINTAINER:=Zxlhhyccc PKG_LICENSE:=MIT @@ -23,43 +23,30 @@ PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=rust/host +RUST_PKG:=smartdns + include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/rust/rust-package.mk -define Package/smartdns-rust/Default - define Package/smartdns-rust +define Package/smartdns-rust SECTION:=net CATEGORY:=Network SUBMENU:=Web Servers/Proxies TITLE:=smartdns-rust server URL:=https://github.com/mokeyish/smartdns-rs.git DEPENDS:=$$(RUST_ARCH_DEPENDS) - endef +endef - define Package/smartdns-rust/description +define Package/smartdns-rust/description A cross platform local DNS server (Dnsmasq like) written in rust to obtain the fastest website IP for the best Internet experience, supports DoT, DoH. - endef - - define Package/smartdns-rust/install - $$(INSTALL_DIR) $$(1)/usr/sbin - $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/bin/smartdns $$(1)/usr/sbin/ - - $$(INSTALL_DIR) $$(1)/etc/init.d - $$(INSTALL_BIN) $(CURDIR)/conf/smartdns.init $$(1)/etc/init.d/smartdns - endef endef -define smartdns-rust/templates - $(foreach smartdns,smartdns, - $(call Package/smartdns-rust/Default,smartdns) - ) -endef -$(eval $(call smartdns-rust/templates)) +define Package/smartdns-rust/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/target/$(RUSTC_TARGET_ARCH)/stripped/smartdns $(1)/usr/sbin/ -define Build/Compile - $(call Build/Compile/Cargo,, smartdns) + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(CURDIR)/conf/smartdns.init $(1)/etc/init.d/smartdns endef -$(foreach smartdns,smartdns, \ - $(eval $(call BuildPackage,smartdns-rust)) \ -) +$(eval $(call BuildPackage,smartdns-rust))