YYPkg: building packages with makeypkg

Adrien Nader

Contents

1  Generalities

Typically, making a package involves copying files from the source tree to another folder which will then be compressed.

This can be done with a variety of approaches and tools which we won’t discuss much here. The most common way being probably to set the DESTDIR variable when running ’make install’.

2  YYPkg-specific steps

2.1  makeypkg -template

The makypkg tool requires a "meta" file to build a package. A template can be generated with ’makeypkg -template’.

This file is a s-expression as used by sexplib. Currently, this will output:

((name dummy_name) (size_expanded (TB 42))
 (version
  ((major 0) (minor 0) (release 17) (status (Snapshot 0))
   (package_iteration 0)))
 (packager_email nobody@example.com) (packager_name ulysse)
 (description "dummy, dummy, dummy") (predicates ((arch x86_64-w64-mingw32)))

We’ll quickly go over the fields:

2.2  Running makeypkg

This is makeypkg’s –help:

Create a yypkg package from a folder.
Use either (-o, -meta and a folder) XOR -template (see -help). Examples:
  $ makeypkg -o /some/folder -meta pcre.META pcre-1.2.3
  $ makeypkg -template
  -o output folder (defaults to current dir)
  -meta package metadata file
  -template write a template meta on stdout
  -help  Display this list of options
  --help  Display this list of options

2.3  A real-world example: pcre in mingw-builds

We’ll be looking at two files: the end of the build script and pcre.yypkg.meta.

make, make install as usual. Installing into $PKG. We also use sed to replace ’%ARCH’ with the actual value as set by your script.

CFLAGS="$SLKCFLAGS" make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
sed -e "s/%{ARCH}/${HST}/" $CWD/${PKGNAM}.yypkg.meta | makeypkg -o ${OUTPUT} -meta - $PKG

The meta file as piped to makeypkg through sed. Notice the value for the ’arch’ predicate: ’%ARCH’.

((name pcre) (size_expanded (TB 42))
 (version
  ((major 8) (minor 2) (release 0) (status Stable)
   (package_iteration 1)))
 (packager_email adrien@notk.org) (packager_name "Adrien Nader")
 (description "pcre") (predicates ((arch "%{ARCH}")))
 (comments ()))

This was a quick overview of the pcre build. For more details, see http://cgit.notk.org/adrien/mingw-builds/slackware64-current/tree/slackware64-current/source/l/pcre .


This document was translated from LATEX by HEVEA.