arch/pkg/de-p1st-repo/README.md

104 lines
3.2 KiB
Markdown
Raw Permalink Normal View History

# Arch Linux repository manager
2021-04-22 11:38:59 +02:00
2021-04-22 21:23:34 +02:00
Special thanks to nachoparker for his article:
2021-12-15 12:08:58 +01:00
* [Replicate your system with self-hosted Arch Linux metapackages](https://ownyourbits.com/2019/07/21/replicate-your-system-with-self-hosted-arch-linux-metapackages/)
2021-04-22 21:23:34 +02:00
2021-04-26 15:05:33 +02:00
## Setup
2021-04-22 11:38:59 +02:00
Install `de-p1st-repo` on your local machine as well as on
a remote server.
2021-05-03 16:12:27 +02:00
Adjust [/etc/de-p1st-repo/arch-repo.conf](arch-repo.cfg) according to your needs.
2021-04-22 11:38:59 +02:00
Run a webserver on the server to serve static content:
* [https://hub.docker.com/_/nginx/]() -> Hosting some simple static content
2021-04-22 11:38:59 +02:00
* `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
```
2021-04-26 15:05:33 +02:00
## Normal usage
2021-04-22 11:38:59 +02:00
2021-12-15 12:08:58 +01:00
### Check for AUR updates, build and push
2021-04-22 11:38:59 +02:00
2021-12-15 12:08:58 +01:00
Check remote repository for AUR packages that can be updated
2021-04-22 11:38:59 +02:00
2021-12-15 12:08:58 +01:00
```shell
arch-repo-vercmp
```
2021-04-26 15:05:33 +02:00
Then build those packages locally and push changes to remote repository
2021-12-15 12:08:58 +01:00
```shell
# Build on local machine in clean chroot (or with an AUR helper), e.g.
makepkg -fCcsr
2021-12-15 12:08:58 +01:00
# Push new packages to remote repository
2021-12-15 12:08:58 +01:00
arch-repo-push-new
```
2021-04-26 15:05:33 +02:00
## example output
2021-04-26 15:05:33 +02:00
```
user@localMachine ~ % arch-repo-push-new
de-p1st-pacman-0.0.7-2-any.pkg.tar.zst
2.84K 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=325/384)
de-p1st-repo-0.1.1-2-any.pkg.tar.zst
5.13K 100% 4.90MB/s 0:00:00 (xfr#2, to-chk=308/384)
de-p1st-repo-0.1.1-3-any.pkg.tar.zst
5.13K 100% 4.90MB/s 0:00:00 (xfr#3, to-chk=307/384)
new-pkg.txt
113 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=0/1)
Adding new packages to db ...
Sorting new packages by package name and package version ...
Creating file ./db/de-p1st-pacman/0.0.7-2 with content de-p1st-pacman-0.0.7-2-any.pkg.tar.zst ...
Creating file ./db/de-p1st-repo/0.1.1-2 with content de-p1st-repo-0.1.1-2-any.pkg.tar.zst ...
Creating file ./db/de-p1st-repo/0.1.1-3 with content de-p1st-repo-0.1.1-3-any.pkg.tar.zst ...
For each new package name: Add latest version to database ...
==> Extracting de-p1st.db.tar.gz to a temporary location...
==> Extracting de-p1st.files.tar.gz to a temporary location...
==> Adding package 'de-p1st-pacman-0.0.7-2-any.pkg.tar.zst'
-> Computing checksums...
-> Removing existing entry 'de-p1st-pacman-0.0.7-1'...
-> Creating 'desc' db entry...
-> Creating 'files' db entry...
==> Creating updated database file 'de-p1st.db.tar.gz'
==> Extracting de-p1st.db.tar.gz to a temporary location...
==> Extracting de-p1st.files.tar.gz to a temporary location...
==> Adding package 'de-p1st-repo-0.1.1-3-any.pkg.tar.zst'
-> Computing checksums...
-> Removing existing entry 'de-p1st-repo-0.1.1-1'...
-> Creating 'desc' db entry...
-> Creating 'files' db entry...
==> Creating updated database file 'de-p1st.db.tar.gz'
Generating index.html with links to all packages ...
```
Where the generated `new-pkg.txt` has this content:
```
de-p1st-pacman-0.0.7-2-any.pkg.tar.zst
de-p1st-repo-0.1.1-2-any.pkg.tar.zst
de-p1st-repo-0.1.1-3-any.pkg.tar.zst
```
2021-12-15 12:08:58 +01:00
## Removing packages
On your remote server:
```shell
2022-01-31 21:40:38 +01:00
PKG=xml2
REPO_NAME=de-p1st
repo-remove "${REPO_NAME}".db.tar.gz "${PKG}"
rm "${PKG}"-PKG-VERSION.pkg.tar.{xz,zst}
rm -r db/"${PKG}"/
2021-12-15 12:08:58 +01:00
```