Repository conventions are important in order to ensure every package resemble themselves. Here are the things to keep in mind:
Prefer tarballs over git packages unless there is a sensible reason. Here are some:
Prefer sources without a dependency to ‘automake’. There are usually distribution tarballs that are ‘autoconf’’ed. Don’t submit tarballs with an automake dependency unless you are sure there is no alternative.
Avoid these packages:
Usually can be disabled by --disable-dbus
.
Usually can be disabled by --disable-nls
.
All build files on the repository should be a POSIX
shell script, and must start with #!/bin/sh -e
.
The next section is about package templates that should be used in order to ensure stylistic consistency. Note that the option configurations shouldn’t be taken literally, they are meant as examples.
#!/bin/sh -e make make DESTDIR="$1" PREFIX=/usr install
#!/bin/sh -e ./configure \ --prefix=/usr \ --disable-option \ --enable-option make make DESTDIR="$1" install
See 2020
#!/bin/sh -e autoreconf -fi ./configure \ --prefix=/usr \ --disable-option \ --enable-option make make DESTDIR="$1" install
The distribution provides a ‘cl-meson’ wrapper script which sets some common options like installation directories, disables downloading subprojects among other things. This is the preferred method for packages.
#!/bin/sh -e export DESTDIR=$1 cl-meson \ -Doption=false \ -Doption2=true \ . output ninja -C output ninja -C output install
#!/bin/sh -e export DESTDIR=$1 cmake -B build \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ -DOPTION=ON cmake --build build cmake --install build
#!/bin/sh -e export GOPATH=$PWD/gopath trap "go clean -modcache" EXIT INT go mod vendor go build install -Dm755 program "$1/usr/bin/program"
NOTE: Follow 2242 if you are packaging for non-Community repository. See 2242
#!/bin/sh -e python setup.py build python setup.py install --prefix=/usr --root="$1"
:ID: d2c828ae-bc56-4183-8830-becbf6a812d1
If you are a distribution maintainer create and upload vendor tarballs so that no internet connection is required during package compilation at all. You can use the following template for this case:
#!/bin/sh -e go build -v -mod=vendor clinst -Dm755 program "$1/usr/bin/program"