Adding new packages

From TALinuxWiki

Adding new packages to the Collection

Adding new packages to the Collection is quite easy, depending on how good the source packaging is. Most sources that use the GNU autoconf/automake system work without any problems. There are exceptions of course that require some more work.

The most important part of a Collection package is the Makefile with the required information for downloading, building and packaging. The following example shows the minimal required information for a package build Makefile:

include ../../Config.make
 
PACKAGE:=name-of-package
VERSION:=version-number
BUILD_VERSION:=1
DEPENDS:=list-of-package-this-package-depends-on
CONFOPTS:=
MAINTAINER:=name-of-package-maintainer-and-email
HOMEPAGE:=url-to-package-homepage
SOURCE_URLS:=url-to-source-tar

include ../../Rules.make

Other required files are "short", that should include a short, one-line description of the package. Another is "description" that should include a longer explanation of the package. It is also recommended to add a md5 checksum file "md5", it can be easily be added using "make updatemd5".


Parameter description

Here are the most common options that can be specified in a package Makefile. You can always add your own rules and settings, for more complex example look at glibc, gcc and xorg Makefiles.

  • PACKAGE

Name of the package, for example libgnome, mplayer, apache, php

  • VERSION

The version number, should be in whatever format the software author uses, for example 1.2.3, 20031218, 1.2rc2, but it should always start with a number.

  • SOURCE

The name of the source, defaults to PACKAGE-VERSION.tar.gz

  • DEPENDS

A list of package this package depends on, space separated. For example: glib2 gtk+2 libgnome libgnomeui

  • BUILD_DEPENDS

A list of package this package depends on when building, but not required for running.

  • CONFOPTS

Parameters to give for a configure script, for example: --enable-ftp --with-ssl

  • CONFOPTS_arch

Parameters to give for a configure script, for some specific architecture. For example: CONFOPTS_ppc:=--enable-altivec

  • BUILD_VERSION

Starts (default) from 0, should always be changed if there are changes made to the package but the VERSION of the package does not change, for example if enabling some options, adding postinstall scritps or applying a patch.

  • HOMEPAGE

URL to the homepage of the software

  • SOURCE_URLS

A list of URLs to try when downloading the source. There are some predefined urls, URL_GNOME and URL_SFNET that can be used. Check the toplevel Config.make for changes.

  • SOURCE_PATH

This is the path that the source is located in after unpacking, for example: "php-4.3.4". Defaults to "PACKAGE-VERSION".

  • PATCH_FILE

A space separated list of patch files to apply

  • PATCHOPTIONS

Parameters to pass to the patch utility, for example: "-f --no-backup-if-mismatch -p1"

  • POSTINSTALL_FILE

A shell script that should be run after the package has been installed

  • PREINSTALL_FILE

A shell script to run before the package in extracted. This can be used for example to check if it's safe to upgrade or install, look in the postgresql package for a working example.

  • MAKE_PKG

Specifies the rule that is use to install the softaware into the PKGTEMPROOT. Defaults to "make_pkg_destdir". Available options are: make_pkg_prefix, make_pkg_PREFIX, make_pkg_install_root, make_pkg_install_root_lc, make_pkg_custom, make_pkg_root and make_pkg_ROOT. It is also possible to use a totaly custom rule, for example if the software does not have a install target, the you can use your own target, for example "make_pkg_mycustom" and the write the rule yourself.

  • CUSTOM_INSTALL_PARAM

If make_pkg_custom is used for MAKE_PKG then this specifies the custom parameters that is passed to make.

  • BUILDTYPE
  • CUSTOM_EXTRA

Rule(s) to run before running any configure scripts

  • CUSTOM_CONFIGURATION_PROGRAM

If the software is not using the normal "configure" name for the any configuration scripts the you can specifiy one with this.

  • CHECK_MAKEFILE

Defaults to "yes", set to "no" to skip makefile check before running "configure".

  • PRE_MAKE_PKG

Rule(s) to run just before MAKE_PKG rule is run.

  • PRE_PKGMAKE

Rule(s) to run just before the final package is made with pkgmake.

  • DEPRECATES

Space separated list of packages this package deprecates. For example for "gaim2" this would specify "gaim".

  • DEPRECATED

If yes, the install won't install the package as it's old and deprecated.

  • PATCH_DIR

Defaults to current directory, but if you need many patches then you can use a directory for them. Specify them directory name here. Recommended name would be "patches".

  • ARCHS

If defined, should list the architecures that this package is for.

  • ARCH

Should only be defined to ARCH=all if the packages is free from any binaries, for example DTDs and XSLT files. Any other use is wrong.