You need at least 10 GiB of free space for the containers.
You need to install the
$ pacman -S arch-install-scripts git
$ git clone firstname.lastname@example.org:chakra/chakrabuildsystem.git # ssh $ git clone https://code.chakralinux.org/chakra/chakrabuildsystem.git # https, read-only
It is important to keep your clone up to date, update it regularly by running
$ cd chakrabuildsystem $ git pull
Create a container
cd to your local clone of
chakrabuildsystem.git, and create a container using
make_chroot.sh and one of the provided configuration files in
$ ./make_chroot.sh conf/stable.conf
conf/ to find the configuration files can be used. For now, we use
lib32-testing.conf because we use the
testing branch instead of
If you don't have write access to our repositories, use the
-n option. Access can be requested here. Read
./make_chroot.sh -h for more information.
A number of default configuration files are provided - but you can write your own too. They are simply
pacman.conf files, for more information read
$ man pacman.conf.
The script will ask for your user password. Remember that your user must have
$ ./make_chroot.sh conf/stable.conf :: Running as user: jsmith :: Running on Chakra: 2015.03 :: Using pacman :: Root : chroots :: Chroot Installation : chroots/stable :: Do you want to continue? [Y/n]
Verify that the paths are correct, then type
y and press
Enter to continue. The script will install all the required packages. If you didn't run the script with the
-n option, you will be asked for your
ssh key passphrase.
:: Enter your git crendentials :: Full name (e.g. 'John Smith'): John Smith :: E-mail (e.g. 'email@example.com'): firstname.lastname@example.org :: Enter your ssh username: jsmith
You now have a container created and prepared to manage a repository. You can repeat the process for a different configuration. If there were errors during the process, e.g. no Internet connection, or a wrong password, the script will continue until the end. You may need to remove the container and try again.
If you are building C packages for the
[lib32] repo, you need to install
gcc will not work in 32-bits mode (should be done automatically by the script):
$ sudo pacman -S lib32-glibc lib32-gcc-libs
Enter a container
To enter the
$ ./enter_chroot.sh desktop
Or, for the
testing git branch of
$ ./enter_chroot.sh desktop testing
./enter_chroot.sh -h for more information.
You will be asked for your password (if it isn't cached). Upon entering the container, git will fetch the newest changes from our git repositories and display whether your local clone is ahead of or behind upstream (or both). If either is true, synchronize the git repository before doing any kind of work. To ensure that your container is clean and synchronized before packaging, a good practice is to always do this first after entering your container:
$ git pull $ pacman -Syu
You can view the current remote URL with:
$ git remote show origin
You can set a new one with:
$ git remote set-url origin <url>
Exit a container
Press Ctrl+D or run:
Remove a container
To be written.
Add a new package
To create a new package, read the Arch Linux wiki article on the subject, and make sure you follow our Packaging Standards. If you are importing a source tarball from the CCR, check our Packaging Standards too, since there are some differences between entries in the CCR and packages in the official repositories.
Once you have the
PKGBUILD and other needed files ready, put them in a directory with the name of the package, and put that directory into the
cd to the directory of the package and run
cd <package_name> makepkg -sr
:cp is an alias for
rm pkg src dbg hdr -r. Once compiled, clean the directory of the package - but leave the
PKGBUILD file and any
ChangeLog, or patches. That is, the files that were already in the directory before running
makepkg. Then check what new files there are and what you have changed:
$ git status
There should be no new files, since you already deleted them during the build process. If there is any unexpected, untracked file, remove it, and run
git status again. Note that when a package is successfully built, it is moved to
/chakra/_repo/<container>, and the
.pkg.tar.xz file in package directory is just a symlink that git will ignore, i.e. you don't need to delete it. You can and should test the package in your own system before submitting it to the git and package repositories. Exit your container,
chakra/_repo/<container>/, and install it:
$ pacman -U path/to/package.pkg.tar.xz
Run it in your system, and once you have verified that it works as expected, go to Commit and push the changes.
Update a package
First thing you need to do is to update the
PKGBUILD of the software you are updating. Change the
pkgver variable to its new version, or increase the
pkgrel variable if you are rebuilding the same version of the package (i.e. with an additional patch). Update the
md5sum (if sources changed). You need to run
makepkg -g >> PKGBUILD from inside the directory that contains the PKGBUILD to do that, and should then move the new
md5sum to its right position, after the
source variable. You can then follow the steps of Add a new package - skipping the first one.
Package chains are lists of packages you may need to build at the same time, and in a specific order. These are defined in configuration files (
.order) in the git repository, together with all the package directories that contain the PKGBUILDs. You can create your own, custom
.conf files for use with
.conffiles include parameters that are common for all the packages
.orderfiles include a list of the packages, ordered according to their dependencies (if package
Adepends on package
Bneeds to be above
Ain the list) Some frequently used
applications.order. See Building Frameworks, Plasma, and Applications by KDE for more information.
Commit and push the changes
After testing the package you can commit and push your changes to our source code repositories for packages. Enter the container again, and run:
$ git status # Verify that the changes are correct. $ git add <package_name> # Replace <package_name> with the name of the folder containing the package. $ git commit -m "package_name: short description of the changes you performed" # Commit the changes.
Example of updating a single package to a new version:
vlc: Update to 2.0.2
Example of updating a group of packages to new versions:
blender: Rebuild against Python 3
Example of adding a patch:
firefox: Add patch for KDE integration
Only add a single package or directory per commit - multiple packages or directories in a commit is only allowed during package chain upgrades.
$ git push # This is what actually send the changes to the git repository.
gp is an alias for
git push. Despite the one-package-per-commit limit, you can push multiple commits at once.
Managing the official package repositories
Upload a package to rsync.chakralinux.org
You can upload your new package(s) with
upload.sh. Use the
-r switch to define a specific repository to which to upload the package:
$ upload.sh -r repository_name package_name
-r switch is agnostic of the order and the command can include more than one package. As a result one can also use:
$ upload.sh package_name package_name -r repository_name # Alternatively: $ upload.sh package_name -r repository_name package_name
A typical package upload looks like this:
:: You are about to upload (1) packages and (1) signatures to «repo-x86_64»: /chakra/_repo/<container>/<full_pkg_file_name> /chakra/_repo/<container>/<full_pkg_file_name>.sig
Move a package on rsync.chakralinux.org
To move a package or group of packages from a repository to another, run:
$ move.sh package_name source_repository_name target_repository_name
target_repository_name is optional, the script will try to detect the target repository.
$ move.sh package_name $ move.sh package_name source_repository_name
Delete a package from rsync.chakralinux.org
To delete a package or group of packages from the current container repository name, run:
$ remove.sh package_name
From a different repository, run:
$ remove.sh package_name repository_name