Skip to content

Commit 11a04f5

Browse files
Jonathan D.A. Jewellclaude
andcommitted
Add comprehensive packaging for all major package managers
Package managers: - AUR (Arch Linux) with submission script - DEB (Debian/Ubuntu) with debhelper - RPM (Fedora/RHEL) with systemd macros - openSUSE (zypper) with OBS-compatible spec - Homebrew (macOS/Linux) formula - MacPorts (macOS) Portfile - Chocolatey (Windows) nuspec - Scoop (Windows) manifest - WinGet (Windows) manifest - Nix flake with NixOS module - Guix package definition - Flatpak with metainfo - Alire (Ada) manifest Containers: - Dockerfile (Docker) - Containerfile (Podman/Buildah/nerdctl) - compose.yaml (Docker Compose) - Profiles: vpn, accelerated, standalone 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d99078e commit 11a04f5

25 files changed

Lines changed: 1573 additions & 52 deletions

Containerfile

Lines changed: 38 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,60 @@
11
# SPDX-License-Identifier: AGPL-3.0-or-later
2-
# Cloud Sync Tuner - Wolfi-based container
3-
# Build with: nerdctl build -t cloud-sync-tuner .
2+
# Cloud Sync Tuner - Podman/Buildah Containerfile
3+
# Works with: podman build, buildah bud, nerdctl build
44

5-
# Stage 1: Build environment (Wolfi with GNAT)
65
FROM cgr.dev/chainguard/wolfi-base:latest AS builder
76

87
# Install build dependencies
98
RUN apk add --no-cache \
10-
gcc \
119
gnat \
1210
gprbuild \
13-
make \
14-
git
11+
rust \
12+
cargo \
13+
fuse3-dev \
14+
pkgconf \
15+
dbus-dev
1516

1617
WORKDIR /build
18+
COPY . .
1719

18-
# Copy source files
19-
COPY src/ src/
20-
COPY cloud_sync_tuner.gpr .
20+
# Build Ada TUI
21+
RUN gprbuild -P cloud_sync_tuner.gpr -XBUILD_MODE=release
2122

22-
# Build the application
23-
RUN mkdir -p obj bin && \
24-
gprbuild -P cloud_sync_tuner.gpr -XBUILD_MODE=release
23+
# Build Rust daemons
24+
RUN cd overlay-daemon && cargo build --release
25+
RUN cd tray-daemon && cargo build --release
2526

26-
# Stage 2: Runtime environment (minimal Wolfi, hardened)
27-
FROM cgr.dev/chainguard/wolfi-base:latest AS runtime
27+
# Runtime image
28+
FROM cgr.dev/chainguard/wolfi-base:latest
2829

29-
# Install runtime dependencies only
3030
RUN apk add --no-cache \
3131
rclone \
3232
fuse3 \
33-
libgcc
34-
35-
# Create non-root user with specific UID for consistency
36-
RUN adduser -D -u 1000 -h /home/tuner tuner
37-
38-
# Security: read-only filesystem prep
39-
RUN mkdir -p /home/tuner/.config/cloud-sync-tuner \
40-
/home/tuner/output \
41-
&& chown -R tuner:tuner /home/tuner
42-
43-
# Copy binary from builder
44-
COPY --from=builder --chown=root:root --chmod=755 /build/bin/cloud_sync_tuner /usr/local/bin/
45-
46-
# Copy default config template
47-
COPY --chown=tuner:tuner config/ /home/tuner/.config/cloud-sync-tuner/
48-
49-
# Switch to non-root user
33+
dbus \
34+
libnotify \
35+
tini
36+
37+
COPY --from=builder /build/bin/cloud_sync_tuner /usr/bin/cloud-sync-tuner
38+
COPY --from=builder /build/overlay-daemon/target/release/cloud-sync-overlay /usr/bin/
39+
COPY --from=builder /build/tray-daemon/target/release/cloud-sync-tray /usr/bin/
40+
COPY --from=builder /build/scripts/cloud-sync-status /usr/bin/
41+
COPY --from=builder /build/config/config.toml.example /etc/cloud-sync-tuner/config.toml.example
42+
43+
# Create non-root user
44+
RUN adduser -D -u 1000 tuner
5045
USER tuner
5146
WORKDIR /home/tuner
5247

53-
# Volume for output service files
54-
VOLUME ["/home/tuner/output"]
55-
56-
# Environment for XDG compliance
57-
ENV XDG_CONFIG_HOME=/home/tuner/.config
58-
ENV HOME=/home/tuner
59-
60-
# Security: drop all capabilities, minimal attack surface
61-
# Note: SYS_ADMIN still needed at runtime for FUSE, added in compose
62-
63-
# Default to interactive TUI mode
64-
ENTRYPOINT ["/usr/local/bin/cloud_sync_tuner"]
48+
# FUSE needs /dev/fuse
49+
VOLUME ["/home/tuner/.config/rclone", "/home/tuner/.cache/rclone", "/mnt/cloud"]
6550

66-
# Health check
67-
HEALTHCHECK --interval=30s --timeout=3s \
68-
CMD test -x /usr/local/bin/cloud_sync_tuner || exit 1
51+
ENTRYPOINT ["/sbin/tini", "--"]
52+
CMD ["cloud-sync-tuner"]
6953

70-
LABEL org.opencontainers.image.title="Cloud Sync Tuner" \
71-
org.opencontainers.image.description="TUI for managing rclone cloud mount configurations" \
72-
org.opencontainers.image.source="https://github.com/hyperpolymath/cloud-sync-tuner" \
73-
org.opencontainers.image.licenses="AGPL-3.0-or-later" \
74-
org.opencontainers.image.vendor="hyperpolymath"
54+
# OCI annotations
55+
LABEL org.opencontainers.image.title="Cloud Sync Tuner"
56+
LABEL org.opencontainers.image.description="Ada TUI for managing rclone cloud mounts with rate limiting"
57+
LABEL org.opencontainers.image.version="1.0.0"
58+
LABEL org.opencontainers.image.vendor="hyperpolymath"
59+
LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later"
60+
LABEL org.opencontainers.image.source="https://github.com/hyperpolymath/cloud-sync-tuner"

Dockerfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
2+
# Cloud Sync Tuner - Wolfi-based container image
3+
4+
FROM cgr.dev/chainguard/wolfi-base:latest AS builder
5+
6+
# Install build dependencies
7+
RUN apk add --no-cache \
8+
gnat \
9+
gprbuild \
10+
rust \
11+
cargo \
12+
fuse3-dev \
13+
pkgconf \
14+
dbus-dev
15+
16+
WORKDIR /build
17+
COPY . .
18+
19+
# Build Ada TUI
20+
RUN gprbuild -P cloud_sync_tuner.gpr -XBUILD_MODE=release
21+
22+
# Build Rust daemons
23+
RUN cd overlay-daemon && cargo build --release
24+
RUN cd tray-daemon && cargo build --release
25+
26+
# Runtime image
27+
FROM cgr.dev/chainguard/wolfi-base:latest
28+
29+
RUN apk add --no-cache \
30+
rclone \
31+
fuse3 \
32+
dbus \
33+
libnotify \
34+
tini
35+
36+
COPY --from=builder /build/bin/cloud_sync_tuner /usr/bin/cloud-sync-tuner
37+
COPY --from=builder /build/overlay-daemon/target/release/cloud-sync-overlay /usr/bin/
38+
COPY --from=builder /build/tray-daemon/target/release/cloud-sync-tray /usr/bin/
39+
COPY --from=builder /build/scripts/cloud-sync-status /usr/bin/
40+
COPY --from=builder /build/config/config.toml.example /etc/cloud-sync-tuner/config.toml.example
41+
42+
# Create non-root user
43+
RUN adduser -D -u 1000 sync
44+
USER sync
45+
WORKDIR /home/sync
46+
47+
# FUSE needs /dev/fuse
48+
VOLUME ["/home/sync/.config/rclone", "/home/sync/.cache/rclone", "/mnt/cloud"]
49+
50+
ENTRYPOINT ["/sbin/tini", "--"]
51+
CMD ["cloud-sync-tuner"]

