Add AUR helper script, README, conf, and LICENSE

This commit is contained in:
Stephen Seo 2022-06-02 15:02:07 +09:00
parent bc65185edf
commit ba34f4735e
4 changed files with 1642 additions and 0 deletions

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Stephen Seo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

99
README.md Normal file
View file

@ -0,0 +1,99 @@
# Another AUR Helper (incomplete)
AUR is the Arch User Repository, where anyone can upload a PKGBUILD and
supplementary sources to allow others to build their own packages for use in the
Arch Linux distribution.
I made an incomplete AUR Helper in Python, and decided to put it in a public
repository. It's messy, and it requires a significant amount of set-up, but it
works for me. It always builds in a CHROOT, and it lets the user check the
PKGBUILD (by default) prior to building. There is no automatic dependency
management. That must be done in the config. An example config is provided.
# Setting up the AUR Helper
The AUR Helper requires several things:
- A CHROOT to build in
- A "checking GNUPG" directory that contains the GPG public keys that will be
checked when building the PKGBUILD
- A "singing GNUPG" directory that contains the GPG private key that will sign
the built packages and repository database.
- SUDO privileges to be able to use `makechrootpkg`
## Dependencies
The `devtools` package is required.
The `python-packaging` and `python-toml` packages are required for the Python
script to run.
## Create the CHROOT
Use `/usr/bin/mkarchroot` to create your CHROOT in a directory.
mkarchroot $HOME/mychroot base base-devel
You must refer to the CHROOT as `$HOME/mychroot` if you used the same name as in
the previous example.
## Set up the GNUPG dirs
### Checking GNUPG
Just create the directory anywhere, and store it in the `config.toml`. You must
manually add public keys to it if a package requires checking source files with
GNUPG.
GNUPGHOME=$HOME/myCheckingGNUPGDir gpg --recv-keys A_DEV_KEYS_FINGERPRINT
### Signing GNUPG
You will need to set up a GPG public/private key pair. GNUPG always respects the
`GNUPGHOME` environment variable as the `.gnupg` dir, so set the variable first,
then set up your keys. The keys will be used to sign the packages you build and
the custom repository that stores the package metadata.
Set the `signing_gpg_key_fp` variable in the config to the output fingerprint
from of:
GNUPGHOME=mySigningGNUPGDir gpg --fingerprint
Note that you must remove the spaces between each part of the fingerprint, like
in the example config.
Keep note of the password you store for this GNUPG key, as you will enter it
every time you use the Python script.
## Set up the config dir
See the `example_config.toml` for more configuration. It should be commented
enough for figuring out how to use it.
# Using the AUR Helper
Typically, you will invoke:
./update.py --config my_config.toml
If you want to build in the CHROOT without updating the CHROOT, add the
`--no-update` flag.
If you want to check only specific packages in the list of packages in the
config use something like `-p <package-name>`. You can use `-p <package_name>`
multiple times if you want to check a handful of packages only.
If you want to not skip a package marked with `skip_branch_up_to_date` in the
config, then use `--no-skip <package-name>`, and the script will act as if
`skip_branch_up_to_date` was not specified for the named package.
When building, the script will not directly output to the terminal it is run in,
but rather appends to log files in the log directory specified in the config. To
see the output while building, you can use something like:
tail -f $MY_LOG_DIR/google-chrome_stdout_2022-06-02_05-27-49_UTC
It may be helpful to periodically clear out the logs directory in between
invocations of the AUR Helper script.
It is recommended to use the script with a prepared config.

319
example_config.toml Normal file
View file

