source: app-text/pdfsam/pdfsam-2.2.4e.ebuild @ 028be16

Revision 028be16, 7.7 KB checked in by Mario Fetka <mario.fetka@…>, 5 years ago (diff)

use old swt

Package-Manager: portage-2.2.14
RepoMan?-Options: --force

  • Property mode set to 100644
Line 
1# Copyright 1999-2015 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3# $Header: $
4
5EAPI=4
6JAVA_PKG_IUSE="doc"
7inherit java-pkg-2 eutils java-ant-2
8
9DESCRIPTION="A free open source tool to split and merge pdf documents"
10HOMEPAGE="http://www.pdfsam.org/"
11SRC_URI="mirror://sourceforge/${PN}/${P}-out-src.zip"
12LICENSE="GPL-2"
13SLOT="2.0"
14KEYWORDS="~amd64 arm ~x86"
15IUSE=""
16
17S="${WORKDIR}/pdfsam"
18
19COMMON_DEP="dev-java/dom4j:1
20        dev-java/log4j:0
21        dev-java/itext:0
22        dev-java/jaxen:1.1
23        dev-java/bcmail:0
24        dev-java/bcprov:0
25        dev-java/jgoodies-looks:2.0
26        dev-java/commons-lang:2.1
27        dev-java/iscwt:0
28        dev-java/isfreetype:0
29        dev-java/isnativec:0
30        dev-java/isrt:0
31        dev-java/jPod:0
32        dev-java/jPodRenderer:0
33        dev-java/sun-jai-bin:0
34        dev-java/jai-imageio:0
35        dev-java/jbig2:0
36        dev-java/jna:0
37        dev-java/swt:3.4
38        dev-java/ICEpdf:4
39        dev-java/batik:1.8"
40RDEPEND=">=virtual/jre-1.5
41        ${COMMON_DEP}"
42DEPEND=">=virtual/jdk-1.5
43        sys-devel/gettext
44        app-arch/unzip
45        ${COMMON_DEP}"
46
47src_unpack() {
48        unpack ${A} || die "unpack failed"
49        mkdir "${S}"
50        cd "${S}"
51        for zip in "${WORKDIR}"/*.zip
52        do
53            unpack  ../work/${zip##*/} || die "unpacking ${zip} failed"
54        done
55}
56
57java_prepare() {
58        for bldprop in emp4j jcmdline pdfsam-maine pdfsam-console pdfsam-cover \
59            pdfsam-decrypt pdfsam-docinfo pdfsam-encrypt pdfsam-langpack \
60            pdfsam-merge pdfsam-mix pdfsam-rotate pdfsam-setviewer pdfsam-split \
61            pdfsam-unpack pdfsam-vcomposer pdfsam-vpagereorder jpodrenderercreator \
62            icepdfcreator
63        do
64            echo > ${S}/${bldprop}/ant/build.properties
65            echo "pdfsam.deploy.dir=${S}/deploy" >> ${S}/${bldprop}/ant/build.properties
66            echo "template.dir=${S}/template-enhanced-2" >> ${S}/${bldprop}/ant/build.properties
67            echo "workspace.dir=${S}" >> ${S}/${bldprop}/ant/build.properties
68            echo "build.dir=${S}/build" >> ${S}/${bldprop}/ant/build.properties
69            echo "libs.dir=${S}" >> ${S}/${bldprop}/ant/build.properties
70            echo "icepdf.libs.dir=${S}" >> ${S}/${bldprop}/ant/build.properties
71            echo "pdfsam.version=enhanced" >> ${S}/${bldprop}/ant/build.properties
72            echo "itext.jar.name=iText" >> ${S}/${bldprop}/ant/build.properties
73            echo "log4j.jar.name=log4j" >> ${S}/${bldprop}/ant/build.properties
74            echo "dom4j.jar.name=dom4j" >> ${S}/${bldprop}/ant/build.properties
75            echo "jaxen.jar.name=jaxen" >> ${S}/${bldprop}/ant/build.properties
76            echo "bcmail.jar.name=bcmail" >> ${S}/${bldprop}/ant/build.properties
77            echo "bcprov.jar.name=bcprov" >> ${S}/${bldprop}/ant/build.properties
78            echo "looks.jar.name=looks" >> ${S}/${bldprop}/ant/build.properties
79            echo "commons-lang.jar.name=commons-lang" >> ${S}/${bldprop}/ant/build.properties
80            echo "iscwt.jar.name=iscwt" >> ${S}/${bldprop}/ant/build.properties
81            echo "isfreetype.jar.name=isfreetype" >> ${S}/${bldprop}/ant/build.properties
82            echo "isnativec.jar.name=isnativec" >> ${S}/${bldprop}/ant/build.properties
83            echo "isrt.jar.name=isrt" >> ${S}/${bldprop}/ant/build.properties
84            echo "jPod.jar.name=jPod" >> ${S}/${bldprop}/ant/build.properties
85            echo "jPodFonts.jar.name=jPodFonts" >> ${S}/${bldprop}/ant/build.properties
86            echo "jPodRenderer.jar.name=jPodRenderer" >> ${S}/${bldprop}/ant/build.properties
87            echo "jai_codec.jar.name=jai_codec" >> ${S}/${bldprop}/ant/build.properties
88            echo "jai_core.jar.name=jai_core" >> ${S}/${bldprop}/ant/build.properties
89            echo "jai_imageio.jar.name=jai_imageio" >> ${S}/${bldprop}/ant/build.properties
90            echo "jcmdline.jar.name=pdfsam-jcmdline" >> ${S}/${bldprop}/ant/build.properties
91            echo "emp4j.jar.name=emp4j" >> ${S}/${bldprop}/ant/build.properties
92            echo "pdfsam.jar.name=pdfsam" >> ${S}/${bldprop}/ant/build.properties
93            echo "pdfsam-console.jar.name=pdfsam-console" >> ${S}/${bldprop}/ant/build.properties
94            echo "pdfsam-split.jar.name=pdfsam-split" >> ${S}/${bldprop}/ant/build.properties
95            echo "pdfsam-merge.jar.name=pdfsam-merge" >> ${S}/${bldprop}/ant/build.properties
96            echo "pdfsam-cover.jar.name=pdfsam-cover" >> ${S}/${bldprop}/ant/build.properties
97            echo "pdfsam-encrypt.jar.name=pdfsam-encrypt" >> ${S}/${bldprop}/ant/build.properties
98            echo "pdfsam-decrypt.jar.name=pdfsam-decrypt" >> ${S}/${bldprop}/ant/build.properties
99            echo "pdfsam-mix.jar.name=pdfsam-mix" >> ${S}/${bldprop}/ant/build.properties
100            echo "pdfsam-unpack.jar.name=pdfsam-unpack" >> ${S}/${bldprop}/ant/build.properties
101            echo "pdfsam-langpack.jar.name=pdfsam-langpack" >> ${S}/${bldprop}/ant/build.properties
102            echo "pdfsam-setviewer.jar.name=pdfsam-setviewer" >> ${S}/${bldprop}/ant/build.properties
103            echo "pdfsam-vpagereorder.jar.name=pdfsam-vpagereorder" >> ${S}/${bldprop}/ant/build.properties
104            echo "pdfsam-vcomposer.jar.name=pdfsam-vcomposer" >> ${S}/${bldprop}/ant/build.properties
105            echo "pdfsam-docinfo.jar.name=pdfsam-docinfo" >> ${S}/${bldprop}/ant/build.properties
106            echo "pdfsam-rotate.jar.name=pdfsam-rotate" >> ${S}/${bldprop}/ant/build.properties
107            echo "jpodcreator.jar.name=jpodcreator" >> ${S}/${bldprop}/ant/build.properties
108            echo "icepdfcore.jar.name=icepdf-core" >> ${S}/${bldprop}/ant/build.properties
109            echo "icepdfcreator.jar.name=icepdfcreator" >> ${S}/${bldprop}/ant/build.properties
110            echo "batik-awt-util.jar.name=batik-awt-util" >> ${S}/${bldprop}/ant/build.properties
111            echo "batik-dom.jar.name=batik-dom" >> ${S}/${bldprop}/ant/build.properties
112            echo "batik-svg-dom.jar.name=batik-svg-dom" >> ${S}/${bldprop}/ant/build.properties
113            echo "batik-svggen.jar.name=batik-svggen" >> ${S}/${bldprop}/ant/build.properties
114            echo "batik-util.jar.name=batik-util" >> ${S}/${bldprop}/ant/build.properties
115            echo "batik-xml.jar.name=batik-xml" >> ${S}/${bldprop}/ant/build.properties
116        done
117
118        java-pkg_jarfrom itext
119        java-pkg_jarfrom dom4j-1
120        java-pkg_jarfrom log4j
121        java-pkg_jarfrom jaxen-1.1
122        java-pkg_jarfrom bcmail
123        java-pkg_jarfrom bcprov
124        java-pkg_jarfrom jgoodies-looks-2.0
125        java-pkg_jarfrom isrt
126        java-pkg_jarfrom isnativec
127        java-pkg_jarfrom isfreetype
128        java-pkg_jarfrom iscwt
129        java-pkg_jarfrom jPod
130        java-pkg_jarfrom jPodRenderer
131        java-pkg_jarfrom sun-jai-bin
132        java-pkg_jarfrom jai-imageio
133        java-pkg_jarfrom swt-3.4
134        java-pkg_jarfrom commons-lang-2.1
135        java-pkg_jarfrom batik-1.8
136        java-pkg_jarfrom ICEpdf-4
137}
138
139src_compile() {
140        eant -buildfile pdfsam-maine/ant/build.xml || die "build failed"
141        eant -buildfile icepdfcreator/ant/build.xml || die "build failed"
142
143        use doc && eant -buildfile pdfsam-maine/ant/build.xml javadoc
144}
145
146src_install() {
147        insinto /usr/share/${PN}-${SLOT}/lib
148        doins build/pdfsam-maine/release/dist/pdfsam-enhanced/*.xml
149        java-pkg_dojar build/pdfsam-maine/release/dist/pdfsam-enhanced/pdfsam.jar
150        java-pkg_dojar build/pdfsam-maine/release/dist/pdfsam-enhanced/lib/pdfsam-*.jar
151        java-pkg_dojar build/pdfsam-maine/release/dist/pdfsam-enhanced/lib/emp4j.jar
152        java-pkg_dojar build/pdfsam-maine/release/dist/pdfsam-enhanced/ext/jpodcreator.jar
153        java-pkg_dojar build/icepdfcreator/dist/icepdfcreator.jar
154
155        for plugins in cover decrypt docinfo  encrypt merge mix rotate setviewer split unpack vcomposer vpagereorder
156        do
157            java-pkg_jarinto /usr/share/${PN}-${SLOT}/lib/plugins/${plugins}
158            insinto /usr/share/${PN}-${SLOT}/lib/plugins/${plugins}
159
160            java-pkg_dojar build/pdfsam-maine/release/dist/pdfsam-enhanced/plugins/${plugins}/*.jar
161            doins build/pdfsam-maine/release/dist/pdfsam-enhanced/plugins/${plugins}/*.xml
162        done
163
164        java-pkg_dolauncher ${PN}-${SLOT} --main org.pdfsam.guiclient.GuiClient --pwd "/usr/share/${PN}-${SLOT}/lib"
165        java-pkg_dolauncher ${PN}-console-${SLOT} --main org.pdfsam.console.ConsoleClient --pwd "/usr/share/${PN}-${SLOT}/lib"
166
167        newicon pdfsam-maine/images/pdf.png pdfsam-${SLOT}.png
168        make_desktop_entry ${PN} "PDF Split and Merge ${PV}" pdfsam-${SLOT} Office
169
170        use doc && dodoc pdfsam-maine/doc/enhanced/*
171
172        use doc && java-pkg_dojavadoc build/pdfsam-maine/apidocs
173}
Note: See TracBrowser for help on using the repository browser.