Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package wg-netns #34

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
- package-subfinder
- package-tlsx
- package-trevorspray
- package-wg-netns
concurrency: ci-${{ github.ref }}
steps:
- name: Checkout
Expand Down Expand Up @@ -1184,3 +1185,21 @@ jobs:
path: ./trevorspray/*.pkg.tar.zst
retention-days: 1
if-no-files-found: error
package-wg-netns:
runs-on: ubuntu-20.04
needs:
- build-container
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build package
run: ./build-package.sh wg-netns
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: package-wg-netns
path: ./wg-netns/*.pkg.tar.zst
retention-days: 1
if-no-files-found: error
31 changes: 31 additions & 0 deletions wg-netns/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
pkgname=wg-netns
pkgver=latest
pkgrel=1
url="https://github.com/dadevel/${pkgname}.git"
arch=(any)
license=(MIT)
depends=(python)
source=("git+${url}")
sha256sums=(SKIP)

package() {
cd "${srcdir}/${pkgname}"
mkdir -p "${pkgdir}/opt/archpkgs/bin" "${pkgdir}/opt/archpkgs/${pkgname}"
python -m venv "${pkgdir}/opt/archpkgs/${pkgname}"
declare -x VIRTUAL_ENV="${pkgdir}/opt/archpkgs/${pkgname}" PYTHONPATH="${pkgdir}/opt/archpkgs/${pkgname}" PATH="${pkgdir}/opt/archpkgs/${pkgname}/bin:$PATH"
pip install .
cat <<EOF >"${pkgdir}/opt/archpkgs/bin/${pkgname}"
#!/bin/sh
set -eu
export VIRTUAL_ENV=/opt/archpkgs/${pkgname} PYTHONPATH=/opt/archpkgs/${pkgname} PATH="/opt/archpkgs/${pkgname}/bin:\$PATH"
exec python /opt/archpkgs/${pkgname}/bin/wg-netns "\$@"
EOF
chmod +x "${pkgdir}/opt/archpkgs/bin/${pkgname}"
sed -i -e 's|=wg-netns|=/opt/archpkgs/bin/wg-netns|' ./extras/wg-netns@.service
install -Dm644 ./extras/wg-netns@.service "${pkgdir}/usr/lib/systemd/system/wg-netns@.service"
}

pkgver() {
cd "${srcdir}/${pkgname}"
echo "$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}