Difference between revisions of "Arch Linux/Arch Haskell Group Maintainership"

From HaskellWiki
Jump to: navigation, search
Line 32: Line 32:
 
* aurploader
 
* aurploader
 
* feed-cli
 
* feed-cli
  +
* get-aur-url
  +
* update-aur-log
  +
* makepkg/pacman
   
 
-------------
 
-------------
   
#!/bin/sh
 
  +
#
  +
# Given a hackage .cabal url, build and upload a Arch Linux package
  +
# Update build reports and package publication feed.
  +
#
   
cd /tmp/
+
cd /tmp/
set -e
+
set -e
   
project=`cabal2arch $* 2>&1 | tail -1 | sed 's/Created *//' | xargs basename | sed 's/\..*$//'`
 
  +
# generate package
echo $project
 
  +
project=`cabal2arch $* 2>&1 | tail -1 | sed 's/Created *//' | xargs basename | sed 's/\..*$//'`
cd $project
+
echo $project
build || exit 1
+
cd $project
cd ..
 
echo "Uploading $project.tar.gz"
 
aurploader -k $project.tar.gz
 
   
# create meta files: update the package list and build success list
 
  +
pkg=`sed -n '/pkgname/{s/pkgname=//;p;q}' PKGBUILD`
tail -1 ~/.cabal2arch.log | update-aur-log
 
   
cp /home/dons/aur.xml /tmp/
 
  +
# build package
url=`/home/dons/bin/get-arch-url $project || cat /tmp/link`
 
  +
if makepkg -f ; then
echo $url
 
  +
# update build report
feed-cli new-item -t`cat /tmp/title` --description-file=/tmp/desc -u/tmp/aur.xml -l"$url"
 
  +
echo "$pkg True" >> $HOME/.build-all.log
rm /tmp/link
 
  +
else
rm /tmp/title
 
  +
exit 1
rm /tmp/desc
 
  +
fi
echo scp /tmp/aur.xml code.haskell.org:/srv/code/arch/
 
cp /tmp/aur.xml $HOME
 
   
  +
cd ..
   
And additional script does the work of building the package:
 
  +
# upload package
  +
echo "Uploading $project.tar.gz"
  +
aurploader -k $project.tar.gz
   
  +
# emit build status information
  +
# update-aur-log reads the .cabal2arch.log to pass data to feed-cli
  +
tail -1 ~/.cabal2arch.log | update-aur-log
   
set -e
 
  +
# now update the publications list . needs get-arch-url
  +
cp $HOME/aur.xml /tmp/
  +
url=`$HOME/bin/get-arch-url $project || cat /tmp/link`
  +
echo $url
  +
feed-cli new-item -t`cat /tmp/title` --description-file=/tmp/desc -u/tmp/aur.xml -l"$url"
  +
rm /tmp/link
  +
rm /tmp/title
  +
rm /tmp/desc
  +
echo scp /tmp/aur.xml code.haskell.org:/srv/code/arch/
  +
cp /tmp/aur.xml $HOME
   
pkg=`sed -n '/pkgname/{s/pkgname=//;p;q}' PKGBUILD`
 
 
if makepkg -f ; then
 
echo "$pkg True" >> $HOME/.build-all.log
 
else
 
exit 1
 
fi
 
   
   

Revision as of 21:29, 14 August 2010

The Arch Haskell group maintains AUR packages for Haskell. The Arch Haskell packages make up around 10% of total AUR packages (~2000 packages).

To make the task of implementing the Arch Haskell policy of tracking AUR feasible, we take two approaches:

  • massive automation of Hackage to AUR regular conversion, via cabal2arch and the archlinux utilities library
  • group participation in updating packages.

The first step ensures a consistent user experience:

  • cabal2arch should be used to generate all Haskell AUR packages,
  • which ensures all naming conventions and other policies are followed,

The second point ensures the Arch Haskell project isn't vulernable to "bus errors" where a user burns out.

The job of an Arch Haskell group maintainer

The concern of an Arch Haskell maintainer is as follows.

  • Ensure AUR tracks Hackage versions of packages.

To do this, the following work is done:

  • Watch the Hackage RSS feed
  • When new packages appear, attempt to build and upload them, with the "build" script (below).

The "build" script

The "build" script is a shell program that wraps cabal2arch. You should always have the latest version of cabal2arch installed. The set of tools you need to run this script are:

  • The haskell-archlinux package.
  • cabal2arch
  • aurploader
  • feed-cli
  • get-aur-url
  • update-aur-log
  • makepkg/pacman

   #
   # Given a hackage .cabal url, build and upload a Arch Linux package
   # Update build reports and package publication feed.
   #
   cd /tmp/
   set -e
   # generate package
   project=`cabal2arch $* 2>&1 | tail -1 | sed 's/Created *//' | xargs basename | sed 's/\..*$//'`
   echo $project
   cd $project
   pkg=`sed -n '/pkgname/{s/pkgname=//;p;q}' PKGBUILD`
   # build package
   if makepkg -f ; then
       # update build report
       echo "$pkg True" >> $HOME/.build-all.log
   else
       exit 1
   fi
   cd ..
   # upload package
   echo "Uploading $project.tar.gz"
   aurploader -k $project.tar.gz
   # emit build status information
   # update-aur-log reads the .cabal2arch.log to pass data to feed-cli
   tail -1 ~/.cabal2arch.log | update-aur-log
   # now update the publications list . needs get-arch-url
   cp $HOME/aur.xml /tmp/
   url=`$HOME/bin/get-arch-url $project || cat /tmp/link`
   echo $url
   feed-cli new-item -t`cat /tmp/title` --description-file=/tmp/desc -u/tmp/aur.xml -l"$url"
   rm /tmp/link
   rm /tmp/title
   rm /tmp/desc
   echo scp /tmp/aur.xml code.haskell.org:/srv/code/arch/
   cp /tmp/aur.xml $HOME


Package Quality Assurance

One script generates this table from build success logs:

Package Publication and Notification

Another updates the RSS feed, so that packages are publicized:

Mapping to Hackage

Yet another updates the distro mapping, so that AUR links are displayed on Hackage

Maintaining cabal2arch

  • Some notable Haskell programs (such as yi) ship a library. cabal2arch will by default call it "haskell-yi", which isn't desirable for high profile applications that incidentally ship a library. cabal2arch has a list of exceptions to this rule. If you find a package needing such an exception, edit the `shouldNotBeLibraries` list in Main.hs
  • Many C libraries are listed in .cabal files by different names to the Arch Linux packages. For example, "webkit" in a .cabal file is actually "libwebkit" under pacman. Cabal2arch has a list of such associations, that ensures the right C libraries are installed with the Haskell code. Keeping this list of associations up to date is a key advantage of cabal2arch over cabal-install. Edi t the ` translationTable` list in Main.hs as part of cabal2arch.