This document describes how to build native packages for different Linux distributions.
- Debian/Ubuntu:
.debpackages - Alt Linux and other RPM-based:
.rpmpackages - Arch Linux: AUR packages using
PKGBUILD
sudo apt-get install build-essential debhelper dh-python python3-all python3-setuptools python3-wheel python3-build python3-installer# On Alt Linux
sudo apt-get install rpm-build python3-devel python3-setuptools python3-wheel python3-pip
# On Fedora/CentOS
sudo dnf install rpm-build python3-devel python3-setuptools python3-wheel python3-pipsudo pacman -S base-devel python python-setuptools python-wheel python-build python-installerBuild all package formats:
make packagesBuild individual package formats:
make build-deb # Build Debian package
make build-rpm # Build RPM package
make build-arch # Build Arch Linux package-
Ensure you have the source distribution:
make dist
-
Build the Debian package:
dpkg-buildpackage -b -us -uc
The
.debfile will be created in the parent directory. -
To build a source package as well:
dpkg-buildpackage -S -us -uc
-
Set up RPM build directories (if not already done):
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} -
Copy source tarball and spec file:
cp dist/topalias-*.tar.gz ~/rpmbuild/SOURCES/ cp topalias.spec ~/rpmbuild/SPECS/
-
Build the RPM:
rpmbuild -ba ~/rpmbuild/SPECS/topalias.specThe RPM files will be in
~/rpmbuild/RPMS/noarch/and source RPM in~/rpmbuild/SRPMS/.
-
Build the package:
makepkg -s
-
Install the built package:
sudo pacman -U topalias-*.pkg.tar.xz -
To build without installing dependencies (if already installed):
makepkg -s --skipinteg
sudo dpkg -i topalias_*.deb
sudo apt-get install -f # Install dependencies if needed# On Alt Linux
sudo apt-get install topalias-*.rpm
# On Fedora/CentOS
sudo dnf install topalias-*.rpmsudo pacman -U topalias-*.pkg.tar.xzOr if published to AUR:
yay -S topalias
# or
paru -S topaliasWhen releasing a new version, update the version in:
setup.py(version field)pyproject.toml(version field)topalias/__init__.py(__version__variable)PKGBUILD(pkgverfield)topalias.spec(Versionfield)debian/changelog(add new entry)
- The PKGBUILD uses
SKIPfor sha256sums initially. After the first successful build, update it with the actual checksum. - For RPM packages, you may need to adjust the
%{?dist}macro based on your distribution. - Debian packages use
debian/compatversion 13, which requires debhelper >= 13.