Convert GitHub project releases to Archlinux package, with autoupdate.
Project description
arch-github-package
Convert GitHub project releases to Archlinux package, with autoupdate.
Why
A lot of packages in Archlinux's AUR are just a single PKGBUILD file that downloads the latest release from GitHub, and many of them are human-maintained, which means that they are not updated as soon as a new release is published.
This script provides an alternative. If a GitHub project has binary releases, it can automatically download a release tarball, create a PKGBUILD file, makepkg, and install it. It can also rebuild the package if a new release is found.
Installation
pipx install arch-github-package
pipx installs the package in a virtualenv, so it doesn't pollute your system.
You can also use pip:
pip install --user --break-system-packages arch-github-package
(This will install the package in your user site-packages, not really breaking system packages.)
Usage
Install a package
agp install <github-repo>
Example:
agp install cortesi/devd
How does it work:
-
It looks for the latest release on GitHub.
-
It tries to find a pre-built package for your system, by looking for keywords like "linux", "x86-64", "x86_64", "amd64", "gnu" in the release assets.
-
It downloads the tarball, extracts it, and tries to dertermine which file goes where. E.g.:
- If a file is ELF, or its x modbit is set, it goes to
/usr/bin
. - Files like *.1.gz go to
/usr/share/man
. - README.* go to
/usr/share/doc/<package-name>
. - LICENSE goes to
/usr/share/licenses/<package-name>
.
- If a file is ELF, or its x modbit is set, it goes to
-
It creates a PKGBUILD file, and runs
makepkg -si
to build and install it. The package name is<github-project-name>-github
. E.g.,ortesi/devd
becomesdevd-github
.
List installed packages
agp list
Check for upgrades
agp upgrade
You can also use agp upgrade <package-name>
to upgrade a single package.
Note: if you run this command repeatively in quick succession, it will hit GitHub's rate limit for anonymous API access.
Uninstall a package
agp uninstall <package-name>
If you uninstall an -github package with pacman
, it will still be listed by agp list
.
So remember to use agp uninstall
to remove it.
Internals
Package metadata
Metadata is stored under ~/.local/share/arch-github-package
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for arch_github_package-0.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80970072b8e721f2f75f9ec53ec4bd4840753f8e67a16b1db1e93a3de546eead |
|
MD5 | af8e3d3f7857532b746a9f5a46c8dced |
|
BLAKE2b-256 | 270b45ac017fcae3ecd04adba2b40a7e96f952bd274957cff71444c07bff3aec |
Hashes for arch_github_package-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bebd5e6de02d1ffcae09818e5841a6eb6e51c284b25ad82aae984b38a2f8379f |
|
MD5 | 4bb582e578dcfef78576a9f0726217ad |
|
BLAKE2b-256 | d5a6384a449b131a286a8517fb9df3c3e9739c4d1b0b3e6171fce42c148a0f68 |