IGNOREPATH=/etc:/home:/var:/dev:/boot:/root:/tmp:/usr/local:/bin:/sbin:/mnt:/usr/src
STRIPLIB=y
STRIPBIN=y

VERSION=7.10.7
PROGNAME="curl $VERSION"
DESC="\
curl                                                                   \n\
                                                                       \n\
Curl is a command line tool for transferring data specified with URL   \n\
syntax.  The command is designed to work without user interaction or   \n\
any kind of interactivity.   Curl offers a busload of useful tricks    \n\
like proxy support, user authentication, ftp upload, HTTP post,  SSL   \n\
(https:) connections, cookies, file transfer resume and more.          \n\
                                                                       \n\
libcurl is a library that Curl uses to do its job. It is readily       \n\
available to be used by your software, too."

BUILD=1
MAINTAINER="Mark Post <mark.post@eds.com>"
SOURCE=http://curl.haxx.se/download.html
PKGNAME=curl-$VERSION-s390-$BUILD
TAG=OPT

compile() {
   tar -yxvf $CWD/curl-$VERSION.tar.bz2
   cd curl-$VERSION/
   find . -perm 777 -exec chmod 755 {} \;
   find . -perm 775 -exec chmod 755 {} \;
   find . -perm 664 -exec chmod 644 {} \;
   CFLAGS=-O2 \
   ./configure --prefix=/usr
   make
}

install() {
   make install DESTDIR=/package-curl

   mkdir -p /package-curl/usr/doc/curl-$VERSION
   cp -a CHANGES COPYING README \
      /package-curl/usr/doc/curl-$VERSION
   ( cd docs
     cp -a BUGS CONTRIBUTE FAQ FEATURES INSTALL INTERNALS MANUAL README.win32 \
         RESOURCES THANKS TODO examples /package-curl/usr/doc/curl-$VERSION
   )

   ( cd /package-curl/usr/man/
     for dir in 1 3; do
       ( cd man$dir
         rm -f *.gz
         gzip -9 *.$dir
       )
     done
   )
}

attributes() {
   chown -R root.bin $PKG/package-curl/usr/bin
}

special() {
   cd $PKG
   mv package-curl/* ./
   rmdir package-curl

   chown -R root.bin usr/bin/

   cd $CTL
   cat $CWD/slack-desc > slack-desc
   sed -e 's%package-curl/%%' doinst.sh > doinst.sh.new
   cat doinst.sh.new > doinst.sh
   rm doinst.sh.new
}

