--- /dev/null
+packages
+reprepro/db
+store/
--- /dev/null
+DOWNLOAD_DIR:=store
+
+.PHONY:
+help:
+ @echo "This Makefile helps you maintain a Debian repository."
+ @echo ""
+ @echo "The following targets are available:"
+ @echo ""
+ @echo "init: Initializes the repository structure according to the .env file."
+
+.PHONY:
+clean:
+ rm -rf packages
+ rm -rf $(DOWNLOAD_DIR)/bookworm/*
+ rm -rf $(DOWNLOAD_DIR)/trixie/*
+ rm -rf $(DOWNLOAD_DIR)/sid/*
+ rm reprepro/db/*
+
+.PHONY:
+update: $(DOWNLOAD_DIR)/bookworm $(DOWNLOAD_DIR)/trixie $(DOWNLOAD_DIR)/sid
+ ./update_all.sh
\ No newline at end of file
--- /dev/null
+# Overview
+
+This repository helps you bootstrap a Debian repository. It does not archive
+old versions by default.
+
+# Set Up
+
+## Prerequisites
+
+``` bash
+sudo apt install gnupg reprepro
+```
+
+## Create a GPG Key
+
+A GPG key enables you to cryptographically sign packages to assure people that
+you are the one who packaged it.
+
+``` bash
+gpg --full-generate-key
+```
+
+1. Select "RSA (sign only)".
+2. Select a key size of 4096
+
+## Add your GPG Key to the Repository
+
+Get your Key ID by by running the following command:
+
+``` bash
+gpg --list-keys --keyid-format long
+```
+
+Copy it into the repository so people can validate against it with the following command:
+
+``` bash
+gpg --armor --export YOUR_KEY_ID > repository-key.asc
+```
+
+Apply it throughout the repository by using `./scripts/replace_key.sh YOUR_KEY_ID <YOUR_ACTUAL_KEY_ID>`.
+
+Okay, that's confusing. The first `YOUR_KEY_ID` is the literal string. The second
+is your actual key ID. The script does a targeted search and replace throughout
+the repository.
+
+# Add packages to GitHub
+
+Use [Cookiecutter-deb](https://github.com/rocketbowman/cookiecutter-deb) to
+create a new template of a package.
+
+The GitHub action produces a draft build. You must convert that draft into a
+proper release.
+
+# Add packages to this Repository
+
+Add the new package to the `update_all.sh` script.
+
+# Use the Makefile
+
+Use `make update` to fetch the latest releases from GitHub to your repo.
\ No newline at end of file
--- /dev/null
+Codename: bookworm
+Architectures: amd64
+Components: main
+Description: Apt repository for unofficial packages
+SignWith: YOUR_KEY_ID
+
+Codename: trixie
+Architectures: amd64
+Components: main
+Description: Apt repository for unofficial packages
+SignWith: YOUR_KEY_ID
+
+Codename: sid
+Architectures: amd64
+Components: main
+Description: Apt repository for unofficial packages
+SignWith: YOUR_KEY_ID
--- /dev/null
+#!/bin/bash
+# Usage: ./check_latest uv
+PACKAGE_NAME=$1
+
+# ASSUME: Repository is named deb-$PACKAGE_NAME
+REPO=deb-$PACKAGE_NAME
+curl --silent --head https://github.com/rocketbowman/"$REPO"/releases/latest \
+ | sed --silent --regexp-extended \
+ --expression "s|location: (.*)|\1|p" \
+ | sed --silent --regexp-extended \
+ --expression "s|.*/releases/tag/(.*)|\1|p"
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+# download.sh
+# Usage: ./download uv 0.8.22 1 "amd64"
+
+PACKAGE_NAME="$1"
+PACKAGE_VERSION=${2:-"default"}
+BUILD_VERSION=${3:-"1"}
+ARCHITECTURES=${4:-"amd64"}
+
+# ASSUME: Repos are named deb-$PACKAGE_NAME
+REPO="deb-$PACKAGE_NAME"
+
+# If PACKAGE_VERSION is unspecified, check GitHub to get the latest.
+if [ "$PACKAGE_VERSION" == "default" ]; then
+ read -r PACKAGE_VERSION <<< "$(./check_latest.sh "$PACKAGE_NAME" |sed 's/\r$//')"
+fi
+
+echo $PACKAGE_VERSION
+
+# Get deb for all Debian distributions
+declare -a arr=("bookworm" "trixie" "sid")
+for i in "${arr[@]}"
+do
+ DEBIAN_DIST=$i
+ filename="${PACKAGE_NAME}_${PACKAGE_VERSION}-${BUILD_VERSION}+${DEBIAN_DIST}_${ARCHITECTURES}"
+ wget -O "../store/${DEBIAN_DIST}/${filename}.deb" \
+ "https://github.com/rocketbowman/${REPO}/releases/download/${PACKAGE_VERSION}/${filename}.deb"
+done
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+# generate_index.sh
+# Usage: ./generate_index.sh
+KEY_ID=YOUR_KEY_ID
+root=$(pwd)/..
+reprepro=$root/reprepro
+
+declare -a arr=("bookworm" "trixie" "sid")
+for i in "${arr[@]}"
+do
+ DEBIAN_DIST=$i
+ reprepro --dbdir "$reprepro"/db \
+ --confdir "$reprepro"/conf \
+ --outdir="$root"/packages \
+ --component main \
+ includedeb "$DEBIAN_DIST" "$root"/store/"$DEBIAN_DIST"/*.deb
+ package_dir="$root/packages/dists/$DEBIAN_DIST"
+ cat "$package_dir"/Release | gpg -s --default-key "$KEY_ID" -abs > "$package_dir"/Release.gpg
+done
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+rootdir=$(pwd)/..
+OLD_KEY_ID=$1
+NEW_KEY_ID=$2
+sed --in-place --expression "s/$OLD_KEY_ID/$NEW_KEY_ID/g" "$rootdir/reprepro/conf/distributions"
+sed --in-place --expression "s/$OLD_KEY_ID/$NEW_KEY_ID/g" "$rootdir/scripts/generate_index.sh"
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+cd scripts || return 1
+declare -a packages=("uv")
+for i in "${packages[@]}"
+do
+ package=$i
+ ./download.sh "$package"
+done
+
+./generate_index.sh
\ No newline at end of file