From 9e905faff0e9e7bb077ab41b0ed74a1c27b63ff6 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Sun, 8 Jan 2023 09:43:25 +0200 Subject: [PATCH] Try to build a single package: add feeds --- .buildbot/openwrt/Dockerfile | 5 +- .buildbot/openwrt/build.sh | 31 ++++++++++-- feed/asterisk-chan-quectel/Makefile | 74 +++++++++++++++++++++++++++++ feeds.conf | 4 ++ 4 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 feed/asterisk-chan-quectel/Makefile create mode 100644 feeds.conf diff --git a/.buildbot/openwrt/Dockerfile b/.buildbot/openwrt/Dockerfile index 843a6e0..876653d 100644 --- a/.buildbot/openwrt/Dockerfile +++ b/.buildbot/openwrt/Dockerfile @@ -8,7 +8,7 @@ RUN DEBIAN_FRONTEND=noninteractive TZ=UTC \ apt -yq install \ build-essential rsync git-core subversion mercurial libssl-dev \ libncurses5-dev unzip gawk zlib1g-dev libncursesw5-dev zlib1g-dev \ - gettext xsltproc wget unzip python + gettext xsltproc wget unzip python python3-distutils rxvt-unicode RUN mkdir /Downloads @@ -18,3 +18,6 @@ RUN wget -qP /Downloads \ "https://downloads.openwrt.org/releases/${OPENWRT_VERSION}/targets/bcm27xx/bcm2711/openwrt-sdk-${OPENWRT_VERSION}-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64.tar.xz" RUN wget -qP /Downloads \ "https://downloads.openwrt.org/releases/${OPENWRT_VERSION}/targets/bcm27xx/bcm2711/openwrt-toolchain-${OPENWRT_VERSION}-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64.tar.xz" + +RUN git clone https://git.openwrt.org/openwrt/openwrt.git +RUN cd openwrt && git checkout v${OPENWRT_VERSION} diff --git a/.buildbot/openwrt/build.sh b/.buildbot/openwrt/build.sh index 5bbcda7..2f3b206 100755 --- a/.buildbot/openwrt/build.sh +++ b/.buildbot/openwrt/build.sh @@ -12,7 +12,31 @@ ls -lah /Downloads # https://github.com/IchthysMaranatha/asterisk-chan-quectel/tree/master/openwrt tar -xJf /Downloads/openwrt-imagebuilder-${OPENWRT_VERSION}-*.tar.xz -cd openwrt-imagebuilder-*/ + +cp -r feed /openwrt/ +cp feeds.conf /openwrt/ + +cd openwrt + +git checkout v${OPENWRT_VERSION} +cp ../feeds.conf . +cp ../config.buildinfo .config +./scripts/feeds update -a +./scripts/feeds install -a + +export FORCE_UNSAFE_CONFIGURE=1 +make defconfig +make tools/install +make toolchain/install + +opkg info asterisk-chan-quectel + +make package/asterisk-chan-quectel/compile +make package/index + +mv bin/*.ipk ../openwrt-imagebuilder-*/packages/ + +cd ../openwrt-imagebuilder-*/ make info @@ -24,8 +48,9 @@ make image \ kmod-usb-net-qmi-wwan libqmi qmi-utils uqmi luci-proto-qmi \ asterisk \ asterisk-pjsip asterisk-bridge-simple \ - asterisk-codec-alaw asterisk-codec-ulaw \ - asterisk-res-rtp-asterisk kmod-nf-nathelper-extra" + asterisk-codec-alaw asterisk-codec-ulaw \ + asterisk-res-rtp-asterisk kmod-nf-nathelper-extra \ + asterisk-chan-quectel" mkdir -p ../../out diff --git a/feed/asterisk-chan-quectel/Makefile b/feed/asterisk-chan-quectel/Makefile new file mode 100644 index 0000000..6a31b80 --- /dev/null +++ b/feed/asterisk-chan-quectel/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2017 - 2023 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=asterisk-chan-quectel +PKG_VERSION:=3.6 +PKG_RELEASE:=3.6 + +PKG_SOURCE:=master.zip +PKG_SOURCE_URL:=https://github.com/IchthysMaranatha/asterisk-chan-quectel/archive/refs/heads/ +PKG_CAT:=unzip +PKG_HASH:=skip +PKG_FIXUP:=autoreconf +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-master +PKG_MAINTAINER:=Lee Miller +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYRIGHT.txt LICENSE.txt + + +MODULES_DIR:=/usr/lib/asterisk/modules + +include $(INCLUDE_DIR)/package.mk +# asterisk-chan-quectel needs iconv +include $(INCLUDE_DIR)/nls.mk + +define Package/asterisk-chan-quectel + SUBMENU:=Telephony + SECTION:=net + CATEGORY:=Network + URL:=https://github.com/IchthysMaranatha/asterisk-chan-quectel + DEPENDS:=asterisk $(ICONV_DEPENDS) +kmod-usb-acm +kmod-usb-serial +kmod-usb-serial-option +libusb-1.0 +alsa-lib + TITLE:=Asterisk Mobile Telephony Module +endef + +define Package/asterisk-chan-quectel/description + Asterisk channel driver for mobile telephony. +endef + + +CONFIGURE_ARGS+= \ + --with-asterisk=$(STAGING_DIR)/usr/include \ + --with-astversion=20 \ + --with-iconv=$(ICONV_PREFIX)/include + +TARGET_CFLAGS+= \ + -I$(CHAN_quectel_AST_HEADERS) + +MAKE_FLAGS+=LD="$(TARGET_CC)" + +CONFIGURE_VARS += \ + DESTDIR="$(MODULES_DIR)" \ + ac_cv_type_size_t=yes \ + ac_cv_type_ssize_t=yes + + +define Package/asterisk-chan-quectel/conffiles + /etc/asterisk/quectel.conf +endef + + +define Package/asterisk-chan-quectel/install + $(INSTALL_DIR) $(1)/etc/asterisk + $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/quectel.conf $(1)/etc/asterisk + $(INSTALL_DIR) $(1)$(MODULES_DIR) + $(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_quectel.so $(1)$(MODULES_DIR) +endef + + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/feeds.conf b/feeds.conf new file mode 100644 index 0000000..84ac52e --- /dev/null +++ b/feeds.conf @@ -0,0 +1,4 @@ +src-git packages https://github.com/openwrt/packages.git +src-git luci https://github.com/openwrt/luci.git +src-git telephony https://github.com/openwrt/telephony.git +src-link quectel ../feed