@ -0,0 +1,319 @@
########## MANDATORY VARIABLES
custom_cache = "/home/custompkgs"
chroot = "/home/stephen/Downloads/aur/chroot"
pkg_dir = "/home/custompkgs"
repo = "/home/custompkgs/custom.db.tar"
dirs_dir = "/home/stephen/Downloads/aur"
gpg_dir = "/home/stephen/Downloads/aur/checkingGPG"
logs_dir = "/home/stephen/Downloads/aur/logs"
signing_gpg_dir = "/home/stephen/Downloads/aur/signingGPG"
signing_gpg_key_fp = "04D9E3A2880F6418EC4BA70EA0F3F8FAA2088E62"
########## END OF MANDATORY VARIABLES
# Each [[entry]] needs a "name".
# it is expected that the name matches a repo's name at https://aur.archlinux.org/
# For example, "aurutils" repo is fetched from https://aur.archlinux.org/aurutils.git
#
# It may be handy to specify "skip_branch_up_to_date" for packages that do not
# build directly from a git repository (packages ending in "-git").
# Packages with this setting will not prompt to check the PKGBUILD if the
# .SRCINFO version is not newer than the current latest package in the custom
# repo, and it will be skipped.
#
# For AUR dependencies, an "aur_deps" array needs to be specified.
# AUR dependencies must appear before the package that depends on them in this
# list. If building these dependencies for the first time, the dependent package
# may fail checks until the dependencies are built and stored in the repo.
#
# There is support for "ccache" and "sccache".
# Make a directory somewhere, then specify its path with the "ccache_dir"
# or "sccache_dir" variables.
# sccache supports the additional "sccache_cache_size" variable, which can be
# set to a string such as "5G". If "sccache_cache_size' is not specified, then
# "5G" is used.
[[entry]]
name = "arcanist-git"
[[entry]]
name = "aurutils"
skip_branch_up_to_date = true
[[entry]]
name = "cef-minimal"
skip_branch_up_to_date = true
[[entry]]
name = "cpufetch-git"
[[entry]]
name = "f3"
skip_branch_up_to_date = true
[[entry]]
name = "flamegraph-git"
[[entry]]
name = "g810-led-git"
[[entry]]
name = "glfw-git"
[[entry]]
name = "gnome-icon-theme-symbolic"
skip_branch_up_to_date = true
[[entry]]
name = "gnome-icon-theme"
aur_deps = [
"gnome-icon-theme-symbolic"
]
skip_branch_up_to_date = true
[[entry]]
name = "gnvim"
skip_branch_up_to_date = true
[[entry]]
name = "perl-file-rename"
skip_branch_up_to_date = true
[[entry]]
name = "icecat"
aur_deps = [
"perl-file-rename"
]
skip_branch_up_to_date = true
[[entry]]
name = "ion-git"
[[entry]]
name = "ly"
skip_branch_up_to_date = true
[[entry]]
name = "nouveau-fw"
skip_branch_up_to_date = true
[[entry]]
name = "ncurses5-compat-libs"
skip_branch_up_to_date = true
[[entry]]
name = "opencl-amd"
aur_deps = [
"ncurses5-compat-libs"
]
skip_branch_up_to_date = true
[[entry]]
name = "epson-inkjet-printer-escpr"
skip_branch_up_to_date = true
[[entry]]
name = "epson-inkjet-printer-escpr2"
skip_branch_up_to_date = true
[[entry]]
name = "google-chrome"
skip_branch_up_to_date = true
[[entry]]
name = "ifuse"
skip_branch_up_to_date = true
[[entry]]
name = "libva-vdpau-driver-chromium"
skip_branch_up_to_date = true
[[entry]]
name = "mate-screensaver-hacks"
skip_branch_up_to_date = true
[[entry]]
name = "mcrcon"
skip_branch_up_to_date = true
[[entry]]
name = "minecraft-launcher"
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-environment"
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-glm"
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-lua"
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-pkg-config"
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-cmake"
aur_deps = [
"mingw-w64-pkg-config",
"mingw-w64-environment"
]
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-configure"
aur_deps = [
"mingw-w64-pkg-config",
"mingw-w64-environment"
]
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-zlib"
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-libpng"
aur_deps = [
"mingw-w64-pkg-config",
"mingw-w64-environment",
"mingw-w64-configure",
"mingw-w64-zlib"
]
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-make"
aur_deps = [
"mingw-w64-environment"
]
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-libsodium"
aur_deps = [
"mingw-w64-environment",
"mingw-w64-configure",
"mingw-w64-pkg-config"
]
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-glfw"
aur_deps = [
"mingw-w64-pkg-config",
"mingw-w64-environment",
"mingw-w64-cmake"
]
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-raylib"
aur_deps = [
"mingw-w64-pkg-config",
"mingw-w64-environment",
"mingw-w64-cmake",
"mingw-w64-glfw"
]
skip_branch_up_to_date = true
[[entry]]
name = "mingw-w64-ldd"
skip_branch_up_to_date = true
[[entry]]
name = "moonscript"
skip_branch_up_to_date = true
[[entry]]
name = "nginx-mainline-mod-fancyindex"
skip_branch_up_to_date = true
[[entry]]
name = "non-mixer-lv2-git"
[[entry]]
name = "obs-studio-git"
aur_deps = [
"cef-minimal"
]
[[entry]]
name = "obs-v4l2sink"
skip_branch_up_to_date = true
[[entry]]
name = "pasystray-git"
aur_deps = [
"gnome-icon-theme"
]
[[entry]]
name = "pikaur"
skip_branch_up_to_date = true
[[entry]]
name = "qjoypad"
skip_branch_up_to_date = true
[[entry]]
name = "qt5-wayland-bugfixport-git"
[[entry]]
name = "quaternion"
skip_branch_up_to_date = true
[[entry]]
name = "samsung-unified-driver"
skip_branch_up_to_date = true
[[entry]]
name = "stdman"
skip_branch_up_to_date = true
[[entry]]
name = "sunvox"
skip_branch_up_to_date = true
[[entry]]
name = "wlroots-git"
[[entry]]
name = "swaybg-git"
[[entry]]
name = "sway-git"
aur_deps = [
"wlroots-git",
"swaybg-git"
]
other_deps = [
"mesa"
]
[[entry]]
name = "texlive-tikz-uml"
skip_branch_up_to_date = true
[[entry]]
name = "ttf-clear-sans"
skip_branch_up_to_date = true
[[entry]]
name = "umlet"
skip_branch_up_to_date = true
[[entry]]
name = "ungoogled-chromium"
ccache_dir = "/home/stephen/Downloads/aur/ccache_ungoogled_chromium"
skip_branch_up_to_date = true
[[entry]]
name = "wev"
skip_branch_up_to_date = true
[[entry]]
name = "wlhangul-git"

1203
update.py Executable file

File diff suppressed because it is too large Load diff