Skip to content

Instantly share code, notes, and snippets.

@iamtew
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamtew/e4ebc2e4d79850d272d6 to your computer and use it in GitHub Desktop.
Save iamtew/e4ebc2e4d79850d272d6 to your computer and use it in GitHub Desktop.
Dead simple Debian repository generator for simple package hosting
#! /usr/bin/env bash
# mk_simple_repo.sh - Simple Debian repository generator
#
# Prerequisites:
# Packages:
# dpkg-dev
# VirtualHost:
# <Directory /var/www/repos/ >
# Options Indexes FollowSymLinks Multiviews
# Order allow,deny
# Allow from all
# </Directory>
#
# Client configuration:
# echo "deb http://example.com/repos ./" >> /etc/apt/sources.list
repository='/var/www/repos'
overrrides='/dev/null'
pushd "$repository"
/usr/bin/dpkg-scanpackages --multiversion . "$overrrides" \
| gzip -9c > "$repository"/Packages.gz
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment