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
File details
Details for the file arch_github_package-0.0.7.tar.gz
.
File metadata
- Download URL: arch_github_package-0.0.7.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.24.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d34694b279631f883fce73de1f7a530de26da37ef3702210a14664c57b247e26 |
|
MD5 | 0cd2d10f10d1a079a1d760b1b0d336aa |
|
BLAKE2b-256 | 31518e4e6d0bec79b858236b1af2a3ca9b634fa561f349f75cb473ace7b8f592 |
File details
Details for the file arch_github_package-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: arch_github_package-0.0.7-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.24.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af9c37689f887ca30574593aa7ff4f8ee3c35a6096e6acca5b8a0837799a2611 |
|
MD5 | cc46396c15fb9b74f986fb897ed6f437 |
|
BLAKE2b-256 | 170a86334b462434000a786fe01f6eb62a1cb1c7fc4359dd62f5fcef1ca7c825 |