Difference between revisions of "VCS package guidelines"

From ArchWiki
Jump to: navigation, search
m (i18n entry points to another article; be careful when "borrowing" summary boxes; clarification -- the source is version-controlled; these aren't packages for VCS software)
(clean-up)
Line 7: Line 7:
 
{{Article summary heading|Related articles}}
 
{{Article summary heading|Related articles}}
 
{{Article summary wiki|ABS - The Arch Build System}}
 
{{Article summary wiki|ABS - The Arch Build System}}
 +
{{Article summary wiki|Building Packages in Arch Linux}}
 
{{Article summary wiki|Arch Linux User-Community Repository (AUR)}}
 
{{Article summary wiki|Arch Linux User-Community Repository (AUR)}}
 
{{Article summary wiki|makepkg}}
 
{{Article summary wiki|makepkg}}
Line 17: Line 18:
 
== Prototypes ==
 
== Prototypes ==
  
The abs package provides prototypes for cvs, svn, git and darcs PKGBUILDs. When abs is installed, you can find them in {{Filename|/usr/share/pacman/}}.
+
The {{Package Official|abs}} package provides prototypes for cvs, svn, git and darcs PKGBUILDs. When abs is installed, you can find them in {{Filename|/usr/share/pacman/}}.
  
== Tips ==
+
== Guidelines ==
  
* Suffix <code>pkgname</code> with <code>-cvs</code>, <code>-svn</code> or <code>-git</code> where applicable - this prevents confusion with non-development versions of packages (e.g. fluxbox-svn or fvwm-cvs vs fluxbox and fvwm).
+
* Suffix {{Codeline|pkgname}} with {{Codeline|-cvs}}, {{Codeline|-svn}} or {{Codeline|-git}} where applicable -- this prevents confusion with non-development versions of packages (e.g. ''fluxbox-svn'' or ''fvwm-cvs'' compared to ''fluxbox'' or ''fvwm'').
* When makepkg is run by default, it will check for newer revisions and then update the pkgver in the PKGBUILD.  Look at <code>--holdver</code> in [http://www.archlinux.org/pacman/makepkg.8.html man makepkg] if you want otherwise.  <code>--holdver</code> only works correctly for cvs and svn, which allow checkout of older revisions.
+
* When [[makepkg]] is run, by default it will check for newer revisions and then update the {{Codeline|pkgver}} in the PKGBUILD.  Look at {{Codeline|--holdver}} in [http://www.archlinux.org/pacman/makepkg.8.html man makepkg] if you want otherwise.  {{Codeline|--holdver}} only works correctly for cvs and svn, which allow checkout of older revisions.
* Check for package conflicts.  For example fluxbox-svn will conflict with fluxbox.  In this case, you need to use <tt>conflicts=('fluxbox')</tt>.
+
* Check for package conflicts.  For example ''fluxbox-svn'' will conflict with ''fluxbox''.  In this case, you need to use {{Codeline|1=conflicts=('fluxbox')}}.
* Use the 'provides' field so that pkgs that require the non-VCS package can be installed (provides=('fluxbox')).
+
* Use the {{Codeline|provides}} field so that packages that require the non-VCS package can be installed ({{Codeline|1=provides=('fluxbox')}}).
* You should AVOID using <tt>replaces=</tt> as it generally causes unnecessary problems
+
* You should AVOID using {{Codeline|1=replaces=...}} as it generally causes unnecessary problems
* When using/defining the cvsroot use anonymous<b>:</b>@ rather than anonymous@ to avoid having to press enter to give blank password ''OR'' anonymous<b>:password</b>@ - if a password is required.
+
* When using/defining the cvsroot use {{Codeline|anonymous:@}} rather than {{Codeline|anonymous@}} to avoid having to press enter to give blank password ''OR'' {{Codeline|anonymous:password@}} if a password is required.
* Though it is often unneccesary to use the pkgrel field when building CVS/SVN/GIT pkgs (any changes to the pkg will often be on another day and so are usually accounted for by a change in pkgver [assuming pkgver is used to hold a date format], makepkg will require it.
+
* Though it is often unnecessary to use the {{Codeline|pkgrel}} field when building CVS/SVN/GIT packages (any changes to the package will often be on another day and so are usually accounted for by a change in {{Codeline|pkgver}} [assuming {{Codeline|pkgver}} is used to hold a date format], makepkg will require it.
* Don't forget to include the appropriate vcs tool (cvs,subversion,git,...) in <code>makedepends=</code>.
+
* Don't forget to include the appropriate VCS tool (cvs, subversion, git, ...) in {{Codeline|1=makedepends=...}}.
* To preserve the integrity of the checked out code consider copying the original build dir if you have to make edits...  E.g. having checked out source code to src/$_cvsmod from $startdir you can use:
+
* To preserve the integrity of the checked-out code, consider copying the original build directory if you have to make edits. e.g. having checked out source code to {{Filename|src/$_cvsmod}} from {{Filename|$startdir}} you can use:
  
<pre>  
+
  mkdir src/$_cvsmod-build
  mkdir src/$_cvsmod-build
+
 +
cd src/$_cvsmod-build
 +
../$_cvsmod/configure
  
  cd src/$_cvsmod-build
+
or:
  ../$_cvsmod/configure
+
 
+
  #or
+
  
 
  cp -r src/$_cvsmod src/$_cvsmod-build
 
  cp -r src/$_cvsmod src/$_cvsmod-build
 
  cd src/$_cvsmod-build
 
  cd src/$_cvsmod-build
</pre>
 
 
* With the introduction of the AUR, it is most important to avoid using backtick execution to create pkg variables. makepkg will automatically bumps the pkgver anyway when building the package (unless --holdver is used).
 
 
== Related Links ==
 
  
* [[The Arch package making HOW-TO - with guidelines]]
+
* With the introduction of the [[AUR]], it is most important to avoid using backtick execution to create package variables. makepkg will automatically bump the {{Codeline|pkgver}} anyway when building the package (unless {{Codeline|--holdver}} is used).
* [http://aur.archlinux.org AUR]
+
* [[ABS_-_The_Arch_Build_System | ABS - The Arch Build System]]
+
* [[ABS PKGBUILD Explained]]
+
* [[Makepkg]]
+
* [[PKGBUILD Tricks]]
+

Revision as of 17:04, 28 November 2009

Template:Article summary start Template:Article summary text Template:Article summary heading Template:I18n entry Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end Guidelines for creating PKGBUILDs for software managed with version control systems.

Prototypes

The Template:Package Official package provides prototypes for cvs, svn, git and darcs PKGBUILDs. When abs is installed, you can find them in Template:Filename.

Guidelines

mkdir src/$_cvsmod-build

cd src/$_cvsmod-build
../$_cvsmod/configure

or:

cp -r src/$_cvsmod src/$_cvsmod-build
cd src/$_cvsmod-build
  • With the introduction of the AUR, it is most important to avoid using backtick execution to create package variables. makepkg will automatically bump the Template:Codeline anyway when building the package (unless Template:Codeline is used).