gpg_email="[email protected]"
reponame="aptrepo"
apt_manager="apt"
apt_distro="sid"
apt_archs="arm64"
apt_origin="stvhay"
apt_label="stvhay"
apt_key="F06332423E4AD8A83FE448D72A6717AEB1CA258F"
export GPG_TTY=$(tty)
gpg --default-new-key-algo "ed25519/cert,sign+cv25519/encr" --quick-generate-key "$gpg_email"
freight-init -g "$gpg_email" --archs="$apt_archs" --origin="$apt_origin" --label="$apt_label" "$reponame"
freight add -c "$reponame/etc/freight.conf" *.deb "$apt_manager/$apt_distro"
freight cache -c "$reponame/etc/freight.conf"
# Configure gpg
cat > ~/.gnupg/gpg.conf <<EOF
# Prioritize stronger algorithms for new keys.
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 BZIP2 ZLIB ZIP Uncompressed
# Use a stronger digest than the default SHA1 for certifications.
cert-digest-algo SHA512
EOF
# Create key
gpg --default-new-key-algo "ed25519/cert,sign+cv25519/encr" --quick-generate-key "$gpg_email"
# Nginx
cat > /etc/nginx/sites-available/myrepo.example.com <<EOF
server {
listen 80;
access_log /srv/nginx/myrepo.example.com/access.log;
error_log /srv/nginx/myrepo.example.com/error.log;
location / {
root /srv/nginx/myrepo.example.com/root/;
autoindex on;
}
location ~ /(.*)/conf {
deny all;
}
location ~ /(.*)/db {
deny all;
}
}
EOF
# If you don't feel like running webserver yourself for the repository, you may be able to
# use free webservers if the repository is small enough to meet their acceptable use policy.
#
# Many free source code hosting services such as Github and Gitlab comes with web site hosting
# service with https://<username>.github.io like URL. They can be used to host a package
# repository. The repository content transfer is as easy as committing them to
# the <username>.github.io repository.
# Configure the distribution
mkdir -p /srv/nginx/myrepo.example.com/root/conf
cat > /srv/nginx/myrepo.example.com/root/conf/distributions <<EOF
Origin: $apt_origin
Label: $apt_label
Codename: $apt_distro
Architectures: $apt_archs
Components: main
Description: Apt repository for project x
SignWith: $apt_key
EOF
# Configure options
cat > /srv/nginx/myrepo.example.com/root/conf/options <<EOF
verbose
basedir /srv/nginx/myrepo.example.com/root
ask-passphrase
EOF
reprepro includedeb $apt_distro *.deb
https://fpm.readthedocs.io/en/latest/getting-started.html
export GEM_HOME="$HOME/.local"
gem install fpm
# example
fpm \
-s dir \
-t deb \
-p hello-world-0.1.0-1-any.deb \
--name hello-world \
--license agpl3 \
--version 0.1.0 \
--architecture all \
--depends bash --depends lolcat \
--description "Say hi!" \
--url "https://example.com/hello-world" \
--maintainer "You The Amazing Person <you are an amazing person at example dot com>" \
hello-world=/usr/bin/hello-world \
hello-world.1=/usr/share/man/man1/hello-world.1
- A more advanced way to contain FPM maybe? https://github.com/postmodern/gem_home