aur/.SRCINFO

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
pkgbase = cloud-sync-tuner
2+
pkgdesc = Ada TUI for managing rclone cloud mount configurations with rate limiting and SELinux support
3+
pkgver = 1.0.0
4+
pkgrel = 1
5+
url = https://github.com/hyperpolymath/cloud-sync-tuner
6+
arch = x86_64
7+
arch = i686
8+
arch = aarch64
9+
license = AGPL-3.0-or-later
10+
makedepends = gnat
11+
makedepends = gprbuild
12+
makedepends = rust
13+
makedepends = cargo
14+
depends = rclone
15+
depends = fuse3
16+
depends = glibc
17+
optdepends = systemd: for user service management
18+
optdepends = libnotify: for desktop notifications
19+
optdepends = nautilus: for GNOME Files sync status emblems
20+
optdepends = dolphin: for KDE file manager integration
21+
optdepends = selinux-utils: for SELinux policy installation
22+
optdepends = audit: for enterprise compliance logging
23+
provides = cloud-sync-tuner
24+
conflicts = cloud-sync-tuner-git
25+
source = cloud-sync-tuner-1.0.0.tar.gz::https://github.com/hyperpolymath/cloud-sync-tuner/archive/v1.0.0.tar.gz
26+
27+
pkgname = cloud-sync-tuner

