summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2010-02-08 20:44:37 +0000
committerMichał Górny <mgorny@gentoo.org>2010-02-08 20:44:37 +0000
commit2cb218100a529db52a72e24620c91eadd1a5f211 (patch)
tree250bc8aeb24ef1ffb16bf6eab7ce38366c30ddac /app-arch/zpaq/zpaq-1.10.ebuild
parentnet-im/ekg2: Update to match new SCons options. (diff)
downloadsunrise-2cb218100a529db52a72e24620c91eadd1a5f211.tar.gz
sunrise-2cb218100a529db52a72e24620c91eadd1a5f211.tar.bz2
sunrise-2cb218100a529db52a72e24620c91eadd1a5f211.zip
app-arch/zpaq: Version bump. Support for ZPAQ's self-optimization.
svn path=/sunrise/; revision=10003
Diffstat (limited to 'app-arch/zpaq/zpaq-1.10.ebuild')
-rw-r--r--app-arch/zpaq/zpaq-1.10.ebuild98
1 files changed, 98 insertions, 0 deletions
diff --git a/app-arch/zpaq/zpaq-1.10.ebuild b/app-arch/zpaq/zpaq-1.10.ebuild
new file mode 100644
index 000000000..db9d760d6
--- /dev/null
+++ b/app-arch/zpaq/zpaq-1.10.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit multilib toolchain-funcs
+
+MY_P="${PN}${PV/./}"
+DESCRIPTION="Unified compressor for PAQ algorithms"
+HOMEPAGE="http://mattmahoney.net/dc/#zpaq"
+SRC_URI="http://mattmahoney.net/dc/${MY_P}.zip"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="optimization"
+
+DEPEND="app-arch/unzip"
+RDEPEND=""
+
+src_prepare() {
+ # make it FHS-friendly
+ sed -e 's:^pcomp :&/usr/libexec/zpaq/:' -i *.cfg || die
+
+ if use optimization; then
+ sed \
+ -e "s:%CXX%:$(tc-getCXX):" \
+ -e "s:%CXXFLAGS%:${CXXFLAGS}:" \
+ -e "s:%LIBDIR%:$(get_libdir):" \
+ "${FILESDIR}"/zpaqmake.in > zpaqmake || die
+ fi
+}
+
+src_configure() {
+ tc-export CXX
+
+ if use optimization; then
+ # NOTE: zpaqmake is used in runtime by zpaq to compile profiles
+ # please do not complain about stripping, it's not for build time
+
+ local stripflag=' -Wl,--strip-all'
+ # check whether the default compiler supports -Wl,--strip-all
+ echo 'int main(void) {return 0;}' > striptest.c
+ "${CXX}" ${CXXFLAGS} striptest.c -o striptest \
+ ${LDFLAGS} ${stripflag} || stripflag=
+
+ sed -i -e "s:%LDFLAGS%:${LDFLAGS}${stripflag}:" zpaqmake || die
+ fi
+}
+
+src_compile() {
+ "${CXX}" ${CXXFLAGS} -DNDEBUG zpaq.cpp -o zpaq ${LDFLAGS} || die
+ "${CXX}" ${CXXFLAGS} lzppre.cpp -o lzppre ${LDFLAGS} || die
+
+ if use optimization; then
+ # provide precompiled stub
+ "${CXX}" -c ${CXXFLAGS} -DNDEBUG -DOPT zpaq.cpp -o zpaq.o || die
+ fi
+}
+
+src_install() {
+ dobin zpaq || die
+ dodoc readme.txt || die
+
+ if use optimization; then
+ dobin zpaqmake || die
+ insinto /usr/include/zpaq
+ doins zpaq.h || die
+ insinto /usr/$(get_libdir)/zpaq
+ doins zpaq.o || die
+ fi
+
+ # Preprocessors
+ exeinto /usr/libexec/zpaq
+ doexe lzppre || die
+
+ # These are more like compression profiles, so install them in /usr/share
+ insinto /usr/share/zpaq
+ doins *.cfg || die
+}
+
+pkg_postinst() {
+ elog "Unlike conventional archivers, zpaq doesn't have any algorithm chain"
+ elog "compiled in by default. Instead, it provides many PAQ components to allow"
+ elog "user to create his own chain and supply it as configuration file."
+ elog
+ elog "We install few default configs in /usr/share/zpaq to start with. They can"
+ elog "be used like that:"
+ if use optimization; then
+ elog " zpaq oc/usr/share/zpaq/max.cfg out.zpaq files"
+ else
+ elog " zpaq c/usr/share/zpaq/max.cfg out.zpaq files"
+ fi
+ elog
+ elog "You may also want to install app-arch/zpaq-extras package which provides"
+ elog "few additional configs and preprocessors for use with zpaq."
+}