SUMMARY="A C library for reading, creating, and modifying zip archives."
DESCRIPTION="
libzip is a C library for reading, creating, and modifying zip archives.
" 
HOMEPAGE="http://www.nih.at/libzip/" 
SRC_URI="http://www.nih.at/libzip/libzip-0.11.2.tar.gz"
CHECKSUM_SHA256="83db1fb43a961ff7d1d1b50e1c6bea09c67e6af867686d1fc92ecb7dc6cf98d5"
REVISION="1"

ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libzip${secondaryArchSuffix} = $portVersion
	lib:libzip${secondaryArchSuffix} = $portVersion
	cmd:zipcmp${secondaryArchSuffix}
	cmd:zipmerge${secondaryArchSuffix}
	cmd:ziptorrent${secondaryArchSuffix}
	"
REQUIRES="
	haiku${secondaryArchSuffix} >= $haikuVersion
	lib:libz${secondaryArchSuffix}
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	devel:libz${secondaryArchSuffix}
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:make
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	"

BUILD()
{
	sed -i 's/LN = ln/LN = cp/' man/Makefile.in

	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

#	# clean up includes
#	mkdir -p $includeDir
#	mv $prefix/include/* $includeDir/
#	rm -rf $prefix/include
#
#	# clean up man pages
#	mkdir -p $manDir
#	mv $prefix/man/* $manDir/
#	rm -rf $prefix/man

    prepareInstalledDevelLibs \
        libzip \

    fixPkgconfig

    # devel package
    packageEntries devel \
        $developDir
}

PROVIDES_devel="
	libzip${secondaryArchSuffix}_devel = $portVersion
	devel:libzip$secondaryArchSuffix = $portVersion
	"

REQUIRES_devel="
	libzip$secondaryArchSuffix == $portVersion base
	"

LICENSE="BSD (3-clause)"
COPYRIGHT="1999-2012 Dieter Baron and Thomas Klausner"