aur/PKGBUILD

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Maintainer: hyperpolymath <hyperpolymath@users.noreply.github.com>
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
pkgname=cloud-sync-tuner
4+
pkgver=1.0.0
5+
pkgrel=1
6+
pkgdesc='Ada TUI for managing rclone cloud mount configurations with rate limiting and SELinux support'
7+
arch=('x86_64' 'i686' 'aarch64')
8+
url='https://github.com/hyperpolymath/cloud-sync-tuner'
9+
license=('AGPL-3.0-or-later')
10+
depends=('rclone' 'fuse3' 'glibc')
11+
makedepends=('gnat' 'gprbuild' 'rust' 'cargo')
12+
optdepends=(
13+
'systemd: for user service management'
14+
'libnotify: for desktop notifications'
15+
'nautilus: for GNOME Files sync status emblems'
16+
'dolphin: for KDE file manager integration'
17+
'selinux-utils: for SELinux policy installation'
18+
'audit: for enterprise compliance logging'
19+
)
20+
provides=('cloud-sync-tuner')
21+
conflicts=('cloud-sync-tuner-git')
22+
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/hyperpolymath/${pkgname}/archive/v${pkgver}.tar.gz")
23+
sha256sums=('SKIP')
24+
25+
build() {
26+
cd "${pkgname}-${pkgver}"
27+
28+
# Build Ada TUI
29+
gprbuild -P cloud_sync_tuner.gpr -XBUILD_MODE=release
30+
31+
# Build Rust overlay daemon
32+
cd overlay-daemon
33+
cargo build --release
34+
cd ..
35+
36+
# Build Rust tray daemon
37+
cd tray-daemon
38+
cargo build --release
39+
cd ..
40+
}
41+
42+
check() {
43+
cd "${pkgname}-${pkgver}"
44+
45+
# Run Ada tests
46+
gprbuild -P tests/tests.gpr
47+
./bin/test_runner
48+
./bin/verify_formal
49+
}
50+
51+
package() {
52+
cd "${pkgname}-${pkgver}"
53+
54+
# Install main binary
55+
install -Dm755 "bin/cloud_sync_tuner" "${pkgdir}/usr/bin/cloud-sync-tuner"
56+
57+
# Install Rust daemons
58+
install -Dm755 "overlay-daemon/target/release/cloud-sync-overlay" "${pkgdir}/usr/bin/cloud-sync-overlay"
59+
install -Dm755 "tray-daemon/target/release/cloud-sync-tray" "${pkgdir}/usr/bin/cloud-sync-tray"
60+
61+
# Install health check script
62+
install -Dm755 "scripts/cloud-sync-status" "${pkgdir}/usr/bin/cloud-sync-status"
63+
64+
# Install systemd user services
65+
install -Dm644 "systemd/rclone-dropbox.service" "${pkgdir}/usr/lib/systemd/user/rclone-dropbox.service"
66+
install -Dm644 "systemd/cloud-sync-watchdog.service" "${pkgdir}/usr/lib/systemd/user/cloud-sync-watchdog.service"
67+
install -Dm644 "systemd/cloud-sync-watchdog.timer" "${pkgdir}/usr/lib/systemd/user/cloud-sync-watchdog.timer"
68+
install -Dm644 "overlay-daemon/cloud-sync-overlay.service" "${pkgdir}/usr/lib/systemd/user/cloud-sync-overlay.service"
69+
install -Dm644 "tray-daemon/cloud-sync-tray.service" "${pkgdir}/usr/lib/systemd/user/cloud-sync-tray.service"
70+
71+
# Install config example
72+
install -Dm644 "config/config.toml.example" "${pkgdir}/usr/share/cloud-sync-tuner/config.toml.example"
73+
install -Dm644 "config/schema.ncl" "${pkgdir}/usr/share/cloud-sync-tuner/schema.ncl"
74+
75+
# Install Nautilus extension
76+
install -Dm644 "nautilus-extension/cloud_sync_overlay.py" "${pkgdir}/usr/share/nautilus-python/extensions/cloud_sync_overlay.py"
77+
78+
# Install Dolphin service menu
79+
install -Dm644 "dolphin-extension/cloud_sync_overlay.desktop" "${pkgdir}/usr/share/kservices5/ServiceMenus/cloud_sync_overlay.desktop"
80+
81+
# Install SELinux policy sources (user can compile if needed)
82+
install -Dm644 "selinux/cloud_sync_tuner.te" "${pkgdir}/usr/share/cloud-sync-tuner/selinux/cloud_sync_tuner.te"
83+
install -Dm644 "selinux/cloud_sync_tuner.fc" "${pkgdir}/usr/share/cloud-sync-tuner/selinux/cloud_sync_tuner.fc"
84+
install -Dm644 "selinux/cloud_sync_tuner.if" "${pkgdir}/usr/share/cloud-sync-tuner/selinux/cloud_sync_tuner.if"
85+
install -Dm644 "selinux/Makefile" "${pkgdir}/usr/share/cloud-sync-tuner/selinux/Makefile"
86+
87+
# Install audit rules
88+
install -Dm644 "audit/cloud-sync-tuner.rules" "${pkgdir}/usr/share/cloud-sync-tuner/audit/cloud-sync-tuner.rules"
89+
90+
# Install man page
91+
install -Dm644 "man/cloud-sync-tuner.1" "${pkgdir}/usr/share/man/man1/cloud-sync-tuner.1"
92+
93+
# Install documentation
94+
install -Dm644 "README.adoc" "${pkgdir}/usr/share/doc/${pkgname}/README.adoc"
95+
install -Dm644 "SECURITY-REVIEW.md" "${pkgdir}/usr/share/doc/${pkgname}/SECURITY-REVIEW.md"
96+
install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
97+
}
98+
99+
post_install() {
100+
echo ":: To enable cloud sync services for your user:"
101+
echo " systemctl --user enable --now cloud-sync-watchdog.timer"
102+
echo " systemctl --user enable --now cloud-sync-overlay.service"
103+
echo " systemctl --user enable --now cloud-sync-tray.service"
104+
echo ""
105+
echo ":: Copy example config to ~/.config/cloud-sync-tuner/config.toml"
106+
echo ":: For SELinux: cd /usr/share/cloud-sync-tuner/selinux && sudo make install"
107+
echo ":: For audit: sudo cp /usr/share/cloud-sync-tuner/audit/*.rules /etc/audit/rules.d/"
108+
}

