- Uses python312 from AUR for jpegio 3.13 compatibility - Self-contained venv in /opt/stegasoo - Includes systemd service files for web and API - CLI symlinked to /usr/bin/stegasoo Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
105 lines
2.7 KiB
Bash
105 lines
2.7 KiB
Bash
# Maintainer: Aaron D. Lee <your-email@example.com>
|
|
pkgname=stegasoo-git
|
|
pkgver=4.2.0.r0.g0000000
|
|
pkgrel=1
|
|
pkgdesc="Secure steganography with hybrid photo + passphrase + PIN authentication"
|
|
arch=('x86_64')
|
|
url="https://github.com/adlee-was-taken/stegasoo"
|
|
license=('MIT')
|
|
|
|
# Use python312 from AUR to future-proof against 3.13 (jpegio compatibility)
|
|
depends=(
|
|
'python312'
|
|
)
|
|
makedepends=(
|
|
'git'
|
|
'python312'
|
|
)
|
|
optdepends=(
|
|
'zbar: QR code reading from webcam/images'
|
|
)
|
|
provides=('stegasoo')
|
|
conflicts=('stegasoo')
|
|
source=("${pkgname}::git+https://github.com/adlee-was-taken/stegasoo.git#branch=main")
|
|
sha256sums=('SKIP')
|
|
|
|
pkgver() {
|
|
cd "$pkgname"
|
|
git describe --long --tags 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' || \
|
|
printf "%s.r%s.g%s" "4.2.0" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
|
}
|
|
|
|
build() {
|
|
cd "$pkgname"
|
|
|
|
# Create venv with python3.12
|
|
python3.12 -m venv --system-site-packages "$srcdir/venv"
|
|
source "$srcdir/venv/bin/activate"
|
|
|
|
# Install build deps
|
|
pip install --upgrade pip wheel hatchling build
|
|
|
|
# Build wheel
|
|
python -m build --wheel --no-isolation
|
|
}
|
|
|
|
package() {
|
|
cd "$pkgname"
|
|
|
|
# Install to /opt/stegasoo with dedicated venv
|
|
install -dm755 "$pkgdir/opt/stegasoo"
|
|
|
|
# Create fresh venv in package
|
|
python3.12 -m venv "$pkgdir/opt/stegasoo/venv"
|
|
|
|
# Install the wheel with all extras
|
|
"$pkgdir/opt/stegasoo/venv/bin/pip" install --no-cache-dir dist/*.whl[all]
|
|
|
|
# Create symlinks to /usr/bin
|
|
install -dm755 "$pkgdir/usr/bin"
|
|
ln -s /opt/stegasoo/venv/bin/stegasoo "$pkgdir/usr/bin/stegasoo"
|
|
|
|
# Install license
|
|
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
|
|
|
# Install docs
|
|
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
|
|
|
|
# Install systemd service files (optional)
|
|
install -Dm644 /dev/stdin "$pkgdir/usr/lib/systemd/system/stegasoo-web.service" <<EOF
|
|
[Unit]
|
|
Description=Stegasoo Web UI
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=stegasoo
|
|
Environment="PATH=/opt/stegasoo/venv/bin"
|
|
WorkingDirectory=/opt/stegasoo/venv/lib/python3.12/site-packages/frontends/web
|
|
ExecStart=/opt/stegasoo/venv/bin/gunicorn -b 127.0.0.1:5000 app:app
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
|
|
install -Dm644 /dev/stdin "$pkgdir/usr/lib/systemd/system/stegasoo-api.service" <<EOF
|
|
[Unit]
|
|
Description=Stegasoo REST API
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=stegasoo
|
|
Environment="PATH=/opt/stegasoo/venv/bin"
|
|
WorkingDirectory=/opt/stegasoo/venv/lib/python3.12/site-packages/frontends/api
|
|
ExecStart=/opt/stegasoo/venv/bin/uvicorn main:app --host 127.0.0.1 --port 8000
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
}
|