# 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
```bash
pipx install arch-github-package
```
pipx installs the package in a virtualenv, so it doesn't pollute your system.
You can also use pip:
```bash
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
```bash
agp install <github-repo>
```
Example:
```bash
agp install cortesi/devd
```
How does it work:
1. It looks for the latest release on GitHub.
1. 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.
1. 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>`.
1. 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` becomes
`devd-github`.
### List installed packages
```bash
agp list
```
### Check for upgrades
```bash
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
```bash
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`.
Raw data
{
"_id": null,
"home_page": null,
"name": "arch-github-package",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "AUR,arch,archlinux,github,package,package-manager",
"author": null,
"author_email": "Jin Liu <m.liu.jin@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/31/51/8e4e6d0bec79b858236b1af2a3ca9b634fa561f349f75cb473ace7b8f592/arch_github_package-0.0.7.tar.gz",
"platform": null,
"description": "# arch-github-package\n\nConvert GitHub project releases to Archlinux package, with autoupdate.\n\n## Why\n\nA lot of packages in Archlinux's AUR are just a single PKGBUILD file that downloads the\nlatest release from GitHub, and many of them are human-maintained, which means that they\nare not updated as soon as a new release is published.\n\nThis script provides an alternative. If a GitHub project has binary releases, it can\nautomatically download a release tarball, create a PKGBUILD file, makepkg, and install it.\nIt can also rebuild the package if a new release is found.\n\n## Installation\n\n```bash\npipx install arch-github-package\n```\n\npipx installs the package in a virtualenv, so it doesn't pollute your system.\n\nYou can also use pip:\n\n```bash\npip install --user --break-system-packages arch-github-package\n```\n\n(This will install the package in your user site-packages, not really breaking system packages.)\n\n## Usage\n\n### Install a package\n\n```bash\nagp install <github-repo>\n```\n\nExample:\n\n```bash\nagp install cortesi/devd\n```\n\nHow does it work:\n\n1. It looks for the latest release on GitHub.\n\n1. It tries to find a pre-built package for your system, by looking\n for keywords like \"linux\", \"x86-64\", \"x86_64\", \"amd64\", \"gnu\" in\n the release assets.\n\n1. It downloads the tarball, extracts it, and tries to dertermine which\n file goes where. E.g.:\n * If a file is ELF, or its x modbit is set, it goes to `/usr/bin`.\n * Files like *.1.gz go to `/usr/share/man`.\n * README.* go to `/usr/share/doc/<package-name>`.\n * LICENSE goes to `/usr/share/licenses/<package-name>`.\n\n1. It creates a PKGBUILD file, and runs `makepkg -si` to build and install it.\n The package name is `<github-project-name>-github`. E.g., `ortesi/devd` becomes\n `devd-github`.\n\n### List installed packages\n\n```bash\nagp list\n```\n\n### Check for upgrades\n\n```bash\nagp upgrade\n```\n\nYou can also use `agp upgrade <package-name>` to upgrade a single package.\n\nNote: if you run this command repeatively in quick succession, it will hit\nGitHub's rate limit for anonymous API access.\n\n### Uninstall a package\n\n```bash\nagp uninstall <package-name>\n```\n\nIf you uninstall an -github package with `pacman`, it will still be listed by `agp list`.\nSo remember to use `agp uninstall` to remove it.\n\n## Internals\n\n### Package metadata\n\nMetadata is stored under `~/.local/share/arch-github-package`.\n",
"bugtrack_url": null,
"license": null,
"summary": "Convert GitHub project releases to Archlinux package, with autoupdate.",
"version": "0.0.7",
"project_urls": {
"Bug Tracker": "https://github.com/jinliu/arch-github-package/issues",
"Repository": "https://github.com/jinliu/arch-github-package"
},
"split_keywords": [
"aur",
"arch",
"archlinux",
"github",
"package",
"package-manager"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "170a86334b462434000a786fe01f6eb62a1cb1c7fc4359dd62f5fcef1ca7c825",
"md5": "cc46396c15fb9b74f986fb897ed6f437",
"sha256": "af9c37689f887ca30574593aa7ff4f8ee3c35a6096e6acca5b8a0837799a2611"
},
"downloads": -1,
"filename": "arch_github_package-0.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cc46396c15fb9b74f986fb897ed6f437",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 11642,
"upload_time": "2023-07-10T03:52:27",
"upload_time_iso_8601": "2023-07-10T03:52:27.363569Z",
"url": "https://files.pythonhosted.org/packages/17/0a/86334b462434000a786fe01f6eb62a1cb1c7fc4359dd62f5fcef1ca7c825/arch_github_package-0.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "31518e4e6d0bec79b858236b1af2a3ca9b634fa561f349f75cb473ace7b8f592",
"md5": "0cd2d10f10d1a079a1d760b1b0d336aa",
"sha256": "d34694b279631f883fce73de1f7a530de26da37ef3702210a14664c57b247e26"
},
"downloads": -1,
"filename": "arch_github_package-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "0cd2d10f10d1a079a1d760b1b0d336aa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 10859,
"upload_time": "2023-07-10T03:52:26",
"upload_time_iso_8601": "2023-07-10T03:52:26.354253Z",
"url": "https://files.pythonhosted.org/packages/31/51/8e4e6d0bec79b858236b1af2a3ca9b634fa561f349f75cb473ace7b8f592/arch_github_package-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-10 03:52:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jinliu",
"github_project": "arch-github-package",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "arch-github-package"
}