Difference between revisions of "VCS package guidelines"

From ArchWiki
Jump to: navigation, search
m
(Clean Up)
Line 2: Line 2:
 
[[Category:HOWTOs (English)]]
 
[[Category:HOWTOs (English)]]
 
[[Category:Guidelines (English)]]
 
[[Category:Guidelines (English)]]
==Prototypes==
 
  
abs provides a prototype for cvs, svn, git and darcs. Just do ''pacman -S abs'' and look in ''/usr/share/pacman''.
+
General guidelines to creating PKGBUILDS for version control systems.
  
==A few tips==
+
== Prototypes ==
  
* Suffix <code>pkgname</code> with <code>-cvs</code> or <code>-svn</code> or <code>-git</code> where applicable - this prevents confusion with non-development versions e.g. fluxbox-svn or fvwm-cvs vs fluxbox and fvwm.
+
The abs package provides prototypes for cvs, svn, git and darcs PKGBUILDs. When abs is installed, they are installed in {{Filename|/usr/share/pacman/}}.
* When makepkg is run it will check for newer revisions and then bump pkgver to the latest. If this is not what you want see the --holdver in [http://www.archlinux.org/pacman/makepkg.8.html man makepkg]. Note that this only works correctly for cvs and svn, which allow to checkout an older date or revision.
+
 
* You must also be careful about pacman conflicts.  For example fluxbox-svn will conflict with fluxbox.  In this case you need to use the <tt>conflicts=</tt> field
+
== Tips ==
conflicts=('fluxbox')
+
 
: You should also use the <tt>provides=</tt> field so that pkgs that require fluxbox to be installed recognize your fluxbox-svn pkg as fluxbox
+
* 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).
provides=('fluxbox')
+
* 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.
: You should AVOID using <tt>replaces=</tt> it generally causes unnecessary problems
+
* Check for package conflicts.  For example fluxbox-svn will conflict with fluxbox.  In this case, you need to use <tt>conflicts=('fluxbox')</tt>.
 +
: Use the 'provides' field so that pkgs that require the non-VCS package can be installed (provides=('fluxbox')).
 +
: You should AVOID using <tt>replaces=</tt> 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 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.
 
* 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 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.
* don't forget to include the appropriate vcs tool (cvs,subversion,git,...) in <code>makedepends=</code> as necessary
+
* Don't forget to include the appropriate vcs tool (cvs,subversion,git,...) in <code>makedepends=</code>.
* to preserve the integrity of the checked out code it is usually possible to build in a separate build dir 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 dir if you have to make edits...  E.g. having checked out source code to src/$_cvsmod from $startdir you can use:
<pre>  mkdir src/$_cvsmod-build
+
 
 +
<pre>   
 +
  mkdir src/$_cvsmod-build
  
 
   cd src/$_cvsmod-build
 
   cd src/$_cvsmod-build
 
   ../$_cvsmod/configure</pre>
 
   ../$_cvsmod/configure</pre>
''OR'' if that fails you can try:
 
<pre>  cp -r src/$_cvsmod 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).
+
  #or
 +
 
 +
cp -r src/$_cvsmod 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).
  
== Useful Links ==
+
== Related Links ==
  
 
* [[The Arch package making HOW-TO - with guidelines]]
 
* [[The Arch package making HOW-TO - with guidelines]]

Revision as of 15:45, 4 November 2009


General guidelines to creating PKGBUILDS for version control systems.

Prototypes

The abs package provides prototypes for cvs, svn, git and darcs PKGBUILDs. When abs is installed, they are installed in Template:Filename.

Tips

  • Suffix pkgname with -cvs, -svn or -git where applicable - this prevents confusion with non-development versions of packages (e.g. fluxbox-svn or fvwm-cvs vs fluxbox and fvwm).
  • When makepkg is run by default, it will check for newer revisions and then update the pkgver in the PKGBUILD. Look at --holdver in man makepkg if you want otherwise. --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 conflicts=('fluxbox').
Use the 'provides' field so that pkgs that require the non-VCS package can be installed (provides=('fluxbox')).
You should AVOID using replaces= as it generally causes unnecessary problems
  • When using/defining the cvsroot use anonymous:@ rather than anonymous@ to avoid having to press enter to give blank password OR 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.
  • Don't forget to include the appropriate vcs tool (cvs,subversion,git,...) in 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:
  
  mkdir src/$_cvsmod-build

  cd src/$_cvsmod-build
  ../$_cvsmod/configure
 #or
cp -r src/$_cvsmod 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