Migrate from jpegio to jpeglib for Python 3.13+ support
- Replace jpegio with jpeglib (jpeglib.to_jpegio compatibility layer)
- Update Python requirement to >=3.11, add 3.13/3.14 classifiers
- AUR: Add install script for user creation and permissions
- AUR: Install frontends to site-packages, create Flask instance dir
- AUR: Use dynamic ${pyver} for systemd WorkingDirectory
Tested: CLI, Web UI (Gunicorn), API (Uvicorn), DCT jpeglib roundtrip
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
42
aur/PKGBUILD
42
aur/PKGBUILD
@@ -1,31 +1,31 @@
|
||||
# Maintainer: Aaron D. Lee <your-email@example.com>
|
||||
pkgname=stegasoo-git
|
||||
pkgver=4.1.7.r0.g1acb5a3
|
||||
pkgver=4.2.0.r0.g530e5de
|
||||
pkgrel=1
|
||||
pkgdesc="Secure steganography with hybrid photo + passphrase + PIN authentication"
|
||||
arch=('x86_64')
|
||||
url="https://github.com/adlee-was-taken/stegasoo"
|
||||
license=('MIT')
|
||||
|
||||
# NOTE: Requires Python 3.12 (jpegio not compatible with 3.13 yet)
|
||||
# Python 3.11-3.14 supported (uses jpeglib for modern Python compatibility)
|
||||
depends=(
|
||||
'python312' # AUR package - jpegio requires 3.12
|
||||
'python>=3.11'
|
||||
)
|
||||
makedepends=(
|
||||
'git'
|
||||
'python312'
|
||||
'python'
|
||||
'python-build'
|
||||
'python-hatchling'
|
||||
)
|
||||
optdepends=(
|
||||
'zbar: QR code reading from webcam/images'
|
||||
)
|
||||
provides=('stegasoo')
|
||||
conflicts=('stegasoo')
|
||||
install=stegasoo-git.install
|
||||
source=("${pkgname}::git+https://github.com/adlee-was-taken/stegasoo.git#branch=main")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
# Python 3.12 from AUR package
|
||||
_python="/usr/bin/python3.12"
|
||||
|
||||
pkgver() {
|
||||
cd "$pkgname"
|
||||
git describe --long --tags 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' || \
|
||||
@@ -34,32 +34,32 @@ pkgver() {
|
||||
|
||||
build() {
|
||||
cd "$pkgname"
|
||||
|
||||
echo "Using Python: $_python ($($_python --version))"
|
||||
|
||||
# Bootstrap pip for python312
|
||||
$_python -m ensurepip --user --upgrade
|
||||
|
||||
# Install build dependencies
|
||||
$_python -m pip install --user build hatchling
|
||||
|
||||
# Build wheel
|
||||
$_python -m build --wheel --no-isolation
|
||||
python -m build --wheel --no-isolation
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$pkgname"
|
||||
|
||||
# Detect Python version for site-packages path
|
||||
local pyver=$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
|
||||
|
||||
# Install to /opt/stegasoo with dedicated venv
|
||||
install -dm755 "$pkgdir/opt/stegasoo"
|
||||
|
||||
# Create fresh venv in package
|
||||
$_python -m venv "$pkgdir/opt/stegasoo/venv"
|
||||
python -m venv "$pkgdir/opt/stegasoo/venv"
|
||||
|
||||
# Install the wheel with all extras
|
||||
local wheel=$(ls dist/*.whl | head -1)
|
||||
"$pkgdir/opt/stegasoo/venv/bin/pip" install --no-cache-dir "${wheel}[all]"
|
||||
|
||||
# Install frontends (not included in wheel)
|
||||
local site_packages="$pkgdir/opt/stegasoo/venv/lib/python${pyver}/site-packages"
|
||||
cp -r frontends "$site_packages/"
|
||||
|
||||
# Create instance directory for Flask (writable by stegasoo user)
|
||||
install -dm755 "$pkgdir/opt/stegasoo/venv/var/app-instance"
|
||||
|
||||
# Fix shebangs - replace build-time paths with installed paths
|
||||
find "$pkgdir/opt/stegasoo/venv/bin" -type f -exec \
|
||||
sed -i "s|$pkgdir/opt/stegasoo/venv|/opt/stegasoo/venv|g" {} \;
|
||||
@@ -86,7 +86,7 @@ After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
User=stegasoo
|
||||
WorkingDirectory=/opt/stegasoo/venv/lib/python3.12/site-packages/frontends/web
|
||||
WorkingDirectory=/opt/stegasoo/venv/lib/python${pyver}/site-packages/frontends/web
|
||||
Environment="PATH=/opt/stegasoo/venv/bin"
|
||||
ExecStart=/opt/stegasoo/venv/bin/gunicorn -b 127.0.0.1:5000 app:app
|
||||
Restart=on-failure
|
||||
@@ -104,7 +104,7 @@ After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
User=stegasoo
|
||||
WorkingDirectory=/opt/stegasoo/venv/lib/python3.12/site-packages/frontends/api
|
||||
WorkingDirectory=/opt/stegasoo/venv/lib/python${pyver}/site-packages/frontends/api
|
||||
Environment="PATH=/opt/stegasoo/venv/bin"
|
||||
ExecStart=/opt/stegasoo/venv/bin/uvicorn main:app --host 127.0.0.1 --port 8000
|
||||
Restart=on-failure
|
||||
|
||||
40
aur/stegasoo-git.install
Normal file
40
aur/stegasoo-git.install
Normal file
@@ -0,0 +1,40 @@
|
||||
post_install() {
|
||||
# Create stegasoo system user if it doesn't exist
|
||||
if ! getent passwd stegasoo >/dev/null; then
|
||||
useradd -r -s /usr/bin/nologin -d /opt/stegasoo stegasoo
|
||||
echo "Created system user 'stegasoo'"
|
||||
fi
|
||||
|
||||
# Set ownership of instance directory for Flask
|
||||
chown -R stegasoo:stegasoo /opt/stegasoo/venv/var/app-instance 2>/dev/null || true
|
||||
|
||||
echo ""
|
||||
echo "Stegasoo installed successfully!"
|
||||
echo ""
|
||||
echo "CLI usage:"
|
||||
echo " stegasoo --help"
|
||||
echo ""
|
||||
echo "To start the web UI:"
|
||||
echo " sudo systemctl start stegasoo-web"
|
||||
echo ""
|
||||
echo "To start the REST API:"
|
||||
echo " sudo systemctl start stegasoo-api"
|
||||
echo ""
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
post_install
|
||||
}
|
||||
|
||||
pre_remove() {
|
||||
# Stop services if running
|
||||
systemctl stop stegasoo-web 2>/dev/null || true
|
||||
systemctl stop stegasoo-api 2>/dev/null || true
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
# Optionally remove the stegasoo user
|
||||
# userdel stegasoo 2>/dev/null || true
|
||||
echo "Stegasoo removed. User 'stegasoo' was not removed."
|
||||
echo "To remove: userdel stegasoo"
|
||||
}
|
||||
Reference in New Issue
Block a user