Merge remote-tracking branch 'origin/main'

This commit is contained in:
Daniel Langbein 2021-04-22 21:17:24 +02:00
commit a868d1e7ae
26 changed files with 488 additions and 7 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/pkg/*/src/ /pkg/*/src/
/pkg/*/arch-pkg/ /pkg/*/arch-pkg/
/pkg/*/*-any.pkg.tar.zst /pkg/*/*-any.pkg.tar.zst
/pkg/*/*-package.log

View File

@ -1,4 +1,4 @@
# My personal Arch Linux packages # My personalized Arch Linux packages
## Some notes ## 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 domains ([p1st.de]()) which itself is an abbreviation of
[cloud.privacy1st.de]() [cloud.privacy1st.de]()
### config files ### creating config files
```shell
install -Dm644 $src $pkgdir/$dst
```
[Example](https://gitlab.com/archi3linux/meta/-/blob/c08ad57993095a575f2e7453c2fe92de97923276/PKGBUILD#L62) [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 ### home skeleton
[Example](https://gitlab.com/archi3linux/meta/-/blob/c08ad57993095a575f2e7453c2fe92de97923276/PKGBUILD#L75) [Example](https://gitlab.com/archi3linux/meta/-/blob/c08ad57993095a575f2e7453c2fe92de97923276/PKGBUILD#L75)
### enabling services
**TODO**: using systemd.preset

View File

@ -0,0 +1,44 @@
# Maintainer: Daniel Langbein <daniel@systemli.org>
_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
}

View File

@ -10,7 +10,7 @@ url="https://git.privacy1st.de/langfingaz/${_reponame}"
license=('MIT') license=('MIT')
groups=() groups=()
depends=('grub') depends=('grub')
makedepends=() makedepends=('git')
optdepends=() optdepends=()
provides=() provides=()
conflicts=() conflicts=()

View File

@ -0,0 +1,20 @@
# Maintainer: Daniel Langbein <daniel@systemli.org>
_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')

View File

@ -0,0 +1,20 @@
# Maintainer: Daniel Langbein <daniel@systemli.org>
_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')

View File

@ -10,7 +10,7 @@ url="https://git.privacy1st.de/langfingaz/${_reponame}"
license=('MIT') license=('MIT')
groups=() groups=()
depends=() depends=()
makedepends=() makedepends=('git')
optdepends=() optdepends=()
provides=() provides=()
conflicts=() conflicts=()

View File

@ -0,0 +1,3 @@
depend on networkmanager, openvpn plugin
enalbe the systemctl service

View File

@ -0,0 +1,32 @@
# Maintainer: Daniel Langbein <daniel@systemli.org>
_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
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,32 @@
# Maintainer: Daniel Langbein <daniel@systemli.org>
_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
}

View File

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

View File

@ -0,0 +1,5 @@
#!/bin/sh
# stdin: default config
# stdout: modified config
cat
echo 'Include = /etc/pacman.d/de-p1st'

View File

@ -0,0 +1,5 @@
# in /etc/pacman.conf -> Include = /path/to/this/cfg/file
[de-p1st]
SigLevel = Optional TrustAll
Server = https://arch.p1st.de

34
pkg/de-p1st-repo/PKGBUILD Normal file
View File

@ -0,0 +1,34 @@
# Maintainer: Daniel Langbein <daniel@systemli.org>
_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
}

View File

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

View File

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

View File

@ -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 '<!DOCTYPE html>
<html>
<head>
<title>privacy1st.de Arch Packages</title>
</head>
<body>
<h1>privacy1st.de Arch Packages</h1>
<p>The sources can be found here: <a href="https://git.privacy1st.de/langfingaz/arch-pkg">https://git.privacy1st.de/langfingaz/arch-pkg</a></p>
<ul>
' > index.html
for PKG in ./*.pkg.tar.{xz,zst}; do
echo "<li><a href=\"$PKG\">$PKG</a></li>" >> index.html;
done
echo '
</ul>
</body>
</html>' >> index.html
}
cd "${REMOTE_PKG_DIR}" || exit
add_to_db
generate_index

View File

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

View File

@ -10,7 +10,7 @@ url="https://git.privacy1st.de/langfingaz/${_reponame}"
license=('MIT') license=('MIT')
groups=() groups=()
depends=('sudo') depends=('sudo')
makedepends=() makedepends=('git')
optdepends=() optdepends=()
provides=() provides=()
conflicts=() conflicts=()

View File

@ -10,7 +10,7 @@ url="https://git.privacy1st.de/langfingaz/${_reponame}"
license=('MIT') license=('MIT')
groups=() groups=()
depends=('systemd') depends=('systemd')
makedepends=() makedepends=('git')
optdepends=() optdepends=()
provides=() provides=()
conflicts=() conflicts=()

View File

@ -10,7 +10,7 @@ url="https://git.privacy1st.de/langfingaz/${_reponame}"
license=('MIT') license=('MIT')
groups=() groups=()
depends=() depends=()
makedepends=() makedepends=('git')
optdepends=() optdepends=()
provides=() provides=()
conflicts=() conflicts=()

View File

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

35
prototype/proto.install Normal file
View File

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