linamh/app-text/sejda/sejda-1.0.0_beta.ebuild
2011-12-03 21:16:15 +01:00

179 lines
7.9 KiB
Bash

# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# mvn ant:ant
# checkstyle
EAPI=4
JAVA_PKG_IUSE="doc"
inherit java-pkg-2 eutils java-ant-2
MY_PV=${PV/_beta/-BETA}
DESCRIPTION="An extendible and configurable PDF manipulation layer library."
HOMEPAGE="http://www.sejda.org/"
SRC_URI="https://bitbucket.org/torakiki/sejda/get/${MY_PV}.tar.bz2 -> ${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="2.0"
KEYWORDS="~amd64 ~x86"
IUSE=""
S="${WORKDIR}/pdfsam"
COMMON_DEP="dev-java/dom4j:1
dev-java/log4j
dev-java/itext
dev-java/jaxen:1.1
dev-java/bcmail
dev-java/bcprov
dev-java/jgoodies-looks:2.0
dev-java/commons-lang:2.1
dev-java/iscwt
dev-java/isfreetype
dev-java/isnativec
dev-java/isrt
dev-java/jPod
dev-java/jPodRenderer
dev-java/sun-jai-bin
dev-java/jai-imageio
dev-java/jbig2
dev-java/jna
dev-java/swt:3.4
dev-java/ICEpdf
dev-java/batik:1.7"
RDEPEND=">=virtual/jre-1.5
${COMMON_DEP}"
DEPEND=">=virtual/jdk-1.5
sys-devel/gettext
app-arch/unzip
${COMMON_DEP}"
src_unpack() {
unpack ${A} || die "unpack failed"
die
cp "${DISTDIR}"/icepdf*.zip "${WORKDIR}" || die "cp failed"
mkdir "${S}"
cd "${S}"
for zip in "${WORKDIR}"/*.zip
do
unpack ../work/${zip##*/} || die "unpacking ${zip} failed"
done
for bldprop in emp4j jcmdline pdfsam-maine pdfsam-console pdfsam-cover \
pdfsam-decrypt pdfsam-docinfo pdfsam-encrypt pdfsam-langpack \
pdfsam-merge pdfsam-mix pdfsam-rotate pdfsam-setviewer pdfsam-split \
pdfsam-unpack pdfsam-vcomposer pdfsam-vpagereorder jpodrenderercreator \
icepdfcreator
do
echo > ${S}/${bldprop}/ant/build.properties
echo "pdfsam.deploy.dir=${S}/deploy" >> ${S}/${bldprop}/ant/build.properties
echo "template.dir=${S}/template-enhanced-2" >> ${S}/${bldprop}/ant/build.properties
echo "workspace.dir=${S}" >> ${S}/${bldprop}/ant/build.properties
echo "build.dir=${S}/build" >> ${S}/${bldprop}/ant/build.properties
echo "libs.dir=${S}" >> ${S}/${bldprop}/ant/build.properties
echo "icepdf.libs.dir=${S}" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam.version=enhanced" >> ${S}/${bldprop}/ant/build.properties
echo "itext.jar.name=iText" >> ${S}/${bldprop}/ant/build.properties
echo "log4j.jar.name=log4j" >> ${S}/${bldprop}/ant/build.properties
echo "dom4j.jar.name=dom4j" >> ${S}/${bldprop}/ant/build.properties
echo "jaxen.jar.name=jaxen" >> ${S}/${bldprop}/ant/build.properties
echo "bcmail.jar.name=bcmail" >> ${S}/${bldprop}/ant/build.properties
echo "bcprov.jar.name=bcprov" >> ${S}/${bldprop}/ant/build.properties
echo "looks.jar.name=looks" >> ${S}/${bldprop}/ant/build.properties
echo "commons-lang.jar.name=commons-lang" >> ${S}/${bldprop}/ant/build.properties
echo "iscwt.jar.name=iscwt" >> ${S}/${bldprop}/ant/build.properties
echo "isfreetype.jar.name=isfreetype" >> ${S}/${bldprop}/ant/build.properties
echo "isnativec.jar.name=isnativec" >> ${S}/${bldprop}/ant/build.properties
echo "isrt.jar.name=isrt" >> ${S}/${bldprop}/ant/build.properties
echo "jPod.jar.name=jPod" >> ${S}/${bldprop}/ant/build.properties
echo "jPodFonts.jar.name=jPodFonts" >> ${S}/${bldprop}/ant/build.properties
echo "jPodRenderer.jar.name=jPodRenderer" >> ${S}/${bldprop}/ant/build.properties
echo "jai_codec.jar.name=jai_codec" >> ${S}/${bldprop}/ant/build.properties
echo "jai_core.jar.name=jai_core" >> ${S}/${bldprop}/ant/build.properties
echo "jai_imageio.jar.name=jai_imageio" >> ${S}/${bldprop}/ant/build.properties
echo "jcmdline.jar.name=pdfsam-jcmdline" >> ${S}/${bldprop}/ant/build.properties
echo "emp4j.jar.name=emp4j" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam.jar.name=pdfsam" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-console.jar.name=pdfsam-console" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-split.jar.name=pdfsam-split" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-merge.jar.name=pdfsam-merge" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-cover.jar.name=pdfsam-cover" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-encrypt.jar.name=pdfsam-encrypt" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-decrypt.jar.name=pdfsam-decrypt" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-mix.jar.name=pdfsam-mix" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-unpack.jar.name=pdfsam-unpack" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-langpack.jar.name=pdfsam-langpack" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-setviewer.jar.name=pdfsam-setviewer" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-vpagereorder.jar.name=pdfsam-vpagereorder" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-vcomposer.jar.name=pdfsam-vcomposer" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-docinfo.jar.name=pdfsam-docinfo" >> ${S}/${bldprop}/ant/build.properties
echo "pdfsam-rotate.jar.name=pdfsam-rotate" >> ${S}/${bldprop}/ant/build.properties
echo "jpodcreator.jar.name=jpodcreator" >> ${S}/${bldprop}/ant/build.properties
echo "icepdfcore.jar.name=icepdf-core" >> ${S}/${bldprop}/ant/build.properties
echo "icepdfcreator.jar.name=icepdfcreator" >> ${S}/${bldprop}/ant/build.properties
echo "batik-awt-util.jar.name=batik-awt-util" >> ${S}/${bldprop}/ant/build.properties
echo "batik-dom.jar.name=batik-dom" >> ${S}/${bldprop}/ant/build.properties
echo "batik-svg-dom.jar.name=batik-svg-dom" >> ${S}/${bldprop}/ant/build.properties
echo "batik-svggen.jar.name=batik-svggen" >> ${S}/${bldprop}/ant/build.properties
echo "batik-util.jar.name=batik-util" >> ${S}/${bldprop}/ant/build.properties
echo "batik-xml.jar.name=batik-xml" >> ${S}/${bldprop}/ant/build.properties
done
java-pkg_jarfrom itext
java-pkg_jarfrom dom4j-1
java-pkg_jarfrom log4j
java-pkg_jarfrom jaxen-1.1
java-pkg_jarfrom bcmail
java-pkg_jarfrom bcprov
java-pkg_jarfrom jgoodies-looks-2.0
java-pkg_jarfrom isrt
java-pkg_jarfrom isnativec
java-pkg_jarfrom isfreetype
java-pkg_jarfrom iscwt
java-pkg_jarfrom jPod
java-pkg_jarfrom jPodRenderer
java-pkg_jarfrom sun-jai-bin
java-pkg_jarfrom jai-imageio
java-pkg_jarfrom swt-3.4
java-pkg_jarfrom commons-lang-2.1
java-pkg_jarfrom batik-1.7
java-pkg_jarfrom ICEpdf
}
src_compile() {
eant -buildfile pdfsam-maine/ant/build.xml || die "build failed"
eant -buildfile icepdfcreator/ant/build.xml || die "build failed"
use doc && eant -buildfile pdfsam-maine/ant/build.xml javadoc
}
src_install() {
insinto /usr/share/${PN}-${SLOT}/lib
doins build/pdfsam-maine/release/dist/pdfsam-enhanced/*.xml || die "config install failed"
java-pkg_dojar build/pdfsam-maine/release/dist/pdfsam-enhanced/pdfsam.jar
java-pkg_dojar build/pdfsam-maine/release/dist/pdfsam-enhanced/lib/pdfsam-*.jar
java-pkg_dojar build/pdfsam-maine/release/dist/pdfsam-enhanced/lib/emp4j.jar
java-pkg_dojar build/pdfsam-maine/release/dist/pdfsam-enhanced/ext/jpodcreator.jar
java-pkg_dojar build/icepdfcreator/dist/icepdfcreator.jar
for plugins in cover decrypt docinfo encrypt merge mix rotate setviewer split unpack vcomposer vpagereorder
do
java-pkg_jarinto /usr/share/${PN}-${SLOT}/lib/plugins/${plugins}
insinto /usr/share/${PN}-${SLOT}/lib/plugins/${plugins}
java-pkg_dojar build/pdfsam-maine/release/dist/pdfsam-enhanced/plugins/${plugins}/*.jar
doins build/pdfsam-maine/release/dist/pdfsam-enhanced/plugins/${plugins}/*.xml || die "config install failed"
done
java-pkg_dolauncher ${PN}-${SLOT} --main org.pdfsam.guiclient.GuiClient --pwd "/usr/share/${PN}-${SLOT}/lib"
java-pkg_dolauncher ${PN}-console-${SLOT} --main org.pdfsam.console.ConsoleClient --pwd "/usr/share/${PN}-${SLOT}/lib"
newicon pdfsam-maine/images/pdf.png pdfsam-${SLOT}.png
make_desktop_entry ${PN} "PDF Split and Merge ${PV}" pdfsam-${SLOT} Office
use doc && dodoc pdfsam-maine/doc/enhanced/*
use doc && java-pkg_dojavadoc build/pdfsam-maine/apidocs
}