https://github.com/orhun/alpkg
Set up Alpine Linux packaging environment with a breeze! ๐
https://github.com/orhun/alpkg
alpine alpine-linux alpine-package-builder alpine-packaging chroot chroot-environment packaging packaging-scripts packaging-tool
Last synced: 3 months ago
JSON representation
Set up Alpine Linux packaging environment with a breeze! ๐
- Host: GitHub
- URL: https://github.com/orhun/alpkg
- Owner: orhun
- License: mit
- Created: 2023-03-25T14:32:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T12:58:05.000Z (over 1 year ago)
- Last Synced: 2025-04-16T00:04:44.020Z (3 months ago)
- Topics: alpine, alpine-linux, alpine-package-builder, alpine-packaging, chroot, chroot-environment, packaging, packaging-scripts, packaging-tool
- Language: Shell
- Homepage: https://blog.orhun.dev/alpine-packaging-setup/
- Size: 8.72 MB
- Stars: 27
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# `alpkg` ๐
[](https://github.com/orhun/alpkg/actions)
**Set up Alpine Linux packaging environment with a breeze!** See [**this blog post**](https://blog.orhun.dev/alpine-packaging-setup).

`alpkg` is a tool for _all_ your Alpine packaging needs. It can create a chroot with preinstalled tools in a matter of seconds, set up [aports repository](https://gitlab.alpinelinux.org/alpine/aports), and fetch/update packages. Most importantly, it provides a split layout via [Zellij](https://github.com/zellij-org/zellij) for easy editing/building [`APKBUILD`](https://wiki.alpinelinux.org/wiki/APKBUILD_Reference) files.
## Requirements
- [alpine-chroot-install](https://github.com/alpinelinux/alpine-chroot-install)
- See [requirements](https://github.com/alpinelinux/alpine-chroot-install#requirements).## Usage
```
Usage: alpkg [init|edit|fetch|update] []Commands:
init Initialize an Alpine chroot.
edit Edit or create a package.
fetch Fetch an existing package from the remote repository.
update Update the package on the remote repository.
destroy Remove the chroot and repository.Options:
--packager "Your Name " The name and email address of the package maintainer.
--aports "https://gitlab.alpinelinux.org//aports" The URL of the remote APorts repository.Environment variables:
CHROOT_DIR Directory for Alpine chroot. (default: /alpine)
APORTS_DIR Directory for remote APorts repository. (default: /home/user/aports)
PACKAGE_DIR Directory for APK packages built and stored. (default: /home/user/apkbuilds in chroot)
```## Features
### `init`
To create an Alpine Linux chroot and initialize [aports repository](https://gitlab.alpinelinux.org/alpine/aports) for packaging, simply run:
```sh
alpkg init --packager "Your Name " --aports "https://gitlab.alpinelinux.org//aports"
```It is possible to pass options to `alpine-chroot-install` via environment variables.
Demo

\* You need to create an account on [https://gitlab.alpinelinux.org](https://gitlab.alpinelinux.org) and fork the [aports repository](https://gitlab.alpinelinux.org/alpine/aports) under your user.
\* If you run `alpkg init` in your `$HOME` directory, the Alpine working directory will point to `$HOME/apkbuilds`.
### `edit`
To create a new `APKBUILD`, you can use the `edit` command. Note that it uses [`newapkbuild`](https://wiki.alpinelinux.org/wiki/Include:Newapkbuild) under the hood so you can pass `newapkbuild` options to it:
```sh
alpkg edit
```For example:
```sh
alpkg edit -r -d "A highly customizable changelog generator" -l "GPL-3.0-only" -u "https://github.com/orhun/git-cliff" git-cliff
```Or you can generate an empty package with the following command:
```sh
alpkg edit testpkg
```Demo

If the package _already exists_, you can also use `edit` command to edit the contents of the `APKBUILD`.
Demo

### `fetch`
To fetch existing packages from `aports` and edit them:
```sh
alpkg fetch
```Demo

### `update`
To commit the changes to the `aports` repository:
```sh
alpkg update
```Demo

## License
This project is licensed under [The MIT License](./LICENSE).
## Copyright
Copyright ยฉ 2023, [Orhun Parmaksฤฑz](mailto:[email protected])