Difference between revisions of "Talk:Arch packaging standards"

From ArchWiki
Jump to: navigation, search
m (Clean the talk page)
(Suggestions: Fix typo.)
(45 intermediate revisions by 16 users not shown)
Line 1: Line 1:
==Comments==
 
* What encoding (ascii ? UTF-8 ?) should be used for text files in submitted packages ? --[[User:Airbag|Airbag]] 13:43, 15 August 2006 (PDT)
 
 
 
==Suggestions==
 
==Suggestions==
* Shouldn't we suggest using SHA1 hash and not the already broken one (MD5)? [[User:Tomato|Tomato]] 15:47, 25 August 2010 (EDT)
+
Shouldn't we suggest using SHA1 hash and not the already broken one (MD5)? --[[User:Tomato|Tomato]] 15:47, 25 August 2010 (EDT)
* The section about custom variables ("_blah=blah") is misleading. Nowadays custom variables are a common practice since they can simplify and/or modularize the PKGBUILD a great deal. The parts where they are recommended to not to be used should be modified. --[[User:Det|Det]] 13:13, 14 September 2010 (EDT)
+
 
+
==Proposed revision (shouldn't this already be added...?)==
+
 
+
===Packaging Standards===
+
The submitted PKGBUILDs <b>must not</b> build applications already in any of the official binary repositories under any circumstances. Exception to this strict rule may only be packages being newer or having extra features enabled and/or patches in compar<b>ison with the</b> official ones. In such occasions, the pkgname array should be different <s>to express that difference</s>.
+
 
+
When building packages for <b>the AUR</b>, <s>you should </s> adhere to the package guidelines below, especially if <s>you would like</s> <b>the intention is</b> to contribute <b>a</b> <s>your new</s> package to Arch Linux.
+
 
+
...
+
====PKGBUILD Prototype====
+
Should really tell the user that prototypes are in /usr/share/pacman from the pacman and abs packages. Maybe also a newpkg (pkgtools) mention.
+
 
+
 
+
# Contributor: <s>Your</s> Name <b>email</b> at domain dot com> (disguise <s>your</s> email...
+
 
+
====Package Etiquette====
+
 
+
...<br>
+
Do not introduce new variables into <s>your</s> PKGBUILD build scripts ...
+
 
+
The AUR cannot detect the use of custom variables and so canno ... This can most often be seen in the source array<b>, e.g.:</b>
+
 
+
...<br>
+
file, or alternatively by exporting the PACKAGER environment variable before building packages with makepkg:
+
<b>$</b> export PACKAGER="John Doe@<b>email</b>"
+
 
+
...<br>
+
The above example is taken from the wine package in extra. The optdepends information will automatically be printed out on installation/upgrade<b>.</b><s> from pacman 3.2.1, so one should not keep this kind of information in .install files any longer.</s>
+
 
+
...
+
====Package Naming====
+
 
+
...<br>
+
Version tags may not include hyphens<b>.</b> Letters, numbers, and periods only.
+
 
+
...<br>
+
the package will be re-released to the AL <b>(???)</b> public and
+
 
+
...
+
====Directories====
+
  
...<br>
+
:My packages contain both {{ic|md5sums}} and {{ic|sha256sums}} arrays. I do so on the theory that some clients may not have the sha256sum utility installed, and those clients can fall back to the md5sum utility. Clarification would be appreciated. [[User:Ichimonji10|Ichimonji10]] ([[User talk:Ichimonji10|talk]]) 14:32, 19 October 2013 (UTC)
Use /etc/{pkgname}/  where {pkgname} is the name of <b>the</b> package
+
  
...
+
----
====Makepkg Duties====
+
I've recently found that packages that used bundles libraries tend to segfault. Should we suggest the removal of bundled libraries and instead use system libraries? --[[User:Gadget3000|Gadget3000]] ([[User_talk:Gadget3000|talk]]) 02:13, 6 August 2011 (UTC)
  
...<br>
+
----
When makepkg <b>is used</b> to build a package <s>for you</s>, it does the following automatically:
+
Some packages require the addition of system users. For them to be ignored by things such as lightdm, tthey have to be in the sub-1000 UID space. Looking at packages in ABS, these users are simply added with an <tt>useradd -u ...</tt>. However, there is no guideline or authoritative list that I can find which lists which UID is used for what, which is free, or how to register a UID for a specific system user. It would be nice to see a section about it here. --[[User:OlivierMehani|OlivierMehani]] 19:31, 13 October 2011 (EDT)
  
...
+
:See [[DeveloperWiki:UID_/_GID_Database]].
====Architectures====
+
  
...<br>
+
:I thinks it's a bit too specific to be listed here. --[[User:Snowman|Snowman]] 20:45, 13 October 2011 (EDT)
depending on which architectures it can be built on. <s>You can also use</s> <b>State</b> 'any' for architecture independent packages.
+
  
...
+
----
====Licenses====
+
How about adding [[Web_application_package_guidelines]] to the list? --[[User:Trontonic|Trontonic]] 11:18, 29 February 2012 (EST)
  
...<br>
+
----
The license array is being implemented little by little in the official repos, and it <b>should</b> be used in <b>AUR</b> packages as well. <s>You can </s> <b>U</b>se it as follows:
+
Something more should be said about .install files.  Mention that there are also examples in {{ic|/usr/share/pacman}} but it also needs some explanation on how they work. --[[User:Mauro2|Mauro2]] ([[User_talk:Mauro2|talk]]) 05:30, 15 October 2012 (UTC)
  
*If the source tarball does <b>not</b> contain the license details and the license is only displayed on a website for example, then <s>you need to</s> copy the licen...
+
----
 +
Please remove the {{ic|cd "$srcdir..."}} no-op from the examples on the page. See: https://bugs.archlinux.org/task/34314 --[[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 20:55, 14 March 2013 (UTC)
  
*Add 'custom' to the licenses array. Optionally, <s>you can</s> replace 'custom' with 'custom:"name of license"'.
+
----
 +
{{ic|makepkg -g}} has been superseded by {{ic|updpkgsums}} since [http://allanmcrae.com/2013/04/pacman-4-1-released/ pacman 4.1], which doesn't require redirection operators ({{ic|>>}}) or removing the earlier md5sums (with something like {{ic|sed -i "/md5sums/,/)/d" PKGBUILD}}). --[[User:Det|Det]] ([[User talk:Det|talk]]) 12:16, 7 April 2013 (UTC)
  
...<br>
+
:I second Det's request: add this to the wiki. {{ic|updpkgsums}} is nicer than {{ic|makepkg -g}}, and the existence of such a tool should be promulgated. I didn't even know about the tool until reading through this discussion page. [[User:Ichimonji10|Ichimonji10]] ([[User talk:Ichimonji10|talk]]) 14:32, 19 October 2013 (UTC)
When pacman gets the ability to filter on licenses (<b>i.e., make pacman download only GPL and BSD licensed software"</b>) dual (or more) licenses will be treated by pacman using ''''or'''', rather than ''''and'''' logic, thus pacman will consider ...
+
  
====Submitting Packages to the AUR====
+
----
 +
[[Arch_Packaging_Standards#Package_etiquette]] states: "It is common practice to preserve the order of the PKGBUILD fields as shown above." But this is not true. Common practice is to use {{ic|/usr/share/pacman/PKGBUILD.proto}} as a template, and the order of fields in that prototype has a far greater influence on packages in the wild than this page. This page should edited to reflect the current state of {{ic|PKGBUILD.proto}}. Perhaps this page should state: "It is common practice to order PKGBUILD fields so they match the order of fields in {{ic|PKGBUILD.proto}}. [[User:Ichimonji10|Ichimonji10]] ([[User talk:Ichimonji10|talk]]) 14:32, 19 October 2013 (UTC)
  
<s>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.</s> <i>This gets repeated word for word in [[#Packaging Standards]]</i>
+
== /usr/sbin -> /usr/bin merge ==
  
...<br>
+
The Directories section needs to be updated to reflect the recent /bin, /sbin, /usr/sbin -> /usr/bin merge:
To ensure the security of pkgs submitted to the AUR please ensure that <b>the md5sum values</b> have <b>been</b> correctly filled.  The md5sum's can b...
+
* The /usr/sbin line should be removed and the description of the /usr/bin line should be changed to all binaries or something similar.  
 +
* /bin and /sbin should be added to the "Package should not contain following directories" list.
 +
[[User:Kyrias|Kyrias]] ([[User talk:Kyrias|talk]]) 15:00, 6 June 2013 (UTC)
  
...<br>
+
== Punctuation in PKGBUILD ==
Please add a comment line to the top of <b>the</b> PKGBUILD file that follows this format. Remembe...
+
What is the official guidance regarding ending a pkgdesc in a period or using commas and English prose punctuation in general?
  
...
+
[[https://bbs.archlinux.org/viewtopic.php?pid=1288063 Link]] to discussion thread.
# Contributor: <s>Your</s> Name <address at domain dot com></pre>
+
+
recommend the use of the namcap <b>package</b>, written by Jason Chu (jason@archlinux.org), to analyze the sanity of <s>your</s> packages. namcap will <s>tell you</s> <b>warn</b> about bad permissions, missing dependencies, un-needed dependencies, and other common mistakes. <s>You can install the namcap package</s> by...
+
  
...<br>
+
[[User:Graysky|Graysky]] ([[User talk:Graysky|talk]]) 15:17, 14 June 2013 (UTC)
Don't use replaces in <b>a</b> PKGBUILD unless <b>the package is to be renamed</b>, for example when ''Ethereal'' became ''Wireshark''. If <b>the package is</b> 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 <b>usually</b> the desired behavior because <b>it is less invasive.</b>
+
  
...<br>
+
== There should be a clearly visible link to "Creating packages" page ==
<b>One</b> 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 <s>you</s> can then <b>be</b> upload<b>ed</b> to the AUR.
+
  
...
+
Please, move the block located in the bottom of this page to its top. [[User:Eigrad|Andrew Grigorev]] ([[User talk:Eigrad|talk]]) 19:21, 17 July 2013 (UTC)
===Additional Guidelines===
+
Be sure to read the above guidelines first'''--''' important points are listed on this page that will not be repeated in the following guideline pages...
+

Revision as of 14:09, 20 October 2013

Suggestions

Shouldn't we suggest using SHA1 hash and not the already broken one (MD5)? --Tomato 15:47, 25 August 2010 (EDT)

My packages contain both md5sums and sha256sums arrays. I do so on the theory that some clients may not have the sha256sum utility installed, and those clients can fall back to the md5sum utility. Clarification would be appreciated. Ichimonji10 (talk) 14:32, 19 October 2013 (UTC)

I've recently found that packages that used bundles libraries tend to segfault. Should we suggest the removal of bundled libraries and instead use system libraries? --Gadget3000 (talk) 02:13, 6 August 2011 (UTC)


Some packages require the addition of system users. For them to be ignored by things such as lightdm, tthey have to be in the sub-1000 UID space. Looking at packages in ABS, these users are simply added with an useradd -u .... However, there is no guideline or authoritative list that I can find which lists which UID is used for what, which is free, or how to register a UID for a specific system user. It would be nice to see a section about it here. --OlivierMehani 19:31, 13 October 2011 (EDT)

See DeveloperWiki:UID_/_GID_Database.
I thinks it's a bit too specific to be listed here. --Snowman 20:45, 13 October 2011 (EDT)

How about adding Web_application_package_guidelines to the list? --Trontonic 11:18, 29 February 2012 (EST)


Something more should be said about .install files. Mention that there are also examples in /usr/share/pacman but it also needs some explanation on how they work. --Mauro2 (talk) 05:30, 15 October 2012 (UTC)


Please remove the cd "$srcdir..." no-op from the examples on the page. See: https://bugs.archlinux.org/task/34314 --Graysky (talk) 20:55, 14 March 2013 (UTC)


makepkg -g has been superseded by updpkgsums since pacman 4.1, which doesn't require redirection operators (>>) or removing the earlier md5sums (with something like sed -i "/md5sums/,/)/d" PKGBUILD). --Det (talk) 12:16, 7 April 2013 (UTC)

I second Det's request: add this to the wiki. updpkgsums is nicer than makepkg -g, and the existence of such a tool should be promulgated. I didn't even know about the tool until reading through this discussion page. Ichimonji10 (talk) 14:32, 19 October 2013 (UTC)

Arch_Packaging_Standards#Package_etiquette states: "It is common practice to preserve the order of the PKGBUILD fields as shown above." But this is not true. Common practice is to use /usr/share/pacman/PKGBUILD.proto as a template, and the order of fields in that prototype has a far greater influence on packages in the wild than this page. This page should edited to reflect the current state of PKGBUILD.proto. Perhaps this page should state: "It is common practice to order PKGBUILD fields so they match the order of fields in PKGBUILD.proto. Ichimonji10 (talk) 14:32, 19 October 2013 (UTC)

/usr/sbin -> /usr/bin merge

The Directories section needs to be updated to reflect the recent /bin, /sbin, /usr/sbin -> /usr/bin merge:

  • The /usr/sbin line should be removed and the description of the /usr/bin line should be changed to all binaries or something similar.
  • /bin and /sbin should be added to the "Package should not contain following directories" list.

Kyrias (talk) 15:00, 6 June 2013 (UTC)

Punctuation in PKGBUILD

What is the official guidance regarding ending a pkgdesc in a period or using commas and English prose punctuation in general?

[Link] to discussion thread.

Graysky (talk) 15:17, 14 June 2013 (UTC)

There should be a clearly visible link to "Creating packages" page

Please, move the block located in the bottom of this page to its top. Andrew Grigorev (talk) 19:21, 17 July 2013 (UTC)