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

platypus: add package #4346

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions lists/to-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
platypus
go-bindata
39 changes: 39 additions & 0 deletions packages/go-bindata/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=go-bindata
pkgver=4.0.2
pkgrel=1
pkgdesc='A small utility which generates Go code from any file.'
arch=('x86_64')
url='https://github.com/kevinburke/go-bindata'
license=('custom:CC0')
depends=('glibc')
makedepends=('go')
source=("$url/archive/refs/tags/v$pkgver.tar.gz")
sha512sums=('4d92510d967bcac7e05eb5fd6e7bb6aa3d90550ac1c72adf56bdfbdd5e9f59703b65d24ec21f9b9f5d1033748b1f911830b177b845405008e6f5c41ab64282b9')

prepare(){
cd "$pkgname-$pkgver"

mkdir -p build/
}

build() {
cd "$pkgname-$pkgver"

export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
go build -o build ./$pkgname
}

package() {
cd "$pkgname-$pkgver"

install -Dm755 "build/$pkgname" "$pkgdir/usr/bin/$pkgname"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

72 changes: 72 additions & 0 deletions packages/platypus/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=platypus
_pkgname=Platypus
pkgver=v1.5.1.r134.g2c1f71b
pkgrel=1
pkgdesc='A modern multiple reverse shell sessions manager written in go.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-backdoor')
url='https://github.com/WangYihang/Platypus'
license=('LGPL3')
depends=('axel' 'unarchiver' 'upx')
makedepends=('git' 'go' 'yarn' 'go-bindata' 'python' 'nodejs')
source=("git+https://github.com/WangYihang/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
cd $_pkgname

( set -o pipefail
git describe --long --tags --abbrev=7 2>/dev/null |
sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "%s.%s" "$(git rev-list --count HEAD)" \
"$(git rev-parse --short=7 HEAD)"
)
}

build() {
cd $_pkgname

cd web/frontend && yarn && yarn build && cd ../../
cd web/ttyd && yarn && yarn build && cd ../../
go-bindata -pkg resource -o ./internal/utils/resource/resource.go ./internal/runtime/... ./web/ttyd/dist/... ./web/frontend/build/...

export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
GOPATH="$srcdir" go mod download
GOPATH="$srcdir" go build \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-s -w" \
-o $pkgname-admin cmd/$pkgname-admin/main.go
GOPATH="$srcdir" go build \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-s -w" \
-o $pkgname-agent cmd/$pkgname-agent/main.go
GOPATH="$srcdir" go build \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-s -w" \
-o $pkgname-server cmd/$pkgname-server/main.go
}

package() {
cd $_pkgname

install -Dm 755 "$pkgname-admin" "$pkgdir/usr/bin/$pkgname-admin"
install -Dm 755 "$pkgname-agent" "$pkgdir/usr/bin/$pkgname-agent"
install -Dm 755 "$pkgname-server" "$pkgdir/usr/bin/$pkgname-server"
install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

Loading