Manjaro Difference between revisions of "Manjaro Packaging Standards"

Difference between revisions of "Manjaro Packaging Standards"

From Manjaro
imported>Philm
(Created page with "'''The submitted PKGBUILDs must not build applications already in any of the official binary repositories under any circumstances. Exception to this strict rule may only be pa...")
 
m (replacing Arch on Manjaro)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
<languages/>
__TOC__
<translate>
<!--T:1-->
'''The submitted PKGBUILDs must not build applications already in any of the official binary repositories under any circumstances. Exception to this strict rule may only be packages having extra features enabled and/or patches in comparison to the official ones. In such an occasion, the pkgname array should be different.'''
'''The submitted PKGBUILDs must not build applications already in any of the official binary repositories under any circumstances. Exception to this strict rule may only be packages having extra features enabled and/or patches in comparison to the official ones. In such an occasion, the pkgname array should be different.'''


<!--T:2-->
When building packages for Manjaro Linux, '''adhere to the package guidelines''' below, especially if the intention is
When building packages for Manjaro Linux, '''adhere to the package guidelines''' below, especially if the intention is
to '''contribute''' a new package
to '''contribute''' a new package
to Manjaro Linux. You should also see the [https://archlinux.org/pacman/PKGBUILD.5.html PKGBUILD] and
to Manjaro Linux. You should also see the [https://archlinux.org/pacman/PKGBUILD.5.html PKGBUILD] and
[https://archlinux.org/pacman/makepkg.8.html makepkg] manpages.
[https://archlinux.org/pacman/makepkg.8.html makepkg] manpages.
 
</translate>
==PKGBUILD prototype==
<translate>
==PKGBUILD prototype== <!--T:3-->
{{bc|1=
{{bc|1=
# Maintainer: Your Name <youremail@domain.com>
# Maintainer: Your Name <youremail@domain.com>
Line 31: Line 37:
md5sums=() #autofill using updpkgsums
md5sums=() #autofill using updpkgsums


<!--T:4-->
build() {
build() {
   cd $pkgname-$pkgver
   cd $pkgname-$pkgver


   ./configure --prefix=/usr
   <!--T:5-->
./configure --prefix=/usr
   make
   make
}
}


<!--T:6-->
package() {
package() {
   cd $pkgname-$pkgver
   cd $pkgname-$pkgver


   make DESTDIR="$pkgdir/" install
   <!--T:7-->
make DESTDIR="$pkgdir/" install
}
}
}}
}}


<!--T:8-->
Other prototypes are found in {{ic|/usr/share/pacman}} from the pacman and abs packages.
Other prototypes are found in {{ic|/usr/share/pacman}} from the pacman and abs packages.
</translate>
<translate>
==Package etiquette== <!--T:9-->


==Package etiquette==
<!--T:10-->
 
<ul>
<ul>
<li>Packages should '''never''' be installed to {{ic|/usr/local}}</li>
<li>Packages should '''never''' be installed to {{ic|/usr/local}}</li>
<li>
<li>
Line 57: Line 70:
in makepkg itself.
in makepkg itself.


If a new variable is absolutely required,
<!--T:11-->
If a new variable is absolutely required,
'''prefix the variable name with an underscore''' ({{ic|_}}), e.g.
'''prefix the variable name with an underscore''' ({{ic|_}}), e.g.
{{bc|1=_customvariable=}}
{{bc|1=_customvariable=}}


The AUR cannot detect the use of custom variables and so cannot use them in substitutions.  This can most often be seen in the source array e.g.
<!--T:12-->
The AUR cannot detect the use of custom variables and so cannot use them in substitutions.  This can most often be seen in the source array e.g.
{{bc|<nowiki>http://downloads.sourceforge.net/directxwine/$patchname.$patchver.diff.bz2</nowiki>}}
{{bc|<nowiki>http://downloads.sourceforge.net/directxwine/$patchname.$patchver.diff.bz2</nowiki>}}
Such a situation defeats the effective functionality of the AUR.
Such a situation defeats the effective functionality of the AUR.
</li>
</li>


<li>
<!--T:13-->
<li>
'''Avoid''' using {{ic|/usr/libexec/}} for
'''Avoid''' using {{ic|/usr/libexec/}} for
anything. Use {{ic|/usr/lib/${pkgname}/}} instead.
anything. Use {{ic|/usr/lib/${pkgname}/}} instead.
Line 75: Line 91:
the appropriate option in the {{ic|/etc/makepkg.conf}}
the appropriate option in the {{ic|/etc/makepkg.conf}}


file, or alternatively override it by creating ~/.makepkg.conf
<!--T:14-->
file, or alternatively override it by creating ~/.makepkg.conf


</li>
<!--T:15-->
</li>
<li>
<li>
All important messages should be echoed during install using an '''.install file'''. For
All important messages should be echoed during install using an '''.install file'''. For
Line 94: Line 112:
}}
}}


<!--T:16-->
The above example is taken from the <b>wine</b> package in {{Ic|extra}}. The optdepends
The above example is taken from the <b>wine</b> package in {{Ic|extra}}. The optdepends
information is automatically printed out on installation/upgrade so
information is automatically printed out on installation/upgrade so
one should <b>not</b> keep this kind of information in .install files.
one should <b>not</b> keep this kind of information in .install files.


<!--T:17-->
</li>
</li>
         <li>When creating a '''package description''' for a package, do not include
         <li>When creating a '''package description''' for a package, do not include
Line 106: Line 126:
</ul>
</ul>


==Package naming==
</translate>
==Package naming==
<translate>
==Package naming== <!--T:18-->
* Package names should consist of '''alphanumeric characters only'''; all letters should be '''lowercase'''.
* Package names should consist of '''alphanumeric characters only'''; all letters should be '''lowercase'''.
* Package names should NOT be suffixed with the upstream major release version number (e.g. we don't want libfoo2 if upstream calls it libfoo v2.3.4) in case the library and its dependencies are expected to be able to keep using the most recent library version with each respective upstream release. However, for some software or dependencies, this can not be assumed. In the past this has been especially true for widget toolkits such as GTK and Qt. Software that depends on such toolkits can usually not be trivially ported to a new major version. As such, in cases where software can not trivially keep rolling alongside its dependencies, package names should carry the major version suffix (e.g. gtk2, gtk3, qt4, qt5). For cases where most dependencies can keep rolling along the newest release but some can't (for instance closed source that needs libpng12 or similar), a deprecated version of that package might be called libfoo1 while the current version is just libfoo.
* Package names should NOT be suffixed with the upstream major release version number (e.g. we don't want libfoo2 if upstream calls it libfoo v2.3.4) in case the library and its dependencies are expected to be able to keep using the most recent library version with each respective upstream release. However, for some software or dependencies, this can not be assumed. In the past this has been especially true for widget toolkits such as GTK and Qt. Software that depends on such toolkits can usually not be trivially ported to a new major version. As such, in cases where software can not trivially keep rolling alongside its dependencies, package names should carry the major version suffix (e.g. gtk2, gtk3, qt4, qt5). For cases where most dependencies can keep rolling along the newest release but some can't (for instance closed source that needs libpng12 or similar), a deprecated version of that package might be called libfoo1 while the current version is just libfoo.
* Package versions '''should be the same as the version released by the author'''. Versions can include letters if need be (eg, nmap's version is 2.54BETA32). '''Version tags may not include hyphens!''' Letters, numbers, and periods only.
* Package versions '''should be the same as the version released by the author'''. Versions can include letters if need be (eg, nmap's version is 2.54BETA32). '''Version tags may not include hyphens!''' Letters, numbers, and periods only.
* Package releases are '''specific to Arch Linux packages'''. These allow users to differentiate between newer and older package builds. When a new package version is first released, the '''release count starts at 1'''. Then as fixes and optimizations are made, the package will be '''re-released''' to the Arch Linux public and the '''release number will increment'''. When a new version comes out, the release count resets to 1. Package release tags follow the '''same naming restrictions as version tags'''.
* Package releases are '''specific to Manjaro Linux packages'''. These allow users to differentiate between newer and older package builds. When a new package version is first released, the '''release count starts at 1'''. Then as fixes and optimizations are made, the package will be '''re-released''' to the Manjaro Linux public and the '''release number will increment'''. When a new version comes out, the release count resets to 1. Package release tags follow the '''same naming restrictions as version tags'''.
 
</translate>
==Directories==
<translate>
==Directories== <!--T:19-->
* '''Configuration files''' should be placed in the {{ic|/etc}} directory. If there is more than one configuration file, it is customary to '''use a subdirectory''' in order to keep the {{ic|/etc}} area as clean as possible. Use {{ic|/etc/{pkgname}/}}  where {{ic|<nowiki>{pkgname}</nowiki>}} is the name of the package (or a suitable alternative, eg, apache uses {{ic|/etc/httpd/}}).
* '''Configuration files''' should be placed in the {{ic|/etc}} directory. If there is more than one configuration file, it is customary to '''use a subdirectory''' in order to keep the {{ic|/etc}} area as clean as possible. Use {{ic|/etc/{pkgname}/}}  where {{ic|<nowiki>{pkgname}</nowiki>}} is the name of the package (or a suitable alternative, eg, apache uses {{ic|/etc/httpd/}}).


<!--T:20-->
* Package files should follow these '''general directory guidelines''':
* Package files should follow these '''general directory guidelines''':


<!--T:21-->
:{|
:{|
|-
|-
Line 157: Line 181:
|}
|}


<!--T:22-->
* Packages should not contain any of the following directories:
* Packages should not contain any of the following directories:
** {{ic|/dev}}
** {{ic|/dev}}
Line 170: Line 195:
** {{ic|/var/tmp}}
** {{ic|/var/tmp}}
** {{ic|/run}}
** {{ic|/run}}
</translate>
<translate>
==Makepkg duties== <!--T:23-->


==Makepkg duties==
<!--T:24-->
 
<p>
<p>
When [[makepkg]] is used to build a package, it does the
When [[makepkg]] is used to build a package, it does the
following automatically:
following automatically:
</p>
</p>


<ol>
<!--T:25-->
<ol>
<li>
<li>
Checks if package '''dependencies''' and '''makedepends''' are installed
Checks if package '''dependencies''' and '''makedepends''' are installed
Line 196: Line 224:
<li>
<li>


'''Builds''' the software and installs it in a fake
<!--T:26-->
'''Builds''' the software and installs it in a fake
root
root
</li>
</li>
Line 212: Line 241:
</li>
</li>


<li>
<!--T:27-->
<li>
'''Compresses''' the fake root into the package file
'''Compresses''' the fake root into the package file
</li>
</li>
Line 219: Line 249:
</li>
</li>


</ol>
<!--T:28-->
 
</ol>
==Architectures==
</translate>
<translate>
==Architectures== <!--T:29-->
The {{Ic|arch}} array should contain {{Ic|'i686'}} and/or {{Ic|'x86_64'}} depending on which architectures it can be built on. You can also use {{Ic|'any'}} for architecture independent packages.
The {{Ic|arch}} array should contain {{Ic|'i686'}} and/or {{Ic|'x86_64'}} depending on which architectures it can be built on. You can also use {{Ic|'any'}} for architecture independent packages.
 
</translate>
==Licenses==
<translate>
==Licenses== <!--T:30-->
The [[Licenses|license]] array is being implemented in the official repos, and it <b>should</b> be used in your packages as well. Use it as follows:
The [[Licenses|license]] array is being implemented in the official repos, and it <b>should</b> be used in your packages as well. Use it as follows:
<ul>
<ul>
Line 239: Line 272:
<li>The MIT, BSD, zlib/libpng and Python licenses are special cases and cannot be included in the 'common' licenses pkg.  For the sake of the license variable, it is treated like a common license (license=('BSD'), license=('MIT'), license=('ZLIB') or license=('Python')) but for the sake of the filesystem, it is a custom license, because each one has its own copyright line.  Each MIT, BSD, zlib/libpng or Python licensed package should have its unique license stored in /usr/share/licenses/$pkgname/.</li>
<li>The MIT, BSD, zlib/libpng and Python licenses are special cases and cannot be included in the 'common' licenses pkg.  For the sake of the license variable, it is treated like a common license (license=('BSD'), license=('MIT'), license=('ZLIB') or license=('Python')) but for the sake of the filesystem, it is a custom license, because each one has its own copyright line.  Each MIT, BSD, zlib/libpng or Python licensed package should have its unique license stored in /usr/share/licenses/$pkgname/.</li>
<li>Some packages may not be covered by a single license.  In these cases multiple entries may be made in the license array e.g. license=("GPL" "custom:some commercial license").  For the majority of packages these licenses apply in different cases, as opposed to applying at the same time.  When pacman gets the ability to filter on licenses (so you can say, "I only want GPL and BSD licensed software") dual (or more) licenses will be treated by pacman using OR, rather than AND logic, thus pacman will consider the above example as GPL licensed software, regardless of the other licenses listed.</li>
<li>Some packages may not be covered by a single license.  In these cases multiple entries may be made in the license array e.g. license=("GPL" "custom:some commercial license").  For the majority of packages these licenses apply in different cases, as opposed to applying at the same time.  When pacman gets the ability to filter on licenses (so you can say, "I only want GPL and BSD licensed software") dual (or more) licenses will be treated by pacman using OR, rather than AND logic, thus pacman will consider the above example as GPL licensed software, regardless of the other licenses listed.</li>
<li>The (L)GPL has many versions and permutations of those versions. For (L)GPL software, the convention is:
<li>The (L)GPL has many versions and permutations of those versions. For (L)GPL software, the convention is:</li>
<ul>
<ul>
<li>(L)GPL - (L)GPLv2 or any later version</li>
<li>(L)GPL - (L)GPLv2 or any later version</li>
Line 247: Line 280:
</li>
</li>
</ul>
</ul>
 
</translate>
==Submitting packages to the AUR==
<translate>
==Submitting packages to the AUR== <!--T:31-->
<p>Note the following before submitting any packages to the AUR:</p>
<p>Note the following before submitting any packages to the AUR:</p>


<ol>
<!--T:32-->
<ol>
         <li>
         <li>
                 The submitted PKGBUILDs '''MUST NOT''' build applications already in any of the official binary repositories under any circumstances. Exception to this strict rule may only be packages having extra features enabled and/or patches in compare to the official ones. In such an occasion the pkgname array should be different to express that difference.
                 The submitted PKGBUILDs '''MUST NOT''' build applications already in any of the official binary repositories under any circumstances. Exception to this strict rule may only be packages having extra features enabled and/or patches in compare to the official ones. In such an occasion the pkgname array should be different to express that difference.
Line 264: Line 299:
                 your email to protect against spam:
                 your email to protect against spam:


<!--T:33-->
{{bc|# Maintainer: Your Name <address at domain dot com>}}
{{bc|# Maintainer: Your Name <address at domain dot com>}}


<!--T:34-->
If you are assuming the role of maintainer for an existing PKGBUILD, add your name to the top as described above and change the title of the previous Maintainer(s) to Contributor:
If you are assuming the role of maintainer for an existing PKGBUILD, add your name to the top as described above and change the title of the previous Maintainer(s) to Contributor:


<!--T:35-->
{{bc|# Maintainer: Your Name <address at domain dot com>
{{bc|# Maintainer: Your Name <address at domain dot com>
# Contributor: Previous Name <address at domain dot com>}}
# Contributor: Previous Name <address at domain dot com>}}


</li>
<!--T:36-->
</li>
<li>
<li>
Verify the package '''dependencies''' (eg, run
Verify the package '''dependencies''' (eg, run
Line 277: Line 316:
by scripts, etc).
by scripts, etc).


The TU team '''strongly''' recommend the use of the
<!--T:37-->
The TU team '''strongly''' recommend the use of the
{{ic|namcap}} utility, written by Jason Chu (jason@archlinux.org), to analyze the
{{ic|namcap}} utility, written by Jason Chu (jason@archlinux.org), to analyze the
sanity of packages. {{ic|namcap}} will warn you about
sanity of packages. {{ic|namcap}} will warn you about
Line 284: Line 324:
{{ic|namcap}} package with {{ic|pacman}}.
{{ic|namcap}} package with {{ic|pacman}}.


Remember {{ic|namcap}} can be used to check both pkg.tar.gz files and PKGBUILDs
<!--T:38-->
Remember {{ic|namcap}} can be used to check both pkg.tar.gz files and PKGBUILDs
</li>
</li>
<li> '''Dependencies'''
<li> '''Dependencies'''
Line 301: Line 342:
e.g. foo.tar.gz.
e.g. foo.tar.gz.


<!--T:39-->
One can easily build a tarball containing all the required files by using {{Ic|makepkg --source}}. This
One can easily build a tarball containing all the required files by using {{Ic|makepkg --source}}. This
makes a tarball named {{Ic|$pkgname-$pkgver-$pkgrel.src.tar.gz}}, which can then be uploaded to the AUR.
makes a tarball named {{Ic|$pkgname-$pkgver-$pkgrel.src.tar.gz}}, which can then be uploaded to the AUR.
Line 307: Line 349:
</li>
</li>


</ol>
<!--T:40-->
</ol>
</translate>
 
[[Category:Contents Page{{#translation:}}]]

Latest revision as of 09:42, 10 February 2023

Other languages:
English • ‎русский

The submitted PKGBUILDs must not build applications already in any of the official binary repositories under any circumstances. Exception to this strict rule may only be packages having extra features enabled and/or patches in comparison to the official ones. In such an occasion, the pkgname array should be different.

When building packages for Manjaro Linux, adhere to the package guidelines below, especially if the intention is to contribute a new package to Manjaro Linux. You should also see the PKGBUILD and makepkg manpages.

PKGBUILD prototype

# Maintainer: Your Name <youremail@domain.com>
pkgname=NAME
pkgver=VERSION
pkgrel=1
pkgdesc=""
arch=()
url=""
license=('GPL')
groups=()
depends=()
makedepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=($pkgname-$pkgver.tar.gz)
noextract=()
md5sums=() #autofill using updpkgsums

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="$pkgdir/" install
}

Other prototypes are found in /usr/share/pacman from the pacman and abs packages.

Package etiquette

  • Packages should never be installed to /usr/local
  • Do not introduce new variables into PKGBUILD build scripts, unless the package cannot be built without doing so, as these could possibly conflict with variables used in makepkg itself. If a new variable is absolutely required, prefix the variable name with an underscore (_), e.g.
    _customvariable=

    The AUR cannot detect the use of custom variables and so cannot use them in substitutions. This can most often be seen in the source array e.g.

    http://downloads.sourceforge.net/directxwine/$patchname.$patchver.diff.bz2

    Such a situation defeats the effective functionality of the AUR.

  • Avoid using /usr/libexec/ for anything. Use /usr/lib/${pkgname}/ instead.
  • The packager field from the package meta file can be customized by the package builder by modifying the appropriate option in the /etc/makepkg.conf file, or alternatively override it by creating ~/.makepkg.conf
  • All important messages should be echoed during install using an .install file. For example, if a package needs extra setup to work, directions should be included.
  • Any optional dependencies that are not needed to run the package or have it generally function should not be included; instead the information should be added to the optdepends array:
    optdepends=('cups: printing support'
                'sane: scanners support'
                'libgphoto2: digital cameras support'
                'alsa-lib: sound support'
                'giflib: GIF images support'
                'libjpeg: JPEG images support'
                'libpng: PNG images support')

    The above example is taken from the wine package in extra. The optdepends information is automatically printed out on installation/upgrade so one should not keep this kind of information in .install files.

  • When creating a package description for a package, do not include the package name in a self-referencing way. For example, "Nedit is a text editor for X11" could be simplified to "A text editor for X11". Also try to keep the descriptions to ~80 characters or less.
  • Try to keep the line length in the PKGBUILD below ~100 characters.
  • Where possible, remove empty lines from the PKGBUILD (provides, replaces, etc.)
  • It is common practice to preserve the order of the PKGBUILD fields as shown above. However, this is not mandatory, as the only requirement in this context is correct bash syntax.

Package naming

  • Package names should consist of alphanumeric characters only; all letters should be lowercase.
  • Package names should NOT be suffixed with the upstream major release version number (e.g. we don't want libfoo2 if upstream calls it libfoo v2.3.4) in case the library and its dependencies are expected to be able to keep using the most recent library version with each respective upstream release. However, for some software or dependencies, this can not be assumed. In the past this has been especially true for widget toolkits such as GTK and Qt. Software that depends on such toolkits can usually not be trivially ported to a new major version. As such, in cases where software can not trivially keep rolling alongside its dependencies, package names should carry the major version suffix (e.g. gtk2, gtk3, qt4, qt5). For cases where most dependencies can keep rolling along the newest release but some can't (for instance closed source that needs libpng12 or similar), a deprecated version of that package might be called libfoo1 while the current version is just libfoo.
  • Package versions should be the same as the version released by the author. Versions can include letters if need be (eg, nmap's version is 2.54BETA32). Version tags may not include hyphens! Letters, numbers, and periods only.
  • Package releases are specific to Manjaro Linux packages. These allow users to differentiate between newer and older package builds. When a new package version is first released, the release count starts at 1. Then as fixes and optimizations are made, the package will be re-released to the Manjaro Linux public and the release number will increment. When a new version comes out, the release count resets to 1. Package release tags follow the same naming restrictions as version tags.

Directories

  • Configuration files should be placed in the /etc directory. If there is more than one configuration file, it is customary to use a subdirectory in order to keep the /etc area as clean as possible. Use /etc/{pkgname}/ where {pkgname} is the name of the package (or a suitable alternative, eg, apache uses /etc/httpd/).
  • Package files should follow these general directory guidelines:
/etc System-essential configuration files
/usr/bin Binaries
/usr/lib Libraries
/usr/include Header files
/usr/lib/{pkg} Modules, plugins, etc.
/usr/share/doc/{pkg} Application documentation
/usr/share/info GNU Info system files
/usr/share/man Manpages
/usr/share/{pkg} Application data
/var/lib/{pkg} Persistent application storage
/etc/{pkg} Configuration files for {pkg}
/opt/{pkg} Large self-contained packages such as Java, etc.
  • Packages should not contain any of the following directories:
    • /dev
    • /home
    • /srv
    • /media
    • /mnt
    • /proc
    • /root
    • /selinux
    • /sys
    • /tmp
    • /var/tmp
    • /run

Makepkg duties

When makepkg is used to build a package, it does the following automatically:

  1. Checks if package dependencies and makedepends are installed
  2. Downloads source files from servers
  3. Checks the integrity of source files
  4. Unpacks source files
  5. Does any necessary patching
  6. Builds the software and installs it in a fake root
  7. Strips symbols from binaries
  8. Strips debugging symbols from libraries
  9. Compresses manual and, or info pages
  10. Generates the package meta file which is included with each package
  11. Compresses the fake root into the package file
  12. Stores the package file in the configured destination directory (cwd by default)

Architectures

The arch array should contain 'i686' and/or 'x86_64' depending on which architectures it can be built on. You can also use 'any' for architecture independent packages.

Licenses

The license array is being implemented in the official repos, and it should be used in your packages as well. Use it as follows:

  • A licenses package has been created in [core] that stores common licenses in /usr/share/licenses/common ie. /usr/share/licenses/common/GPL. If a package is licensed under one of these licenses, the licenses variable will be set to the directory name e.g. license=('GPL')
  • If the appropriate license is not included in the official licenses package, several things must be done:
    1. The license file(s) should be included in /usr/share/licenses/$pkgname/ e.g. /usr/share/licenses/dibfoo/LICENSE. One good way to do this is by using:
      install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    2. If the source tarball does NOT contain the license details and the license is only displayed on a website for example, then copy the license to a file and include it. Remember to call it something appropriate too.
    3. Add 'custom' to the licenses array. Optionally, you can replace 'custom' with 'custom:"name of license"'.
  • Once a licenses is used in two or more packages in an official repo, including [community], it becomes common
  • The MIT, BSD, zlib/libpng and Python licenses are special cases and cannot be included in the 'common' licenses pkg. For the sake of the license variable, it is treated like a common license (license=('BSD'), license=('MIT'), license=('ZLIB') or license=('Python')) but for the sake of the filesystem, it is a custom license, because each one has its own copyright line. Each MIT, BSD, zlib/libpng or Python licensed package should have its unique license stored in /usr/share/licenses/$pkgname/.
  • Some packages may not be covered by a single license. In these cases multiple entries may be made in the license array e.g. license=("GPL" "custom:some commercial license"). For the majority of packages these licenses apply in different cases, as opposed to applying at the same time. When pacman gets the ability to filter on licenses (so you can say, "I only want GPL and BSD licensed software") dual (or more) licenses will be treated by pacman using OR, rather than AND logic, thus pacman will consider the above example as GPL licensed software, regardless of the other licenses listed.
  • The (L)GPL has many versions and permutations of those versions. For (L)GPL software, the convention is:
    • (L)GPL - (L)GPLv2 or any later version
    • (L)GPL2 - (L)GPL2 only
    • (L)GPL3 - (L)GPL3 or any later version

Submitting packages to the AUR

Note the following before submitting any packages to the AUR:

  1. The submitted PKGBUILDs MUST NOT build applications already in any of the official binary repositories under any circumstances. Exception to this strict rule may only be packages having extra features enabled and/or patches in compare to the official ones. In such an occasion the pkgname array should be different to express that difference. eg. A GNU screen PKGBUILD submitted containing the sidebar patch, could be named screen-sidebar etc. Additionally the provides=('screen') PKGBUILD array should be used in order to avoid conflicts with the official package.
  2. To ensure the security of pkgs submitted to the AUR please ensure that you have correctly filled the md5sum field. The md5sum's can be generated using the updpkgsums command.
  3. Please add a comment line to the top of the PKGBUILD file that follows this format. Remember to disguise your email to protect against spam:
    # Maintainer: Your Name <address at domain dot com>

    If you are assuming the role of maintainer for an existing PKGBUILD, add your name to the top as described above and change the title of the previous Maintainer(s) to Contributor:

    # Maintainer: Your Name <address at domain dot com>
    # Contributor: Previous Name <address at domain dot com>
  4. Verify the package dependencies (eg, run ldd on dynamic executables, check tools required by scripts, etc). The TU team strongly recommend the use of the namcap utility, written by Jason Chu (jason@archlinux.org), to analyze the sanity of packages. namcap will warn you about bad permissions, missing dependencies, un-needed dependencies, and other common mistakes. You can install the namcap package with pacman. Remember namcap can be used to check both pkg.tar.gz files and PKGBUILDs
  5. Dependencies are the most common packaging error. Namcap can help detect them, but it is not always correct. Verify dependencies by looking at source documentation and the program website.
  6. Do not use replaces in a PKGBUILD unless the package is to be renamed, for example when Ethereal became Wireshark. If the package is an alternate version of an already existing package, use conflicts (and provides if that package is required by others). The main difference is: after syncing (-Sy) pacman immediately wants to replace an installed, 'offending' package upon encountering a package with the matching replaces anywhere in its repositories; conflicts on the other hand is only evaluated when actually installing the package, which is usually the desired behavior because it is less invasive.
  7. All files uploaded to the AUR should be contained in a compressed tar file containing a directory with the PKGBUILD and additional build files (patches, install, ...) in it.
    foo/PKGBUILD
    foo/foo.install
    foo/foo_bar.diff
    foo/foo.rc.conf

    The archive name should contain the name of the package e.g. foo.tar.gz.

    One can easily build a tarball containing all the required files by using makepkg --source. This makes a tarball named $pkgname-$pkgver-$pkgrel.src.tar.gz, which can then be uploaded to the AUR.

    The tarball should not contain the binary tarball created by makepkg, nor should it contain the filelist

Cookies help us deliver our services. By using our services, you agree to our use of cookies.