aur/submit-to-aur.sh

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
# AUR Submission Script for cloud-sync-tuner
4+
# Run this from the aur/ directory
5+
6+
set -e
7+
8+
PKGNAME="cloud-sync-tuner"
9+
AUR_SSH="aur@aur.archlinux.org"
10+
11+
echo "=== AUR Submission for $PKGNAME ==="
12+
echo ""
13+
14+
# Check for AUR SSH key
15+
if ! ssh-add -l &>/dev/null; then
16+
echo "ERROR: No SSH agent running or no keys loaded"
17+
echo "Run: eval \$(ssh-agent) && ssh-add ~/.ssh/aur_rsa"
18+
exit 1
19+
fi
20+
21+
# Test AUR SSH connection
22+
echo "Testing AUR SSH connection..."
23+
if ! ssh -T $AUR_SSH 2>&1 | grep -q "authenticated"; then
24+
echo "ERROR: Cannot authenticate to AUR"
25+
echo "Make sure your AUR SSH key is:"
26+
echo " 1. Added to your AUR account at https://aur.archlinux.org/account/hyperpolymath"
27+
echo " 2. Loaded in ssh-agent"
28+
exit 1
29+
fi
30+
echo "SSH connection OK"
31+
32+
# Check if package exists
33+
echo "Checking if package exists on AUR..."
34+
if curl -s "https://aur.archlinux.org/rpc/v5/info?arg[]=$PKGNAME" | grep -q '"resultcount":0'; then
35+
echo "Package does not exist, will create new"
36+
NEW_PACKAGE=true
37+
else
38+
echo "Package exists, will update"
39+
NEW_PACKAGE=false
40+
fi
41+
42+
# Clone or create AUR repo
43+
WORKDIR=$(mktemp -d)
44+
cd "$WORKDIR"
45+
46+
if [ "$NEW_PACKAGE" = true ]; then
47+
echo "Creating new AUR package repository..."
48+
git clone ssh://$AUR_SSH/${PKGNAME}.git
49+
cd "$PKGNAME"
50+
else
51+
echo "Cloning existing AUR repository..."
52+
git clone ssh://$AUR_SSH/${PKGNAME}.git
53+
cd "$PKGNAME"
54+
fi
55+
56+
# Copy PKGBUILD and .SRCINFO
57+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
58+
cp "$SCRIPT_DIR/PKGBUILD" .
59+
cp "$SCRIPT_DIR/.SRCINFO" .
60+
61+
# Update checksums
62+
echo "Calculating source checksum..."
63+
SOURCE_URL="https://github.com/hyperpolymath/cloud-sync-tuner/archive/v1.0.0.tar.gz"
64+
CHECKSUM=$(curl -sL "$SOURCE_URL" | sha256sum | awk '{print $1}')
65+
sed -i "s/sha256sums=('SKIP')/sha256sums=('$CHECKSUM')/" PKGBUILD
66+
67+
# Regenerate .SRCINFO with checksum
68+
echo " sha256sums = $CHECKSUM" >> .SRCINFO
69+
70+
# Show diff
71+
echo ""
72+
echo "=== Changes to be committed ==="
73+
git diff --stat 2>/dev/null || git status
74+
echo ""
75+
76+
# Commit and push
77+
read -p "Commit and push to AUR? [y/N] " -n 1 -r
78+
echo
79+
if [[ $REPLY =~ ^[Yy]$ ]]; then
80+
git add PKGBUILD .SRCINFO
81+
git commit -m "Update to v1.0.0"
82+
git push origin master
83+
echo ""
84+
echo "=== SUCCESS ==="
85+
echo "Package submitted to: https://aur.archlinux.org/packages/$PKGNAME"
86+
else
87+
echo "Aborted. Files are in: $WORKDIR/$PKGNAME"
88+
fi

0 commit comments

Comments
 (0)