Difference between revisions of "DeveloperWiki:HOWTO Be A Packager"

From ArchWiki
Jump to: navigation, search
(Non-recursive checkout)
m (Staging Directories)
Line 88: Line 88:
  
 
     ~/staging/
 
     ~/staging/
    |-- core/
+
    |-- core/
    |  |-- add/
+
    |-- extra/
    |  `-- del/
+
    `-- testing/
    |-- extra/
+
    |  |-- add/
+
    |  `-- del/
+
    `-- testing/
+
        |-- add/
+
        `-- del/
+
  
 
These directories are searched by the db scripts to find new packages and those slated for removal.
 
These directories are searched by the db scripts to find new packages and those slated for removal.

Revision as of 15:55, 18 December 2008

Follow Package Guidelines

Package guidelines can be found in the Arch Linux documentation. Please follow them closely.

Arch Packaging Standards

How To Use SVN

Non-recursive checkout

  svn checkout -N svn+ssh://archlinux.org/srv/svn-packages 

This creates a directory named "svn-packages" which contains nothing. It does, however, know that it is an svn checkout.

Checkout a package

  cd svn-packages
  svn update package-name

This will pull the package you requested into your checkout. From now on, any time you `svn update` at the top level, this will be updated as well.

Updating all packages

  cd svn-packages
  svn update

Adding a package

  cd svn-packages
  mkdir new-package
  mkdir new-package/{repos,trunk}
  $EDITOR new-package/trunk/PKGBUILD
  svn add new-package
  svn commit

Removing a package

  ssh archlinux.org
  /arch/db-remove packagename repo-name arch
  i.e. /arch/db-remove openssh core i686

Moving a package between repos

  ssh archlinux.org
  /arch/db-move packagename fromrepo torepo arch
  i.e. /arch/db-move openssh testing core i686

Alternatively, the move from testing is so common we have helper scripts:

  /arch/testing2x openssh bzip2 coreutils
  /arch/testing2x64 openssh bzip2 coreutils

These scripts only work if the packages on the commandline are either in core or extra. If a package is only in testing, you have to use testing2core, testing2core64, testing2extra or testing2extra64.

"Tagging" releases

  cd svn-packages/package-name/trunk
  archrelease extra-i686

This makes an svn copy of the trunk entries in a directory named "extra-i686" indicating that this package is in the extra repository for the i686 architecture.

The Process

Checkout/update your local repository

  cd svn-packages
  svn update

Update the needed package

  svn update some-package

=== Traverse to the package's trunk directory

  cd some-package/trunk/

Change and build

  $EDITOR PKGBUILD
  makepkg

Run namcap on both PKGBUILD and package

  namcap PKGBUILD
  namcap some-package-1.0-1-i686.pkg.tar.gz

Use devtools to upload and commit

This is repo dependent. For 'extra', you use 'extrapkg'. 'testingpkg' for 'testing', etc

  extrapkg "A commit message"

Update the repository

This is repo dependent. For 'extra', you use 'db-extra'. 'db-testing' for 'testing', etc Additionally, db-{repo}64 is used for x86_64 repos.

  ssh archlinux.org
  /arch/db-extra


Staging Directories

Staging directories are needed on archlinux.org for uploading of packages. The following structure is NOT automatically created. You must do it yourself:

   ~/staging/
    |-- core/
    |-- extra/
    `-- testing/

These directories are searched by the db scripts to find new packages and those slated for removal.

Miscellaneous Stuff

SVN $Id$ tags

$Id$ tags are a nice helper for PKGBUILDs and should be added to the top of all PKGBUILDs in a comment. However, svn needs an additional push to know that it should modify this line on checkout.

  svn propset svn:keywords "Id" my-package/trunk/PKGBUILD

Package checking tools

namcap

TODO

checkpkg

TODO

Commit messages

Please try to write concise commit messages. If the package is simply an upstream change, that is fine, but if anything more complex changes, please inform us by writing an appropriate commit message.

Avoid having to enter your password all the time

When working with extrapkg and the other devtools, you may have to enter your password quite often. Even if you set up ssh keys and the ssh agent, devtools will be slow because it takes time until a ssh connection is established. You can work around that.

Add this to your $HOME/.ssh/config:

ControlPath /home/<your username>/.ssh/master-%h-%p-%r

Host svn.archlinux.org
HostName archlinux.org

Now, before you start working, open a ssh session with

ssh -M archlinux.org

Enter your password and leave that session open until you are finished. All ssh sessions (including scp and svn+ssh) will now be tunneled through this connection.