|
| 1 | +# |
| 2 | +# Copyright (C) 2017-2018 Justin Kilpatrick, Openwrt.org |
| 3 | +# |
| 4 | +# This is free software, licensed under the GNU General Public License v2. |
| 5 | +# See /LICENSE for more information. |
| 6 | +# |
| 7 | + |
| 8 | +# you must set $RUST_TRIPLE in your env |
| 9 | +include $(TOPDIR)/rules.mk |
| 10 | + |
| 11 | +PKG_NAME:=rita-extender |
| 12 | +PKG_VERSION:=0.20.8 |
| 13 | +PKG_RELEASE:=0 |
| 14 | + |
| 15 | +PKG_SOURCE_PROTO:=git |
| 16 | +PKG_SOURCE_URL:=https://github.com/althea-net/althea_rs |
| 17 | +PKG_SOURCE_VERSION:=a5a715be81e0b4060a7fe6a87e462e1964020420 |
| 18 | +PKG_LICENSE:=Apache-2.0 |
| 19 | + |
| 20 | +include $(INCLUDE_DIR)/package.mk |
| 21 | + |
| 22 | +define Package/rita-extender |
| 23 | + SECTION:=net |
| 24 | + CATEGORY:=Utilities |
| 25 | + SUBMENU:=Althea |
| 26 | + TITLE:=Althea Rita Extender |
| 27 | + URL:=https://github.com/althea-net/althea_rs |
| 28 | + MAINTAINER:= Justin Kilpatrick <justin@althea.net> |
| 29 | + DEPENDS:=@IPV6 +ca-bundle +ca-certificates +kmod-sched-cake +tc |
| 30 | + PKG_BUILD_DEPENDS:=openssl |
| 31 | +endef |
| 32 | + |
| 33 | +define Package/rita-extender/description |
| 34 | + Althea Rita Extender |
| 35 | +endef |
| 36 | + |
| 37 | +RITA_PATH:="$(PKG_BUILD_DIR)/target/$(RUST_TRIPLE)/release/rita_extender" |
| 38 | + |
| 39 | +define Build/Compile |
| 40 | + (\ |
| 41 | + cd $(PKG_BUILD_DIR) && \ |
| 42 | + cargo install cross && \ |
| 43 | + cross build --release --target $(RUST_TRIPLE) -p rita_bin --bin rita_extender \ |
| 44 | + ) |
| 45 | + $(STRIP) $(RITA_PATH) |
| 46 | +endef |
| 47 | + |
| 48 | +define Package/rita-extender/install |
| 49 | + $(INSTALL_DIR) $(1)/usr/sbin |
| 50 | + $(INSTALL_BIN) $(RITA_PATH) $(1)/usr/sbin/rita_extender |
| 51 | + $(INSTALL_DIR) $(1)/etc/init.d |
| 52 | + $(INSTALL_BIN) ./files/rita_extender.init $(1)/etc/init.d/rita_extender |
| 53 | + $(INSTALL_DIR) $(1)/etc/crontabs/ |
| 54 | + $(CP) ./files/checkup.ash $(1)/etc/ |
| 55 | + $(CP) ./files/root $(1)/etc/crontabs/ |
| 56 | +endef |
| 57 | + |
| 58 | +$(eval $(call BuildPackage,rita-extender)) |
0 commit comments