]>
Commit | Line | Data |
---|---|---|
8d865da1 TP |
1 | # TODO |
2 | # - build jar.so (with gcj stuff) for pdftk | |
a8299603 ER |
3 | # - javadoc fetches from net: |
4 | # [javadoc] Constructing Javadoc information... | |
5 | # [javadoc] javadoc: warning - Error fetching URL: http://www.dom4j.org/apidocs/package-list | |
6 | # [javadoc] javadoc: warning - Error fetching URL: https://pdf-renderer.dev.java.net/nonav/demos/latest/javadoc/package-list | |
2d181589 ER |
7 | # |
8 | # Conditional build: | |
9 | %bcond_without javadoc # don't build javadoc | |
10 | ||
155801c7 ER |
11 | %define altname iText |
12 | %define srcname itext | |
2d181589 | 13 | Summary: A Free Java-PDF library |
155801c7 | 14 | Name: java-%{srcname} |
2d181589 | 15 | Version: 2.1.7 |
155801c7 | 16 | Release: 3 |
2d181589 ER |
17 | License: (LGPLv2+ or MPLv1.1) and ASL 2.0 and BSD and LGPLv2+ |
18 | Group: Libraries/Java | |
19 | URL: http://www.lowagie.com/iText/ | |
20 | Source0: http://downloads.sourceforge.net/itext/iText-src-%{version}.tar.gz | |
40b3da97 | 21 | # Source0-md5: 38c3d47e0f0a87a8151b5b2f208b461e |
155801c7 ER |
22 | Source3: rups.sh |
23 | Source4: rups.desktop | |
24 | Source5: toolbox.sh | |
25 | Source6: toolbox.desktop | |
2d181589 ER |
26 | Patch1: pdftk.patch |
27 | # Maven's Doxia plugin explicitly requires these XML output interfaces | |
28 | # of iText. They were removed in iText 1.4.4 [1]. iText versions prior | |
29 | # to 1.5.x had questionable licensing [2] so rather than try to create | |
30 | # an itext1 package, I have forward-ported these classes. The doxia | |
31 | # developers have told me on IRC on 2009-08-27 that the iText dependency | |
32 | # will likely be deprecated meaning we won't have to keep these forever. | |
33 | # | |
34 | # I've opened a bug with iText: | |
35 | # | |
36 | # https://sourceforge.net/tracker/?func=detail&aid=2846427&group_id=15255&atid=365255 | |
37 | # | |
38 | # and commented on the Doxia but related to this: | |
39 | # | |
40 | # http://jira.codehaus.org/browse/DOXIA-53 | |
41 | # | |
42 | # -- Andrew Overholt, 2009-08-28 | |
43 | # | |
44 | # [1] | |
45 | # http://www.1t3xt.com/about/history.php?branch=history.10&node=14 | |
46 | # [2] | |
47 | # https://bugzilla.redhat.com/show_bug.cgi?id=236309 | |
155801c7 | 48 | Patch3: xmloutput.patch |
2d181589 ER |
49 | BuildRequires: ImageMagick |
50 | BuildRequires: ant | |
2d181589 | 51 | BuildRequires: desktop-file-utils |
a8299603 | 52 | BuildRequires: java-bctsp |
3586ad42 | 53 | BuildRequires: java-dom4j |
a8299603 ER |
54 | BuildRequires: java-pdf-renderer |
55 | BuildRequires: jdk >= 1.6 | |
2d181589 | 56 | BuildRequires: jpackage-utils |
3586ad42 ER |
57 | BuildRequires: rpm-javaprov |
58 | BuildRequires: rpmbuild(macros) >= 1.553 | |
59 | %if %(locale -a | grep -q '^en_US$'; echo $?) | |
60 | BuildRequires: glibc-localedb-all | |
61 | %endif | |
a8299603 | 62 | Requires: java-bctsp |
2d181589 ER |
63 | Requires: jpackage-utils >= 1.5 |
64 | BuildArch: noarch | |
65 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
66 | ||
67 | %description | |
68 | iText is a library that allows you to generate PDF files on the fly. | |
69 | The iText classes are very useful for people who need to generate | |
70 | read-only, platform independent documents containing text, lists, | |
71 | tables and images. The library is especially useful in combination | |
72 | with Java(TM) technology-based Servlets: The look and feel of HTML is | |
73 | browser dependent; with iText and PDF you can control exactly how your | |
74 | servlet's output will look. | |
75 | ||
76 | %package rtf | |
77 | Summary: Library to output Rich Text Files | |
78 | License: MPLv1.1 or LGPLv2+ | |
79 | Group: Development/Libraries | |
80 | Requires: %{name} = %{version}-%{release} | |
81 | ||
82 | %description rtf | |
83 | The RTF package is an extension of the iText library and allows iText | |
84 | to output Rich Text Files in additon to PDF files. These files can | |
85 | then be viewed and edited with RTF viewers such as OpenOffice.org | |
86 | Writer. | |
87 | ||
88 | %package rups | |
89 | Summary: Reading/Updating PDF Syntax | |
90 | License: LGPLv2+ and CC-BY | |
91 | Group: X11/Applications | |
92 | Requires: %{name} = %{version}-%{release} | |
513a7d03 | 93 | Requires: gtk-update-icon-cache |
2d181589 | 94 | Requires: java-dom4j |
a8299603 | 95 | Requires: java-pdf-renderer |
2d181589 ER |
96 | |
97 | %description rups | |
98 | iText RUPS is a tool that combines SUN's PDF Renderer (to view PDF | |
99 | documents), iText's PdfReader (to inspect the internal structure of a | |
100 | PDF file), and iText's PdfStamper to manipulate a PDF file. | |
101 | ||
102 | %package toolbox | |
103 | Summary: Some iText tools | |
104 | License: MPLv1.1 or MIT | |
105 | Group: X11/Applications | |
106 | Requires: %{name} = %{version}-%{release} | |
513a7d03 | 107 | Requires: gtk-update-icon-cache |
2d181589 ER |
108 | |
109 | %description toolbox | |
110 | iText is a free open source Java-PDF library released on SF under the | |
111 | MPL/LGPL; iText comes with a simple GUI: the iText toolbox. The | |
112 | original developers of iText want to publish this toolbox as a | |
113 | separate project under the more permissive MIT license. This is a | |
114 | utility that allows you to use a number of iText tools. | |
115 | ||
116 | %package javadoc | |
117 | Summary: Javadoc for iText | |
118 | Group: Documentation | |
119 | Requires: %{name} = %{version}-%{release} | |
120 | Requires: jpackage-utils | |
121 | ||
122 | %description javadoc | |
123 | API documentation for the iText package. | |
124 | ||
125 | %prep | |
126 | %setup -qcT -a 0 | |
127 | %patch1 -p1 | |
128 | %patch3 -p0 | |
129 | ||
130 | # Remove preshipped binaries | |
3586ad42 | 131 | find -name "*.jar" | xargs -r rm -v |
2d181589 ER |
132 | |
133 | # Fix encoding issues | |
3586ad42 | 134 | %undos src/rups/com/lowagie/rups/view/icons/copyright_notice.txt |
2d181589 ER |
135 | |
136 | install -d lib | |
2d181589 ER |
137 | # Remove jdk & version numbers from classpath entries |
138 | for file in src/ant/{*,.ant*}; do | |
139 | for jarname in bcmail bcprov bctsp dom4j; do | |
140 | sed -i "s|$jarname-.*\.jar|$jarname.jar|" $file | |
141 | done | |
142 | done | |
143 | ||
144 | # Remove classpath elements from manifest | |
145 | sed -i '\|Class-Path|d' src/ant/compile.xml | |
146 | ||
147 | # Setting debug="on" on javac part of the build script. | |
148 | sed -i 's|destdir|debug="on" destdir|g' src/ant/compile.xml | |
149 | sed -i 's|debug="true"||g' src/ant/compile.xml | |
150 | ||
151 | %build | |
3586ad42 ER |
152 | # source code not US-ASCII |
153 | export LC_ALL=en_US | |
154 | ||
a8299603 | 155 | build-jar-repository -s -p lib bcprov bcmail bctsp pdf-renderer dom4j |
3586ad42 | 156 | |
a8299603 | 157 | CLASSPATH=$(build-classpath bcprov bcmail bctsp pdf-renderer dom4j) |
2d181589 | 158 | cd src |
3586ad42 | 159 | %ant jar jar.rups jar.rtf jar.toolbox %{?with_javadoc:javadoc} |
2d181589 ER |
160 | |
161 | %install | |
162 | rm -rf $RPM_BUILD_ROOT | |
163 | ||
164 | # jars | |
165 | install -d $RPM_BUILD_ROOT%{_javadir} | |
155801c7 | 166 | cp -p lib/%{altname}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}-%{version}.jar |
2d181589 | 167 | ln -s %{srcname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}.jar |
155801c7 | 168 | cp -p lib/%{altname}-rtf.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}-rtf-%{version}.jar |
2d181589 | 169 | ln -s %{srcname}-rtf-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}-rtf.jar |
155801c7 | 170 | cp -p lib/%{altname}-rups.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}-rups-%{version}.jar |
2d181589 | 171 | ln -s %{srcname}-rups-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}-rups.jar |
155801c7 | 172 | cp -p lib/%{altname}-toolbox.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}-toolbox-%{version}.jar |
2d181589 ER |
173 | ln -s %{srcname}-toolbox-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}-toolbox.jar |
174 | ||
175 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_desktopdir}} | |
176 | # rups stuff | |
155801c7 | 177 | install -p %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/%{srcname}-rups |
2d181589 ER |
178 | desktop-file-install \ |
179 | --dir=${RPM_BUILD_ROOT}%{_desktopdir} \ | |
180 | %{SOURCE4} | |
181 | ||
182 | # toolbox stuff | |
155801c7 | 183 | install -p %{SOURCE5} $RPM_BUILD_ROOT%{_bindir}/%{srcname}-toolbox |
2d181589 ER |
184 | desktop-file-install \ |
185 | --dir=${RPM_BUILD_ROOT}%{_desktopdir} \ | |
186 | %{SOURCE6} | |
187 | ||
188 | # icon for rups and toolbox | |
189 | install -d $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps | |
155801c7 ER |
190 | convert -resize 128x128 src/toolbox/com/lowagie/toolbox/1t3xt.gif %{srcname}.png |
191 | cp -p %{srcname}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/%{srcname}-rups.png | |
192 | cp -p %{srcname}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/%{srcname}-toolbox.png | |
2d181589 ER |
193 | |
194 | # javadoc | |
195 | %if %{with javadoc} | |
196 | install -d $RPM_BUILD_ROOT%{_javadocdir}/%{srcname}-%{version} | |
a8299603 | 197 | cp -a build/docs/* $RPM_BUILD_ROOT%{_javadocdir}/%{srcname}-%{version} |
2d181589 ER |
198 | ln -s %{srcname}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{srcname} # ghost symlink |
199 | %endif | |
200 | ||
201 | %clean | |
202 | rm -rf $RPM_BUILD_ROOT | |
203 | ||
204 | %post rups | |
513a7d03 | 205 | %update_icon_cache hicolor |
2d181589 ER |
206 | |
207 | %postun rups | |
513a7d03 | 208 | %update_icon_cache hicolor |
2d181589 ER |
209 | |
210 | %post toolbox | |
513a7d03 | 211 | %update_icon_cache hicolor |
2d181589 ER |
212 | |
213 | %postun toolbox | |
513a7d03 | 214 | %update_icon_cache hicolor |
2d181589 ER |
215 | |
216 | %post javadoc | |
217 | ln -nfs %{srcname}-%{version} %{_javadocdir}/%{srcname} | |
218 | ||
219 | %files | |
220 | %defattr(644,root,root,755) | |
221 | %doc build/bin/com/lowagie/text/{apache_license,lgpl,misc_licenses,MPL-1.1}.txt | |
222 | %{_javadir}/%{srcname}.jar | |
223 | %{_javadir}/%{srcname}-%{version}.jar | |
224 | ||
225 | %files rtf | |
226 | %defattr(644,root,root,755) | |
227 | %{_javadir}/%{srcname}-rtf.jar | |
228 | %{_javadir}/%{srcname}-rtf-%{version}.jar | |
229 | ||
230 | %files rups | |
231 | %defattr(644,root,root,755) | |
232 | %doc src/rups/com/lowagie/rups/view/icons/copyright_notice.txt | |
a8299603 ER |
233 | %{_javadir}/%{srcname}-rups.jar |
234 | %{_javadir}/%{srcname}-rups-%{version}.jar | |
155801c7 ER |
235 | %attr(755,root,root) %{_bindir}/%{srcname}-rups |
236 | %{_desktopdir}/rups.desktop | |
237 | %{_iconsdir}/hicolor/128x128/apps/%{srcname}-rups.png | |
2d181589 ER |
238 | |
239 | %files toolbox | |
240 | %defattr(644,root,root,755) | |
241 | %doc src/toolbox/com/lowagie/toolbox/tools.txt | |
242 | %{_javadir}/%{srcname}-toolbox.jar | |
243 | %{_javadir}/%{srcname}-toolbox-%{version}.jar | |
155801c7 ER |
244 | %attr(755,root,root) %{_bindir}/%{srcname}-toolbox |
245 | %{_desktopdir}/toolbox.desktop | |
246 | %{_iconsdir}/hicolor/128x128/apps/%{srcname}-toolbox.png | |
2d181589 ER |
247 | |
248 | %if %{with javadoc} | |
249 | %files javadoc | |
250 | %defattr(644,root,root,755) | |
251 | %{_javadocdir}/%{srcname}-%{version} | |
252 | %ghost %{_javadocdir}/%{srcname} | |
253 | %endif |