MPKG
Simple programs
Each program is defined using a Makefile, that looks something like this:
# $Id: developer.html,v 1.15 2003/02/26 23:32:39 abo Exp $
include ../../../mk/gnu.pre.mk
DISTNAME= fileutils
VERSION= 4.0
CATEGORIES=
MASTER_SITES= $(MASTER_SITE_GNU:=fileutils/)
#DISTFILES=
MAINTAINER= packages@s3.kth.se
HOMEPAGE= http://www.gnu.org/
GNU_CONFIGURE= yes
include ../../../mk/gnu.mpkg.mk
See also more examples.
This section describes what you can do in a Makefile.
Variables to define
- DISTNAME
- The name of the program.
- VERSION
- The version number.
- MASTER_SITES
- URL pointing to a directory where DISTFILES can be downloaded.
- DEPENDS
- Prerequisites to this program.
Examples:
DEPENDS= "zlib --lib" "texinfo --build-env"
The program requires zlib and texinfo. The flags means that zlib is a library and the appropriate flags -I, -L and -rpath should be used during compilation, and that the
module texinfo should be loaded before this program is built.
- MENU_CATEGORY
- Where to place the program in a menu of programs.
- HOMEPAGE
- URI (URL) to the program's website.
- GNU_CONFIGURE
- Set to yes if there is a GNU autoconf compatible configure script.Implies HAS_CONFIGURE=yes.
- HAS_CONFIGURE
- Set to yes if there is a configure script.
- CONFIGURE_ARGS
- Arguments that should be given to the configure-script. Example: --with-zlib=$(PREFIX_zlib)
- USE_IMAKE
- Set to yes if this program uses Imake.
Variables with a default value that can be overridden
- PKGNAME?=$(DISTNAME)-$(VERSION)
- The default value for PKGSUBDIR and PKGFILENAME.
- PKGSUBDIR?=$(PKGNAME)
- The directory to enter when compiling. (The directory that is created when DISTDILES is extracted.)
- PKGFILENAME?=$(PKGNAME)
- Default value for DISTFILES, without the extension.
- EXTRACT_SUFX?=.tar.gz
- What file name extension to assume when guessing the value of DISTFILES.
- DISTFILES?=$(PKGFILENAME)$(EXTRACT_SUFX)
- The names of the files to fetch.
- EXTRACT_ONLY?=$(DISTFILES)
- Lis of files that should be extracted.
- CONFIGURE_SCRIPT?=$(SRCDIR)/configure
- The configure script.
- MAKEFILE?=Makefile
- The main make-file, in $(WRKSRC).
- ALL_TARGET?=all
- The make target to specify when compiling.
- INSTALL_TARGET?=all
- The make target to specify when installing.
Variables whose value is given
- PROGRAM_PREFIX
-
- The directory where the program should be installed.
- PREFIX_<pkgname>
- The directory where <pkgname> is installed. Will be defined if <pkgname> is in DEPENDS.
- SOURCEDIR
- Where DISTFILES will be extracted. Usually the same as the value of WORKDIR, but might be $(PROGRAM_PREFIX)/src if INSTALL_SOURCE is defined.
- SRCDIR=$(SOURCEDIR)/$(PKGSUBDIR)
- The subdirectory of SOURCEDIR where the actual source is.
- WORKDIR
- The temporary work directory, used when building the program.
- WRKSRC?=$(WORKDIR)/$(PKGSUBDIR)
- The directory to enter when compiling.
- SYSTEM_TYPE
- The output of config.guess from GNU autoconf.
- SYSTEM_TYPE_CPU
- The first part of SYSTEM_TYPE.
- SYSTEM_TYPE_VENDOR
- The second part of SYSTEM_TYPE.
- SYSTEM_TYPE_OS
- The rest of SYSTEM_TYPE.
Commands that can be referred to using variables
- FETCH
-
- wget
- BASENAME
- basename
- ECHO_MSG
- echo
- ECHO
- echo
- ENV
- env
- MKDIR
- mkdir -p
- CAT
- cat
- GUNZIP
- gunzip
- GZCAT
- $(GUNZIP) -c
- BUNZIP2
- bzip2 -d
- BZ2CAT
- $(BUNZIP2) -c
- UNCOMPRESS
- uncompress
- COMPRESSCAT
- $(UNCOMPRESS) -c
- GTAR
- gtar
- TAR
- tar
- TAR_EXTRACT
- $(TAR) -xf -
- CPIO
- cpio
- CPIO_EXTRACT
- $(CPIO) -i --make-directories
- RM
- rm
- RM_RF
- rm -rf
- PATCH
- patch
- INSTALL
- install
- MAKE_PROGRAM
- make
- AWK
- awk
- XMKMF
- xmkmf
- SETENV
- env
- LN
- ln -s
- SED
- sed
- GREP
- grep
- SORT
- sort
- UNIQ
- uniq
- CP
- cp
- MV
- mv
- RPM2CPIO
- rpm2cpio
Targets to define
- do-fetch
- How to fetch the required files.
- do-extract
- How to extract the files.
- do-patch
- How to apply patches to the files.
- do-configure
- How to configure the program.
- do-build
- How to compile the program.
- do-install
- How to install the program.
Predefined targets
- do-fetc%
- Download DISTFILES from MASTER_SITES.
- do-extrac%
- Extract all files in EXTRACT_ONLY into SOURCEDIR.
- do-patc%
- Apply all patch files i patches och patches-$(SYSNAME) on the files in WRKSRC.
- do-configur%
- Perhaps configure according to Imake or run a configure script.
- do-buil%
- make all in WRKSRC.
- do-instal%
- make install in WRKSRC.
The make file includes mk/gnu.pre.mk and mk/gnu.mpkg.mk.
These defines som targets like install-depends, fetch, extract, patch, configure, build and install. If you type make all they will be executed in that order.
Obsolete variables and targets. Don't use. Only documented for reference.
- SYSTYPE
- The output of the command fs sysname, for example i386_linux6.
Additional features
mk/gnu.local.mk
An example:
# Where to install the programs. Don't remove the '?'!
PREFIX?= ${HOME}/mpkg
# Where to put downloaded files.
DISTDIR= /tmp/distfiles
Modular programs
General
Emacs
Perl
XXX
$Id: developer.html,v 1.15 2003/02/26 23:32:39 abo Exp $