Ports packaging guidelines - ParabolaWiki

# Ports packaging guidelines

The aim of this page is to list some ways to make packaging for non-Arch architectures easier, keep ports-specific differences small and avoid some problems when building, updating or using packages.

## Don't do other changes to arch= arrrays than adding your architecture name

It's useful to build the package on e.g. x86_64, since some bugs can be reproduced there and fixed on faster machines.

## Don't enable additional gcc warnings

There is no need for them. Fixing them should be done upstream.

## Sometimes missing dependencies are caused by cleansystem being updated

Update it and install missing packages in the chroot instead of adding e.g. pkg-config to makedepends.

## Don't change epoch

No architecture-specific change requires redoing package versioning scheme while this is the only use of epoch.

## Don't change pkgver unless to newer version fixing a problem

Reset pkgrel=1 in that case.

## Don't change pkgrel main number

This is needed to know if rebuilds due to Arch changes are needed; increase the second number.

## Don't do multiple uploads of the same pkgrel

Add .1 to it (e.g. 3 -> 3.1, 3.1 -> 3.2).

## Don't change pkgrel when just fixing a build error

There are other reasons to change it if e.g. a rebuild is needed to use different libraries. If the change doesn't affect user systems and only one package of specific pkgrel is uploaded, there is no need to change it.

Examples: first successful build of a package for a new architecture, unimportant optimizations or test fixes that can wait for the next pkgrel.

## Don't do unneeded changes

It's ok to make a package build or work faster on mips64el, or to use user-specified CFLAGS, it's not to change whitespace or commas in package description, unless having other reasons to change that line.

## Don't update config.guess or config.sub

Add these arguments to configure:

    --build=$CHOST --host=$CHOST

(--target=$CHOST is also needed in case of compilers, usually it being used is a bug). Ask upstream to update config.guess and config.sub for next release and blame KISS for PKGBUILDs not using a configure wrapper adding these and other generally useful options.

## Don't special-case adding -fPIC for mips64el

Do this instead:

    -  [ "$CARCH" = "x86_64" ] && CFLAGS+=" -fPIC"
    +  [ "$CARCH" != "i686" ] && CFLAGS+=" -fPIC"

or, preferrably, make upstream and Arch packages build with shared libraries.

## Don't duplicate dependency arrays

It makes merging Arch changes difficult, instead remove the arch-specific ones and append them in a conditional.

## Don't rename packages

There is no reason for this to be needed just for one arch; non FSDG-compatible names should be fixed in abslibre.

## Make changes to packages from repos included in abslibre directly there

This avoids having to fix build problems twice or to merge arch-specific changes (and the confusion of having two different PKGBUILDs possibly used to build a specific package).

## Don't do any changes for FSDG-compatibility

They are always needed on all arches, abslibre is a better place for them (and makes the change more visible for other distros).

## Always use fullpkg or treepkg for building a package with its dependencies

Otherwise packages will fail, build broken or break after updating the dependencies later without a clear indication that they need rebuilding. Toolchain updates are an exception, they need special ordering and are more difficult in some cases.

Categories:

- MIPS
- Packaging