Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 0A44F781745 for <~alpine/aports@lists.alpinelinux.org>; Tue, 12 Apr 2022 18:37:33 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id CEE933200AB0; Tue, 12 Apr 2022 14:37:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 12 Apr 2022 14:37:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=1649788650; x=1649875050; bh=SGW4QViLWkWZxsqBywdlJxjqj u6b2MW3kYxkkIy4GLg=; b=F1Z4wq6yVkZAC+71AURlx3h7Rrg0GK7ONfec9cBnw NQKmu1/3zHAKzW73A7cwFP3ZufFvoE1RZtdKODJ7bARCmgi7gZyACbRgwCOUXu08 vkZjLMwVjuOvNEvTnKtB8fvpxMitPLIb64+Yztay5pAoyDZKutdTd/BnxWZUaXTL vvSwF/S7/681wimbgVvdocgGM8mxtFpG11dy/T81yhBi/Meswe5a40kEcVY1Bm9N S9K1yQx3KYY9A3OfKgn5/RM5Kd+DsuY6CGsra5k/cR+vae0ZqP4eDgLCXLex33tE eTsSpSbIWb05vwlpAvQfaVm9R0R3hmYgAkeDZ/t/XSO/g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1649788650; x=1649875050; bh=S GW4QViLWkWZxsqBywdlJxjqju6b2MW3kYxkkIy4GLg=; b=IPQUcgqztpNfleUvI jIV5AOUvBIMdI3hOa1Sn4I/ihE3WuN0gV/K4YJaX2dw9OlLDeido67btHt1C+XSN 1uP0/SJg89p1JOQ1CCGRItmw+EvS9iOaj4dak00bTlttLmQMKlMXax/8CsxV0fHm 0CSju5qz8iNGSYrE69W5QkypOKQvWuDmz2aqU1cIMIsewi9bQUUlTeBGrb1k+KWZ VLyOvTH3uSFdFZ2E2ObRN3antixltDacvxltWg0ulP6yTh2j+FEDE04U00rA+rf6 tU5s+znuSdefYw7RKdeQNA8FY2tkMuX6SY+wCV92q5qNFjqHij8JGHNtLOwD9Gf8 Omi5Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekkedguddvjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpeeuvghnucghvghishhsuceosgdrfigvihhsshesfhgrshhtmhgr ihhlrdhfmheqnecuggftrfgrthhtvghrnhepkeevhfekfeeuffegleffieeuhfevudeike eugeefveeuudelheejiefhtdetvddvnecuffhomhgrihhnpehsohhfthgvthhhvghrrdho rhhgpdhgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegsrdifvghishhssehfrghsthhmrghilhdrfhhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Apr 2022 14:37:29 -0400 (EDT) From: Ben Weiss To: ~alpine/aports@lists.alpinelinux.org Cc: Ben Weiss Subject: [PATCH v3] testing/softether: new aport Date: Tue, 12 Apr 2022 18:35:57 +0000 Message-Id: <20220412183557.11818-1-b.weiss@fastmail.fm> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit https://www.softether.org Softether VPN client and server --- Changes v2 -> v3: -Patch Makefile to respect DESTDIR -Now that that works, APKBUILD now uses amove() to put subpackage files in proper locations --- testing/softether/APKBUILD | 51 ++++++++--------------- testing/softether/Makefile.patch | 70 ++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 33 deletions(-) create mode 100644 testing/softether/Makefile.patch diff --git a/testing/softether/APKBUILD b/testing/softether/APKBUILD index 623f255d4f..47ad727915 100644 --- a/testing/softether/APKBUILD +++ b/testing/softether/APKBUILD @@ -20,7 +20,8 @@ source="https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v$ vpnclient.initd vpnserver.initd vpnbridge.initd - configure.patch" + configure.patch + Makefile.patch" builddir="$srcdir/v$pkgver-$_buildnumber" options="!check" #no tests are implemented subpackages=" @@ -29,64 +30,47 @@ subpackages=" $pkgname-bridge $pkgname-openrc" -build() { +prepare() { + #need to run configure to create the Makefile, _then_ patch the Makefile ./configure - make + default_prepare +} +build() { + make } -#default make install is inflexible, and installs everything. So not using stock make install. #base installs only libraries and management utility- then server, client, or bridge can be installed as desired seperately. -#these subpackage entries basically duplicate the relevant install sections in the original makefile (which cannot be called independantly) package() { pkgdesc="$pkgdesc main library and configuration utility" - mkdir -p "$pkgdir"/usr/vpncmd - mkdir -p "$pkgdir"/usr/bin - _build_binfile cmd "$pkgdir" + make DESTDIR="$pkgdir" install } client() { pkgdesc="$pkgdesc client" depends="$depends softether" - mkdir -p "$subpkgdir"/usr/vpnclient - mkdir -p "$subpkgdir"/usr/bin - mkdir -p "$pkgdir"/etc/init.d - _build_binfile "$subpkgname" "$subpkgdir" + echo $pkgdir + echo $subpkgdir + amove "usr/vpnclient/*" + amove "usr/bin/vpnclient" install -Dm755 "$srcdir"/vpnclient.initd "$pkgdir"/etc/init.d/vpnclient - } server() { pkgdesc="$pkgdesc server" depends="$depends softether" - mkdir -p "$subpkgdir"/usr/vpnserver - mkdir -p "$subpkgdir"/usr/bin - mkdir -p "$pkgdir"/etc/init.d - _build_binfile "$subpkgname" "$subpkgdir" + amove "usr/vpnserver/*" + amove "usr/bin/vpnserver" install -Dm755 "$srcdir"/vpnserver.initd "$pkgdir"/etc/init.d/vpnserver - } bridge() { pkgdesc="$pkgdesc bridge" depends="$depends softether" - mkdir -p "$subpkgdir"/usr/vpnbridge - mkdir -p "$subpkgdir"/usr/bin - mkdir -p "$pkgdir"/etc/init.d - _build_binfile "$subpkgname" "$subpkgdir" + amove "usr/vpnbridge/*" + amove "usr/bin/vpnbridge" install -Dm755 "$srcdir"/vpnbridge.initd "$pkgdir"/etc/init.d/vpnbridge - -} - -_build_binfile() { - _component="${1##*-}" - cp "$builddir"/bin/vpn$_component/hamcore.se2 "$2"/usr/vpn$_component - cp "$builddir"/bin/vpn$_component/vpn$_component "$2"/usr/vpn$_component - echo "#!/bin/sh" > "$2"/usr/bin/vpn$_component - echo /usr/vpn$_component/vpn$_component '"$@"' >> "$2"/usr/bin/vpn$_component - echo 'exit $?' >> "$2"/usr/bin/vpn$_component - chmod 755 "$2"/usr/bin/vpn$_component } sha512sums=" @@ -95,4 +79,5 @@ sha512sums=" d511a56418d46ca75dfb61b73850f70ed161a1129397ef6f68938004bce54540196c8e7e56a1ef8402293b81eac1a54b98220a9b2926e6a1df719d22c47cf1c3 vpnserver.initd a52e1d9b535957df3c0abda34d75d367f5d83278009fdad58c43cf71557cd1901039e216dda00b23cc2bbef8de14a33f5cc04d6ab3ac247b9113bf2273dfb1f6 vpnbridge.initd a935d7a5fcfb0794534cfbfe65fc5993f0e667303fe2caed9daa8ab020622e75ded9af971378707aed231f9b24f2b727327a8ca9cb2f5180c2889bf8d2855686 configure.patch +cf9c2608795b41252b06c2a0308a85107bad2620e41a92ef4f1794a4c6e5e74f41926d5c05bafa8e4285ccca994d67f14174f1632f036a5c70be87f9f8693953 Makefile.patch " diff --git a/testing/softether/Makefile.patch b/testing/softether/Makefile.patch new file mode 100644 index 0000000000..9ecc25b28b --- /dev/null +++ b/testing/softether/Makefile.patch @@ -0,0 +1,70 @@ +--- a/Makefile 2021-08-17 13:50:52.000000000 +0000 ++++ b/Makefile 2022-04-06 17:42:59.049551598 +0000 +@@ -70,11 +70,15 @@ OPTIONS_COMPILE_RELEASE=-DNDEBUG -DVPN_S + + OPTIONS_LINK_RELEASE=-O2 -fsigned-char -m64 -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz + +-INSTALL_BINDIR=/usr/bin/ +-INSTALL_VPNSERVER_DIR=/usr/vpnserver/ +-INSTALL_VPNBRIDGE_DIR=/usr/vpnbridge/ +-INSTALL_VPNCLIENT_DIR=/usr/vpnclient/ +-INSTALL_VPNCMD_DIR=/usr/vpncmd/ ++INSTALL_BINDIR=$(DESTDIR)/usr/bin/ ++INSTALL_VPNSERVER_DIR=$(DESTDIR)/usr/vpnserver/ ++INSTALL_VPNBRIDGE_DIR=$(DESTDIR)/usr/vpnbridge/ ++INSTALL_VPNCLIENT_DIR=$(DESTDIR)/usr/vpnclient/ ++INSTALL_VPNCMD_DIR=$(DESTDIR)/usr/vpncmd/ ++SCRIPT_INSTALL_VPNSERVER_DIR=/usr/vpnserver/ ++SCRIPT_INSTALL_VPNBRIDGE_DIR=/usr/vpnbridge/ ++SCRIPT_INSTALL_VPNCLIENT_DIR=/usr/vpnclient/ ++SCRIPT_INSTALL_VPNCMD_DIR=/usr/vpncmd/ + + ifeq ($(DEBUG),YES) + OPTIONS_COMPILE=$(OPTIONS_COMPILE_DEBUG) +@@ -429,38 +433,42 @@ install: $(INSTALL_BINDIR)vpnserver $(IN + @echo + + $(INSTALL_BINDIR)vpnserver: bin/vpnserver/hamcore.se2 bin/vpnserver/vpnserver ++ @mkdir -p $(INSTALL_BINDIR) + @mkdir -p $(INSTALL_VPNSERVER_DIR) + cp bin/vpnserver/hamcore.se2 $(INSTALL_VPNSERVER_DIR)hamcore.se2 + cp bin/vpnserver/vpnserver $(INSTALL_VPNSERVER_DIR)vpnserver + echo "#!/bin/sh" > $(INSTALL_BINDIR)vpnserver +- echo $(INSTALL_VPNSERVER_DIR)vpnserver '"$$@"' >> $(INSTALL_BINDIR)vpnserver ++ echo $(SCRIPT_INSTALL_VPNSERVER_DIR)vpnserver '"$$@"' >> $(INSTALL_BINDIR)vpnserver + echo 'exit $$?' >> $(INSTALL_BINDIR)vpnserver + chmod 755 $(INSTALL_BINDIR)vpnserver + + $(INSTALL_BINDIR)vpnbridge: bin/vpnbridge/hamcore.se2 bin/vpnbridge/vpnbridge ++ @mkdir -p $(INSTALL_BINDIR) + @mkdir -p $(INSTALL_VPNBRIDGE_DIR) + cp bin/vpnbridge/hamcore.se2 $(INSTALL_VPNBRIDGE_DIR)hamcore.se2 + cp bin/vpnbridge/vpnbridge $(INSTALL_VPNBRIDGE_DIR)vpnbridge + echo "#!/bin/sh" > $(INSTALL_BINDIR)vpnbridge +- echo $(INSTALL_VPNBRIDGE_DIR)vpnbridge '"$$@"' >> $(INSTALL_BINDIR)vpnbridge ++ echo $(SCRIPT_INSTALL_VPNBRIDGE_DIR)vpnbridge '"$$@"' >> $(INSTALL_BINDIR)vpnbridge + echo 'exit $$?' >> $(INSTALL_BINDIR)vpnbridge + chmod 755 $(INSTALL_BINDIR)vpnbridge + + $(INSTALL_BINDIR)vpnclient: bin/vpnclient/hamcore.se2 bin/vpnclient/vpnclient ++ @mkdir -p $(INSTALL_BINDIR) + @mkdir -p $(INSTALL_VPNCLIENT_DIR) + cp bin/vpnclient/hamcore.se2 $(INSTALL_VPNCLIENT_DIR)hamcore.se2 + cp bin/vpnclient/vpnclient $(INSTALL_VPNCLIENT_DIR)vpnclient + echo "#!/bin/sh" > $(INSTALL_BINDIR)vpnclient +- echo $(INSTALL_VPNCLIENT_DIR)vpnclient '"$$@"' >> $(INSTALL_BINDIR)vpnclient ++ echo $(SCRIPT_INSTALL_VPNCLIENT_DIR)vpnclient '"$$@"' >> $(INSTALL_BINDIR)vpnclient + echo 'exit $$?' >> $(INSTALL_BINDIR)vpnclient + chmod 755 $(INSTALL_BINDIR)vpnclient + + $(INSTALL_BINDIR)vpncmd: bin/vpncmd/hamcore.se2 bin/vpncmd/vpncmd ++ @mkdir -p $(INSTALL_BINDIR) + @mkdir -p $(INSTALL_VPNCMD_DIR) + cp bin/vpncmd/hamcore.se2 $(INSTALL_VPNCMD_DIR)hamcore.se2 + cp bin/vpncmd/vpncmd $(INSTALL_VPNCMD_DIR)vpncmd + echo "#!/bin/sh" > $(INSTALL_BINDIR)vpncmd +- echo $(INSTALL_VPNCMD_DIR)vpncmd '"$$@"' >> $(INSTALL_BINDIR)vpncmd ++ echo $(SCRIPT_INSTALL_VPNCMD_DIR)vpncmd '"$$@"' >> $(INSTALL_BINDIR)vpncmd + echo 'exit $$?' >> $(INSTALL_BINDIR)vpncmd + chmod 755 $(INSTALL_BINDIR)vpncmd + -- 2.34.1