diff --git a/.gitignore b/.gitignore index ade90b7..18c1c61 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /pkg/*/src/ /pkg/*/arch-pkg/ /pkg/*/*-any.pkg.tar.zst +/pkg/*/*-package.log diff --git a/README.md b/README.md index dfefc15..70569ec 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# My personal Arch Linux packages +# My personalized Arch Linux packages ## Some notes @@ -13,10 +13,25 @@ Package names are prefixed with `de-p1st` as this is one of my domains ([p1st.de]()) which itself is an abbreviation of [cloud.privacy1st.de]() -### config files +### creating config files + +```shell +install -Dm644 $src $pkgdir/$dst +``` [Example](https://gitlab.com/archi3linux/meta/-/blob/c08ad57993095a575f2e7453c2fe92de97923276/PKGBUILD#L62) +### changing existing config files + +* `holo` from the AUR +* https://github.com/holocm/holo/blob/master/doc/holo-files.8.pod + +Example: [pkg/de-p1st-pacman/PKGBUILD](pkg/de-p1st-pacman/PKGBUILD) + ### home skeleton [Example](https://gitlab.com/archi3linux/meta/-/blob/c08ad57993095a575f2e7453c2fe92de97923276/PKGBUILD#L75) + +### enabling services + +**TODO**: using systemd.preset diff --git a/pkg/de-p1st-base-efi/PKGBUILD b/pkg/de-p1st-base-efi/PKGBUILD new file mode 100644 index 0000000..92c6ee1 --- /dev/null +++ b/pkg/de-p1st-base-efi/PKGBUILD @@ -0,0 +1,44 @@ +# Maintainer: Daniel Langbein +_pkgname=base-efi +_reponame=arch-pkg +pkgname="de-p1st-$_pkgname" +pkgver=0.0.1 +pkgrel=1 +pkgdesc="Arch Linux base packages" +arch=('any') +url="https://git.privacy1st.de/langfingaz/${_reponame}" +license=('MIT') +groups=() + +depends=('base' 'base-devel' 'linux-firmware' 'man-db' 'man-pages' 'nano' 'usbutils') +# metapackage for 'linux' and 'linux-headers' +depends+=('de-p1st-kernel') +# pacman config +depends+=('de-p1st-pacman') +# metapackage for microcode +depends+=('de-p1st-ucode') !! TODO !! + +# fonts +depends+=('noto-fonts' 'ttf-material-design-icons-git' 'ttf-unifont') +# bootmanager +depends+=('de-p1st-grub' 'efibootmgr') +depends+=('de-p1st-keyboard') + +makedepends=('git') +optdepends=() +provides=() +conflicts=() +replaces=() +backup=() +options=() +install= +changelog= +source=("git+${url}.git") +noextract=() +sha256sums=('SKIP') + +package() { + cd "${_reponame}/pkg/${pkgname}" + + install -Dm0644 wheel "$pkgdir"/etc/sudoers.d/wheel +} diff --git a/pkg/de-p1st-grub/PKGBUILD b/pkg/de-p1st-grub/PKGBUILD index d0aea38..0e50494 100644 --- a/pkg/de-p1st-grub/PKGBUILD +++ b/pkg/de-p1st-grub/PKGBUILD @@ -10,7 +10,7 @@ url="https://git.privacy1st.de/langfingaz/${_reponame}" license=('MIT') groups=() depends=('grub') -makedepends=() +makedepends=('git') optdepends=() provides=() conflicts=() diff --git a/pkg/de-p1st-kernel-lts/PKGBUILD b/pkg/de-p1st-kernel-lts/PKGBUILD new file mode 100644 index 0000000..5f8352e --- /dev/null +++ b/pkg/de-p1st-kernel-lts/PKGBUILD @@ -0,0 +1,20 @@ +# Maintainer: Daniel Langbein +_pkgname=kernel-lts +_reponame=arch-pkg +pkgname="de-p1st-$_pkgname" +pkgver=0.0.1 +pkgrel=1 +pkgdesc="linux-lts and linux-lts-headers" +arch=('any') +url="https://git.privacy1st.de/langfingaz/${_reponame}" +license=('MIT') +groups=() +depends=('linux-lts' 'linux-lts-headers') +provides=('de-p1st-kernel') +conflicts=() +replaces=() +options=() +install= +changelog= +noextract=() +sha256sums=('SKIP') diff --git a/pkg/de-p1st-kernel/PKGBUILD b/pkg/de-p1st-kernel/PKGBUILD new file mode 100644 index 0000000..acf470d --- /dev/null +++ b/pkg/de-p1st-kernel/PKGBUILD @@ -0,0 +1,20 @@ +# Maintainer: Daniel Langbein +_pkgname=kernel +_reponame=arch-pkg +pkgname="de-p1st-$_pkgname" +pkgver=0.0.1 +pkgrel=1 +pkgdesc="linux and linux-headers" +arch=('any') +url="https://git.privacy1st.de/langfingaz/${_reponame}" +license=('MIT') +groups=() +depends=('linux' 'linux-headers') +provides=() # implicitly provides de-p1st-kernel as this is the pkgname +conflicts=() +replaces=() +options=() +install= +changelog= +noextract=() +sha256sums=('SKIP') diff --git a/pkg/de-p1st-keyboard/PKGBUILD b/pkg/de-p1st-keyboard/PKGBUILD index 7cf0696..7ac44e7 100644 --- a/pkg/de-p1st-keyboard/PKGBUILD +++ b/pkg/de-p1st-keyboard/PKGBUILD @@ -10,7 +10,7 @@ url="https://git.privacy1st.de/langfingaz/${_reponame}" license=('MIT') groups=() depends=() -makedepends=() +makedepends=('git') optdepends=() provides=() conflicts=() diff --git a/pkg/de-p1st-networkmanager/scratch b/pkg/de-p1st-networkmanager/scratch new file mode 100644 index 0000000..8ca375d --- /dev/null +++ b/pkg/de-p1st-networkmanager/scratch @@ -0,0 +1,3 @@ +depend on networkmanager, openvpn plugin + +enalbe the systemctl service \ No newline at end of file diff --git a/pkg/de-p1st-pacman-mirrorlist/PKGBUILD b/pkg/de-p1st-pacman-mirrorlist/PKGBUILD new file mode 100644 index 0000000..ac73dd1 --- /dev/null +++ b/pkg/de-p1st-pacman-mirrorlist/PKGBUILD @@ -0,0 +1,32 @@ +# Maintainer: Daniel Langbein +_pkgname=pacman-mirrorlist +_reponame=arch-pkg +pkgname="de-p1st-$_pkgname" +pkgver=0.0.5 +pkgrel=1 +pkgdesc="selected Arch Linux mirrors" +arch=('any') +url="https://git.privacy1st.de/langfingaz/${_reponame}" +license=('MIT') +groups=() +depends=('pacman' 'holo') +makedepends=('git') +optdepends=() +provides=() +conflicts=() +replaces=() +backup=() +options=() +install="${pkgname}.install" +changelog= +source=("git+${url}.git") +noextract=() +sha256sums=('SKIP') + +package() { + cd "${_reponame}/pkg/${pkgname}" + + install -Dm0644 de-p1st-mirrorlist "$pkgdir"/etc/pacman.d/de-p1st-mirrorlist + + install -Dm0544 pacman.conf.holoscript "$pkgdir"/usr/share/holo/files/"$pkgname"/etc/pacman.conf.holoscript +} diff --git a/pkg/de-p1st-pacman-mirrorlist/de-p1st-mirrorlist b/pkg/de-p1st-pacman-mirrorlist/de-p1st-mirrorlist new file mode 100644 index 0000000..64185d8 --- /dev/null +++ b/pkg/de-p1st-pacman-mirrorlist/de-p1st-mirrorlist @@ -0,0 +1,6 @@ +## +## Arch Linux repository mirrorlist +## + +Server = https://ftp.fau.de/archlinux/$repo/os/$arch +Server = https://mirror.chaoticum.net/arch/$repo/os/$arch diff --git a/pkg/de-p1st-pacman-mirrorlist/de-p1st-pacman-mirrorlist.install b/pkg/de-p1st-pacman-mirrorlist/de-p1st-pacman-mirrorlist.install new file mode 100644 index 0000000..8ef8a94 --- /dev/null +++ b/pkg/de-p1st-pacman-mirrorlist/de-p1st-pacman-mirrorlist.install @@ -0,0 +1,35 @@ +# This is a default template for a post-install scriptlet. +# Uncomment only required functions and remove any functions +# you don't need (and this header). + +## arg 1: the new package version +#pre_install() { + # do something here +#} + +## arg 1: the new package version +post_install() { + holo apply +} + +## arg 1: the new package version +## arg 2: the old package version +#pre_upgrade() { + # do something here +#} + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + holo apply +} + +## arg 1: the old package version +#pre_remove() { + # do something here +#} + +## arg 1: the old package version +post_remove() { + holo apply +} diff --git a/pkg/de-p1st-pacman-mirrorlist/pacman.conf.holoscript b/pkg/de-p1st-pacman-mirrorlist/pacman.conf.holoscript new file mode 100644 index 0000000..142356d --- /dev/null +++ b/pkg/de-p1st-pacman-mirrorlist/pacman.conf.holoscript @@ -0,0 +1,6 @@ +#!/bin/sh +# stdin: default config +# stdout: modified config + +# replace all occurrences of "mirrorlist" with "de-p1st-mirrorlist" +sed 's|^Include\s*=\s*/etc/pacman.d/mirrorlist$|Include = /etc/pacman.d/de-p1st-mirrorlist|; s|^#\s*Include\s*=\s*/etc/pacman.d/mirrorlist$|#Include = /etc/pacman.d/de-p1st-mirrorlist|' diff --git a/pkg/de-p1st-pacman/PKGBUILD b/pkg/de-p1st-pacman/PKGBUILD new file mode 100644 index 0000000..0f728a4 --- /dev/null +++ b/pkg/de-p1st-pacman/PKGBUILD @@ -0,0 +1,32 @@ +# Maintainer: Daniel Langbein +_pkgname=pacman +_reponame=arch-pkg +pkgname="de-p1st-$_pkgname" +pkgver=0.0.7 +pkgrel=1 +pkgdesc="pacman with configuration" +arch=('any') +url="https://git.privacy1st.de/langfingaz/${_reponame}" +license=('MIT') +groups=() +depends=('pacman' 'holo') +makedepends=('git') +optdepends=('de-p1st-pacman-mirrorlist') +provides=() +conflicts=() +replaces=() +backup=() +options=() +install="${pkgname}.install" +changelog= +source=("git+${url}.git") +noextract=() +sha256sums=('SKIP') + +package() { + cd "${_reponame}/pkg/${pkgname}" + + install -Dm0644 pacman.d/de-p1st "$pkgdir"/etc/pacman.d/de-p1st + + install -Dm0544 pacman.conf.holoscript "$pkgdir"/usr/share/holo/files/"$pkgname"/etc/pacman.conf.holoscript +} diff --git a/pkg/de-p1st-pacman/de-p1st-pacman.install b/pkg/de-p1st-pacman/de-p1st-pacman.install new file mode 100644 index 0000000..8ef8a94 --- /dev/null +++ b/pkg/de-p1st-pacman/de-p1st-pacman.install @@ -0,0 +1,35 @@ +# This is a default template for a post-install scriptlet. +# Uncomment only required functions and remove any functions +# you don't need (and this header). + +## arg 1: the new package version +#pre_install() { + # do something here +#} + +## arg 1: the new package version +post_install() { + holo apply +} + +## arg 1: the new package version +## arg 2: the old package version +#pre_upgrade() { + # do something here +#} + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + holo apply +} + +## arg 1: the old package version +#pre_remove() { + # do something here +#} + +## arg 1: the old package version +post_remove() { + holo apply +} diff --git a/pkg/de-p1st-pacman/pacman.conf.holoscript b/pkg/de-p1st-pacman/pacman.conf.holoscript new file mode 100644 index 0000000..cd246d6 --- /dev/null +++ b/pkg/de-p1st-pacman/pacman.conf.holoscript @@ -0,0 +1,5 @@ +#!/bin/sh +# stdin: default config +# stdout: modified config +cat +echo 'Include = /etc/pacman.d/de-p1st' \ No newline at end of file diff --git a/pkg/de-p1st-pacman/pacman.d/de-p1st b/pkg/de-p1st-pacman/pacman.d/de-p1st new file mode 100644 index 0000000..876ea14 --- /dev/null +++ b/pkg/de-p1st-pacman/pacman.d/de-p1st @@ -0,0 +1,5 @@ +# in /etc/pacman.conf -> Include = /path/to/this/cfg/file + +[de-p1st] +SigLevel = Optional TrustAll +Server = https://arch.p1st.de diff --git a/pkg/de-p1st-repo/PKGBUILD b/pkg/de-p1st-repo/PKGBUILD new file mode 100644 index 0000000..77eed4d --- /dev/null +++ b/pkg/de-p1st-repo/PKGBUILD @@ -0,0 +1,34 @@ +# Maintainer: Daniel Langbein +_pkgname=repo +_reponame=arch-pkg +pkgname="de-p1st-$_pkgname" +pkgver=0.0.6 +pkgrel=1 +pkgdesc="Bash script to manage remote Arch Linux repository" +arch=('any') +url="https://git.privacy1st.de/langfingaz/${_reponame}" +license=('MIT') +groups=() +depends=('openssh' 'bash') +makedepends=('git') +optdepends=() +provides=() +conflicts=() +replaces=() +backup=() +options=() +install= +changelog= +source=("git+${url}.git") +noextract=() +sha256sums=('SKIP') + +package() { + cd "${_reponame}/pkg/${pkgname}" + + install -Dm0555 arch-repo-push-new.sh "$pkgdir"/usr/bin/arch-repo-push-new + install -Dm0555 arch-repo-receive-new.sh "$pkgdir"/usr/bin/arch-repo-receive-new + + install -Dm0644 arch-repo.cfg "$pkgdir"/etc/de-p1st-repo/arch-repo.cfg + chown 0:0 "$pkgdir"/etc/de-p1st-repo/arch-repo.cfg +} diff --git a/pkg/de-p1st-repo/README.md b/pkg/de-p1st-repo/README.md new file mode 100644 index 0000000..45ac0f1 --- /dev/null +++ b/pkg/de-p1st-repo/README.md @@ -0,0 +1,32 @@ +# arch-repo manager + +## setup + +Install `de-p1st-repo` on your local machine as well as on +a remote server. + +Adjust `/etc/de-p1st-repo/*.conf` according to your needs. + +Run a webserver on the server to serve static content: + +* https://hub.docker.com/_/nginx/ -> Hosting some simple static content +* `sudo docker run --name arch-repo -v /mnt/data/live/arch-repo:/usr/share/nginx/html:ro -d nginx` + +Add the newly created mirror to your `/etc/pacman.conf`: + +``` +[de-p1st] +SigLevel = Optional TrustAll +Server = https://arch.p1st.de +``` + +## normal usage + +1. Build packages on local machine + +* `aur sync -c SOME_AUR_PACKAGE` +* `aur sync -c -u` + +2. Push new packages to remote repository + +* `arch-repo-push-new` diff --git a/pkg/de-p1st-repo/arch-repo-push-new.sh b/pkg/de-p1st-repo/arch-repo-push-new.sh new file mode 100644 index 0000000..cda7021 --- /dev/null +++ b/pkg/de-p1st-repo/arch-repo-push-new.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +source /etc/de-p1st-repo/arch-repo.cfg || exit + + + +cd "${LOCAL_PKG_DIR}" || exit + +# get list of new packages, one package per line +rsync --ignore-existing --out-format="%n" --dry-run \ + ./*.pkg.tar.{xz,zst} "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" > new-pkg.txt || exit + +# transfer new packages using rsync +rsync --ignore-existing --progress --human-readable \ + ./*.pkg.tar.{xz,zst} "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" || exit + + + +# transfer new-pkg.txt +rsync --ignore-times --checksum --progress --human-readable \ + new-pkg.txt "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" || exit + +# add each new package to database +ssh "${REMOTE_SSH_HOST}" "/usr/bin/arch-repo-receive-new" diff --git a/pkg/de-p1st-repo/arch-repo-receive-new.sh b/pkg/de-p1st-repo/arch-repo-receive-new.sh new file mode 100644 index 0000000..7e7295f --- /dev/null +++ b/pkg/de-p1st-repo/arch-repo-receive-new.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +source /etc/de-p1st-repo/arch-repo.cfg || exit + + + +# +# add new packages to database +# +function add_to_db(){ + echo "Adding new packages to db ..." + + mapfile -t PKGS < <(cat new-pkg.txt) + for PKG in "${PKGS[@]}"; do + repo-add -n "${REMOTE_DB_NAME}.db.tar.gz" "${PKG}" || exit + done +} + + + +# +# generate index.html +# +function generate_index(){ + echo "Generating index.html with links to all packages ..." + + echo ' + + +privacy1st.de Arch Packages + + +

