commit 3e3dc1d7ff25edc528b7f778160f77928b82b9aa Author: speedie Date: Sun Aug 27 13:54:07 2023 +0200 Initial commit diff --git a/.OPT b/.OPT new file mode 100644 index 0000000..8d5c1eb --- /dev/null +++ b/.OPT @@ -0,0 +1,7 @@ +# speedie-aur + +SERVER_NAME="speedie-aur" +SERVER_USER="speedie" +SERVER_IP="65.20.115.168" +SERVER_LOCATION="/var/www/aur" + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6c0d467 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*packages/* +*zst* +*db* diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..f4ac509 --- /dev/null +++ b/.htaccess @@ -0,0 +1,3 @@ +RewriteEngine On +RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?) +RewriteRule ^ /%1 [R=301,L] diff --git a/README.md b/README.md new file mode 100644 index 0000000..9918a88 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# speedie-aur + +NOTE: Directory `packages/` must be created manually and should contain all +packages available in the repository. + +## Setup + +1. Set up an Apache web server (See example config) +2. Point Apache to /var/www/aur/packages +3. Add packages to `packages/` +4. Modify `.OPT` (path can be changed if you wish) +4. Run `aurmake publish` to make packages and rsync to server diff --git a/aur.speedie.site.conf b/aur.speedie.site.conf new file mode 100644 index 0000000..77c75b4 --- /dev/null +++ b/aur.speedie.site.conf @@ -0,0 +1,11 @@ + + ServerName aur.speedie.site + ServerAlias www.aur.speedie.site + DocumentRoot /var/www/aur/packages + + + Options +Indexes +FollowSymLinks + AllowOverride All + Require all granted + + diff --git a/aurmake b/aurmake new file mode 100755 index 0000000..da1393b --- /dev/null +++ b/aurmake @@ -0,0 +1,21 @@ +#!/bin/bash +# aurmake + +source .OPT || exit 1 + +[ ! -d "packages/" ] && printf "No packages, exiting..\n" >> /dev/stderr && exit 1 + +cd packages/ || exit 1 +rm ./*"${SERVER_NAME}"* +repo-add -s -R "${SERVER_NAME}.db.tar.gz" *.pkg.tar.zst > /tmp/repo-add.log +find . -maxdepth 1 -type l -delete +cp "${SERVER_NAME}.db.tar.gz" "${SERVER_NAME}.db" +cd .. || exit 1 + +printf "Created packages\n" + +if [ "$1" = "publish" ]; then + [ ! -x "$(command -v rsync)" ] && printf "rsync not found.\n" > /dev/stderr && exit 1 + rsync -a --ignore-existing packages/ ${SERVER_USER}@${SERVER_IP}:${SERVER_LOCATION}/packages/ + rsync -a packages/*.db* ${SERVER_USER}@${SERVER_IP}:${SERVER_LOCATION}/packages/ +fi