Initial commit

This commit is contained in:
Jacob 2023-08-27 13:54:07 +02:00
commit 3e3dc1d7ff
6 changed files with 57 additions and 0 deletions

7
.OPT Normal file
View File

@ -0,0 +1,7 @@
# speedie-aur
SERVER_NAME="speedie-aur"
SERVER_USER="speedie"
SERVER_IP="65.20.115.168"
SERVER_LOCATION="/var/www/aur"

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*packages/*
*zst*
*db*

3
.htaccess Normal file
View File

@ -0,0 +1,3 @@
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?)
RewriteRule ^ /%1 [R=301,L]

12
README.md Normal file
View File

@ -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

11
aur.speedie.site.conf Normal file
View File

@ -0,0 +1,11 @@
<VirtualHost *:80>
ServerName aur.speedie.site
ServerAlias www.aur.speedie.site
DocumentRoot /var/www/aur/packages
<Directory /var/www/aur/packages>
Options +Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

21
aurmake Executable file
View File

@ -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