privacy1st.de Arch Packages

+

The sources can be found here: https://git.privacy1st.de/langfingaz/arch-pkg

+ +
    +' > index.html + + for PKG in ./*.pkg.tar.{xz,zst}; do + echo "
  • $PKG
  • " >> index.html; + done + + echo ' +
+ + +' >> index.html +} + + + +cd "${REMOTE_PKG_DIR}" || exit +add_to_db +generate_index diff --git a/pkg/de-p1st-repo/arch-repo.cfg b/pkg/de-p1st-repo/arch-repo.cfg new file mode 100644 index 0000000..4d5fd3e --- /dev/null +++ b/pkg/de-p1st-repo/arch-repo.cfg @@ -0,0 +1,8 @@ +# host from ssh configuration which logs in +# as correct user to have write access to +# REMOTE_PKG_DIR +REMOTE_SSH_HOST=rootnas + +LOCAL_PKG_DIR=/home/custompkgs +REMOTE_PKG_DIR=/mnt/data/live/arch-repo +REMOTE_DB_NAME=de-p1st \ No newline at end of file diff --git a/pkg/de-p1st-sudo/PKGBUILD b/pkg/de-p1st-sudo/PKGBUILD index c6389d8..ea56b57 100644 --- a/pkg/de-p1st-sudo/PKGBUILD +++ b/pkg/de-p1st-sudo/PKGBUILD @@ -10,7 +10,7 @@ url="https://git.privacy1st.de/langfingaz/${_reponame}" license=('MIT') groups=() depends=('sudo') -makedepends=() +makedepends=('git') optdepends=() provides=() conflicts=() diff --git a/pkg/de-p1st-systemd/PKGBUILD b/pkg/de-p1st-systemd/PKGBUILD index d694c8e..5dd00de 100644 --- a/pkg/de-p1st-systemd/PKGBUILD +++ b/pkg/de-p1st-systemd/PKGBUILD @@ -10,7 +10,7 @@ url="https://git.privacy1st.de/langfingaz/${_reponame}" license=('MIT') groups=() depends=('systemd') -makedepends=() +makedepends=('git') optdepends=() provides=() conflicts=() diff --git a/prototype/PKGBUILD b/prototype/PKGBUILD index eb80e3d..3ede1c5 100644 --- a/prototype/PKGBUILD +++ b/prototype/PKGBUILD @@ -10,7 +10,7 @@ url="https://git.privacy1st.de/langfingaz/${_reponame}" license=('MIT') groups=() depends=() -makedepends=() +makedepends=('git') optdepends=() provides=() conflicts=() diff --git a/prototype/proto-holo.install b/prototype/proto-holo.install new file mode 100644 index 0000000..8ef8a94 --- /dev/null +++ b/prototype/proto-holo.install @@ -0,0 +1,35 @@ +# This is a default template for a post-install scriptlet. +# Uncomment only required functions and remove any functions +# you don't need (and this header). + +## arg 1: the new package version +#pre_install() { + # do something here +#} + +## arg 1: the new package version +post_install() { + holo apply +} + +## arg 1: the new package version +## arg 2: the old package version +#pre_upgrade() { + # do something here +#} + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + holo apply +} + +## arg 1: the old package version +#pre_remove() { + # do something here +#} + +## arg 1: the old package version +post_remove() { + holo apply +} diff --git a/prototype/proto.install b/prototype/proto.install new file mode 100644 index 0000000..388765e --- /dev/null +++ b/prototype/proto.install @@ -0,0 +1,35 @@ +# This is a default template for a post-install scriptlet. +# Uncomment only required functions and remove any functions +# you don't need (and this header). + +## arg 1: the new package version +#pre_install() { + # do something here +#} + +## arg 1: the new package version +#post_install() { + # do something here +#} + +## arg 1: the new package version +## arg 2: the old package version +#pre_upgrade() { + # do something here +#} + +## arg 1: the new package version +## arg 2: the old package version +#post_upgrade() { + # do something here +#} + +## arg 1: the old package version +#pre_remove() { + # do something here +#} + +## arg 1: the old package version +#post_remove() { + # do something here +#} \ No newline at end of file