I'm using archlinux and i want to make my own packages with my own modification ,
So , how can i create a new archlinux package with source code and how to modify existing one?
and finally, how to download the binary or source code for archlinux packages like :
apt download [package name]
or
apt source [package name]
in debian or ubuntu package manager?
Best Answer
Arch Linux packages are built with
makepkg
tool. In order to build a package from scratch you need to create aPKGBUILD
file which defines package metadata and build steps. This file is essentially a Bash script.A very basic
PKGBUILD
file could look like this:It creates a package which installs
updates.py
file into/usr/bin
directory.For more information see ArchWiki page, which describes in depth how Arch Linux packaging works and how to properly build a package.
There is also an ArchLinux User Repository (AUR) which contains
PKGBUILD
files created by users. You can choose a package and click view PKGBUILD to get better idea how others write theirPKGBUILD
files.You can use
pacman
to download a package:This will download a package with all its dependencies into
/var/cache/pacman/pkg
.For more information on using
pacman
you can also check out corresponding ArchWiki page.