|
| 1 | +# |
| 2 | +# Copyright (C) 2023 Jó Ágila Bitsch |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: GPL-2.0-only |
| 5 | + |
| 6 | +include $(TOPDIR)/rules.mk |
| 7 | + |
| 8 | +PKG_NAME:=aoa-proxy |
| 9 | +PKG_VERSION:=0.2.2 |
| 10 | +PKG_RELEASE:=1 |
| 11 | + |
| 12 | +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 13 | +PKG_SOURCE_URL:=https://github.com/jo-bitsch/aoa-proxy/archive/refs/tags/v$(PKG_VERSION).tar.gz? |
| 14 | +PKG_HASH:=28501cacd03d274077428c69edbbdc54855be68b77ea7d8359895009889d2631 |
| 15 | + |
| 16 | +PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone libb64 |
| 17 | + |
| 18 | +PKG_MAINTAINER:=Jó Ágila Bitsch <jgilab@gmail.com> |
| 19 | +PKG_LICENSE:=BSD-3-Clause |
| 20 | +PKG_LICENSE_FILES:=LICENSE |
| 21 | + |
| 22 | +include $(INCLUDE_DIR)/package.mk |
| 23 | + |
| 24 | +MAKE_FLAGS+= \ |
| 25 | + GIT_VERSION="v$(PKG_VERSION)" |
| 26 | + |
| 27 | +# experimental fix for b64 size_t redefinition issue |
| 28 | +TARGET_CFLAGS += -DHAVE_SIZE_T |
| 29 | + |
| 30 | +define Package/aoa-proxy |
| 31 | + SECTION:=utils |
| 32 | + CATEGORY:=Utilities |
| 33 | + TITLE:=Interact with Android devices using AOA |
| 34 | + URL:=https://github.com/jo-bitsch/aoa-proxy |
| 35 | + DEPENDS:=+libusb-1.0 +libb64 +!USE_GLIBC:argp-standalone |
| 36 | +endef |
| 37 | + |
| 38 | +define Package/aoa-proxy/description |
| 39 | + This program aims to make working with Android Open Accessory (in |
| 40 | + particular v1) as easy as possible. |
| 41 | + It has 2 modes, depending on the state of the attached Android device. |
| 42 | + (1) Announce mode: When the Android device is not yet in AOA mode, this |
| 43 | + program announces its identity to the Android device and tries to |
| 44 | + put it into AOA mode. |
| 45 | + (2) Forwarding mode: Forward all input from stdin to the AOA device and |
| 46 | + all output from AOA to stdout. |
| 47 | + For OpenWrt, it includes a hotplug script and a service to automatically |
| 48 | + announce itself and forward AOA traffic to SSH/dropbear. |
| 49 | +endef |
| 50 | + |
| 51 | +define Package/aoa-proxy/install |
| 52 | + $(INSTALL_DIR) $(1)/usr/sbin |
| 53 | + $(INSTALL_BIN) $(PKG_BUILD_DIR)/aoa-proxy $(1)/usr/sbin |
| 54 | + $(INSTALL_DIR) $(1)/etc/hotplug.d/usb |
| 55 | + $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/etc/hotplug.d/usb/99-aoa-proxy $(1)/etc/hotplug.d/usb |
| 56 | + $(INSTALL_DIR) $(1)/etc/init.d |
| 57 | + $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/etc/init.d/aoa-proxy-forward $(1)/etc/init.d |
| 58 | +endef |
| 59 | + |
| 60 | +$(eval $(call BuildPackage,aoa-proxy)) |
0 commit comments