#!/bin/bash
## src2pkg script for: 	coreutils
## Auto-generated by src2pkg-1.7
## src2pkg Copyright 2005-2007 Gilbert Ashley <amigo@ibilio.org>
## Full package name: coreutils-6.9.89.12-i486-1.tgz
SOURCE_URL='http://distro.ibiblio.org/pub/linux/distributions/amigolinux/download/Core/coreutils-6.9.89.12/coreutils-6.9.89.12-8e412.tar.gz'
EXTRA_SOURCES='
http://distro.ibiblio.org/pub/linux/distributions/amigolinux/download/Core/coreutils-6.9.89.12/DIR_COLORS.gz
http://distro.ibiblio.org/pub/linux/distributions/amigolinux/download/Core/coreutils-6.9.89.12/coreutils-dircolors.csh.gz
http://distro.ibiblio.org/pub/linux/distributions/amigolinux/download/Core/coreutils-6.9.89.12/coreutils-dircolors.sh.gz
http://distro.ibiblio.org/pub/linux/distributions/amigolinux/download/Core/coreutils-6.9.89.12/coreutils.uname.diff.gz
http://distro.ibiblio.org/pub/linux/distributions/amigolinux/download/Core/coreutils-6.9.89.12/doinst.prepend
http://distro.ibiblio.org/pub/linux/distributions/amigolinux/download/Core/coreutils-6.9.89.12/slack-desc
'
SOURCE_NAME='coreutils-6.9.89.12-8e412.tar.gz'
ALT_NAME='coreutils'
ALT_VERSION='6.9.89.12'
ARCH='i486'
BUILD='1'
PRE_FIX='usr'
# Any extra options go here
EXTRA_CONFIGS='--bindir=/bin'
DOCLIST='ABOUT-NLS AUTHORS COPYING NEWS README THANKS THANKS-to-translators TODO'
# STD_FLAGS='-O2 -march=i486 -mtune=i686'
PATCHLIST='./coreutils.uname.diff.gz'

# Get the functions and configs
. /usr/libexec/src2pkg/FUNCTIONS ;

# do_all_processes can substitute these 16 steps:

pre_process
find_source
make_dirs
unpack_source
fix_source_perms

# configure_source

CONFIG_ARGS="--prefix=/$PRE_FIX $STD_CONFIGS $EXTRA_CONFIGS"
cd $SRC_DIR ;

# if you want to be conformant with the latest POSIX standards
# remove the line 'DEFAULT_POSIX2_VERSION=199209 \'
# this will probably break some programs or scripts, though.

CFLAGS="$STD_FLAGS" \
DEFAULT_POSIX2_VERSION=199209 \
./configure $CONFIG_ARGS

compile_source

# fake_install

mkdir -p $PKG_DIR/usr/bin

cd $SRC_DIR && make DESTDIR=$PKG_DIR install

( cd $PKG_DIR/usr/bin
  for file in ../../bin/* ; do
    ln -sf $file .
  done
)

mkdir -p $PKG_DIR/etc
zcat $CWD/DIR_COLORS.gz > $PKG_DIR/etc/DIR_COLORS.new

mkdir -p $PKG_DIR/etc/profile.d
zcat $CWD/coreutils-dircolors.csh.gz > $PKG_DIR/etc/profile.d/coreutils-dircolors.csh
zcat $CWD/coreutils-dircolors.sh.gz > $PKG_DIR/etc/profile.d/coreutils-dircolors.sh
chmod 755 $PKG_DIR/etc/profile.d/*

# Remove things that are provided by other Slackware packages:
for dupe in hostname kill su uptime ; do
  rm -f $PKG_DIR/bin/${dupe} $PKG_DIR/usr/bin/${dupe} \
	$PKG_DIR/usr/sbin/${dupe} $PKG_DIR/usr/man/man?/${dupe}.*
done

( cd $PKG_DIR/bin ; ln -sf install ginstall )
( cd $PKG_DIR/usr/bin ; ln -sf ../../bin/ginstall ginstall )

fix_pkg_perms
strip_bins
create_docs
compress_man_pages

( cd $PKG_DIR/usr/man/man1 ; ln -sf install.1.gz ginstall.1.gz )

make_description
make_doinst
make_package
post_process

# src2pkg - Copyright 2005-2007  Gilbert Ashley <amigo@ibiblio.org>
## See the documentation for more help and examples. Below are some of
# the most common Extras and Options for easy cut-and-paste use.
# EXTRA_CONFIGS='' PRE_FIX='' DOCLIST=''
# MAKE_COMMAND='' INSTALL_LINE='' 
# SHELL_INSTALL='YES' CORRECT_PERMS='NO'
