# Specify the name of the package. name=grep # Specify the version of the package. version=2.4.2 # Specify the package release. release=1 # The source(s) used to build this package. source=(ftp://ftp.ibiblio.org/pub/gnu/$name/$name-$version.tar.gz) # The build() function below will be called by pkgmk when # the listed source files have been unpacked. build() { # The first thing we do is to cd into the source directory. cd $name-$version # Run the configure script with desired arguments. # In this case we want to put grep under /usr/bin and # disable national language support. ./configure --prefix=/usr --disable-nls # Compile. make # Install the files, BUT do not install it under /usr, instead # we redirect all the files to $PKG/usr by setting the DESTDIR # variable. The $PKG variable points to a temporary directory # which will later be made into a tar.gz-file. Note that the # DESTDIR variable is not used by all Makefiles, some use prefix # and others use ROOT, etc. You have to inspect the Makefile in # question to find out. Some Makefiles do not support redirection # at all. In those cases you will have to create a patch for it. make DESTDIR=$PKG install # Remove unwanted files, in this case the info-pages. rm -rf $PKG/usr/info }