mirror of
https://github.com/terrapkg/packages.git
synced 2026-05-31 17:11:56 +00:00
2.8 KiB
2.8 KiB
Creating a new package
Prerequisites
- ensure the package doesn't exist in fedora repos
- avoid name coincide with other packages (including Fedora ones)
Create dir struct
- Change directory to
anda/. If the package is related to any categories,cdinto the corresponding folder.- For example, A Pantheon DE package goes into
anda/desktops/elementary/. - If the category is undecided, it's ok to put it in
anda/.
- For example, A Pantheon DE package goes into
- Let's say we are adding a package called
tic-tac-toe. We are going to make a new directory and add some required files:
cd anda/games
mkdir tic-tac-toe
cd tic-tac-toe
touch anda.hcl tic-tac-toe.spec
- Edit
anda.hcl, which tells the Andaman toolchain how to build the package:
project "pkg" {
rpm {
spec = "tic-tac-toe.spec"
sources = "."
}
}
- Edit the spec file
tic-tac-toe.spec. It is an RPM spec file, and you are advised to read the documentation:- This RPM Packaging Guide might help newbies with no prior experiences with RPM specs.
- This Spec file format docs goes into the details of the spec file format.
Spec file
In general, you should state the name and the latest version of the package first.
- Use
Release: %autoreleaseunless you know what you are doing - The
Licensefield is required. If you don't know the license, check its repository page for the license file, or check other package repositories (such as the AUR) if it already exists there - State its dependencies with
Requires - You will build the package. Add the
BulidRequirespackages - Add
Source0orSource1or more. These preambles should link to a compressed file (preferablytar) and will be extracted during%prep - The source file will be automatically downloaded and extracted if you use
%autosetup -n <root dir name in tar file>inside%prep. Checkblackbox-terminal.specas an example - If it is not a tar archive, extract the file manually with a command. See
authy.specas an example (unsquashfs) - Inside
%build, you might need to build the package.%mesonand%cmakeis supported. Checkblackbox-terminalorprismlauncher- if not, manually state the command
- Copy, move, install files or add symlinks in
%install - List out all the files to be included inside
%files - Add
%changelog(message preferrably "Initial Package")
Building
- Check if your new package builds. See BUILDING.md
anda build -c anda-37-x86_64 anda/games/tic-tac-toe/pkg
- If it doesn't build, fix your spec file and try again
Finish
- Push and create a new PR