pw3270.spec.in
10.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
#
# "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
# aplicativos mainframe. Registro no INPI sob o nome G3270.
#
# Copyright (C) <2008> <Banco do Brasil S.A.>
#
# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
# os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
# Free Software Foundation.
#
# Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
# obter mais detalhes.
#
# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
# programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA, 02111-1307, USA
#
# Contatos:
#
# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
# erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
# licinio@bb.com.br (Licínio Luis Branco)
# kraucer@bb.com.br (Kraucer Fernandes Mazuco)
#
#---[ Check for distro ]----------------------------------------------------------------------------------------------
%define _rel @PACKAGE_LEVEL@
%define _release %{_rel}
%define _distro Linux
%define _redhat %(test -e /etc/redhat-release && echo 1 || echo 0)
%define _php %(which php-config 2> /dev/null > /dev/null && echo 1 || echo 0)
%define _python %(which python-config 2> /dev/null > /dev/null && echo 1 || echo 0)
%define _bldreq gtk3-devel libopenssl-devel
%define _java 1
%if 0%{?_php}
%define phpmajor %(php-config --version | cut -d. -f1)
%endif
%if 0%{?suse_version}
%define _release %{_rel}.suse%{suse_version}
%define _distro SuSE Linux %{suse_version}
%if %{?suse_version} < 1200
%define _bldreq gtk2-devel >= 2.16 libopenssl-devel
%endif
%if %{?suse_version} >= 1310
%define _office 1
%define _bldreq gtk3-devel libopenssl-devel
%endif
%endif
%if 0%{?fedora}
%define _release %{_rel}.fc%{fedora}
%define _redhat 0
%define _distro Fedora %{fedora}
%define _bldreq gtk3-devel openssl-devel
%endif
%if 0%{?_redhat}
%define _redhat_prefix %(grep -q "Red Hat Linux" /etc/redhat-release && echo rhl || echo el)
%define _redhat_vernum %(rpm -qf --queryformat %{VERSION} /etc/redhat-release|tr -d '.')
%define _release %{_rel}.%{_redhat_prefix}%{_redhat_vernum}
%define _distro %{_redhat_prefix} %{_redhat_vernum}
%define _bldreq gtk2-devel openssl-devel
%endif
#---[ Packaging ]-----------------------------------------------------------------------------------------------------
Name: @PACKAGE@
License: GPL-2.0
Group: System/X11/Terminals
Version: @PACKAGE_VERSION@
Release: %_release
Summary: IBM 3270 Terminal emulator for gtk
Source: %{name}-%{version}.tar.bz2
Url: https://portal.softwarepublico.gov.br/social/pw3270/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: openssl shared-mime-info lib3270 = @PACKAGE_VERSION@
Provides: lib@PACKAGE@ = @PACKAGE_VERSION@ lib@PACKAGE@.so = @PACKAGE_VERSION@
Distribution: %_distro
BuildRequires: which
BuildRequires: autoconf >= 2.61
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: sed
BuildRequires: pkgconfig
BuildRequires: %{_bldreq}
BuildRequires: gettext-devel
BuildRequires: findutils
BuildRequires: coreutils
BuildRequires: desktop-file-utils
BuildRequires: dbus-1-devel
BuildRequires: dbus-1-glib-devel
%if 0%{?_office}
BuildRequires: libreoffice-sdk
BuildRequires: ucpp
%endif
%if 0%{?_php}
BuildRequires: php-devel
%endif
%if 0%{?_java}
BuildRequires: java-devel
%endif
%if 0%{?_python}
BuildRequires: python-devel
%endif
BuildRequires: rsvg-view
%description
IBM 3270 terminal emulator gtk. It can be used to communicate with
any IBM host that supports 3270-style connections over TELNET.
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%package devel
Summary: Files required for development of %{name} plugins
Group: Development/Libraries/C and C++
Requires: %{name} = @PACKAGE_VERSION@
%description devel
Development files for %{name}
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%package -n lib3270
Summary: 3270 Communication library for %{name}
Group: Development/Libraries/C and C++
Requires: openssl
%description -n lib3270
tn3270 protocol library for %{name}
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%package -n lib3270-devel
Summary: Devel for 3270 Communication library for %{name}
Group: Development/Libraries/C and C++
Requires: lib3270 = @PACKAGE_VERSION@
%description -n lib3270-devel
devel for tn3270 protocol library for %{name}
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%package plugin-dbus
Summary: DBUS object for %{name}
Group: System/X11/Terminals
Requires: %{name} = @PACKAGE_VERSION@
%description plugin-dbus
Plugin exporting a DBUS object from every %{name} open session.
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%if 0%{?_office}
%package -n %{name}-libreoffice
Summary: %{name} extension for libreoffice
Group: Productivity/Office/Suite
Requires: %{name} = @PACKAGE_VERSION@
Requires: libreoffice
%description -n %{name}-libreoffice
This package provides 3270 access object to StarBasic.
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%endif
%if 0%{?_ooRexx}
%package -n %{name}-plugin-rexx
Summary: Rexx class for 3270 access
Group: Development/Languages/Other
Requires: %{name} >= @PACKAGE_VERSION@
Requires: ooRexx
%description -n %{name}-plugin-rexx
This package provides Rexx class and associated libraries
allowing rexx scripts to access tn3270e hosts.
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%endif
%if 0%{?_php}
%package -n php%{phpmajor}-tn3270
Summary: PHP%{phpmajor} Extension Module implementing tn3270 protocol
Group: Development/Libraries/PHP
Requires: lib3270 = @PACKAGE_VERSION@
%description -n php%{phpmajor}-tn3270
This is an extension for acessing 3270 hosts directly
from PHP apps.
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%endif
%if 0%{?_python}
%package -n python-tn3270
Summary: Python Extension Module implementing tn3270 protocol
Group: Development/Libraries/PHP
Requires: lib3270 = @PACKAGE_VERSION@
%description -n python-tn3270
This is an extension for acessing 3270 hosts directly
from python apps.
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%endif
%if 0%{?_java}
%package java
Summary: Java class to interact with pw3270
Group: Development/Libraries/Java
Requires: lib3270 = @PACKAGE_VERSION@
%description java
Java class for lib3270/pw3270 interaction.
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%package -n %{name}-plugin-java
Summary: Java plugin for %{name}
Group: Development/Libraries/Java
Requires: %{name} = @PACKAGE_VERSION@
Requires: %{name}-java = @PACKAGE_VERSION@
%description -n %{name}-plugin-java
This package provides a plugin allowing calling of java classes
from pw3270 application.
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation
Requires: jpackage-utils
Requires: %{name}-plugin-java
%description javadoc
API documentation for %{name}.
Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
%endif
#---[ Build & Install ]-----------------------------------------------------------------------------------------------
%prep
%setup -q -n %{name}-%{version}
find . -exec touch {} \;
aclocal
autoconf
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"
export FFLAGS="$RPM_OPT_FLAGS"
%if 0%{?_office}
export OFFICE_HOME=%{_libdir}/libreoffice
export OO_SDK_HOME=%{_libdir}/libreoffice/sdk
%endif
%if 0%{?_java}
export JAVA_HOME=%{java_home}
%endif
%configure --disable-strip \
--enable-pic \
--with-jnidir="%{_jnidir}" \
--with-jvmjardir="%{_jvmjardir}" \
--with-javadocdir="%{_javadocdir}" \
--with-rexxlibdir="%{_rexxlibdir}"
%build
make clean
make all
%install
rm -rf $RPM_BUILD_ROOT
%makeinstall
%find_lang %{name} langfiles
%clean
rm -rf $RPM_BUILD_ROOT
#---[ Files ]---------------------------------------------------------------------------------------------------------
%files -f langfiles
%defattr(-,root,root)
%doc AUTHORS LICENSE
%{_mandir}/*/*
# Main application
%dir %{_datadir}/@PACKAGE_NAME@
%dir %{_datadir}/@PACKAGE_NAME@/ui
%{_datadir}/applications/@PACKAGE_NAME@.desktop
%{_bindir}/@PACKAGE_NAME@
%{_libdir}/libpw3270.so.@MAJOR_VERSION@
%{_libdir}/libpw3270.so.@PACKAGE_VERSION@
%{_datadir}/@PACKAGE_NAME@/colors.conf
%{_datadir}/@PACKAGE_NAME@/ui/00default.xml
%{_datadir}/@PACKAGE_NAME@/ui/10functions.xml
%{_datadir}/@PACKAGE_NAME@/ui/10keypad.xml
%{_datadir}/@PACKAGE_NAME@/@PACKAGE_NAME@.png
%{_datadir}/@PACKAGE_NAME@/@PACKAGE_NAME@-logo.png
%files -n lib3270
%defattr(-,root,root)
%{_libdir}/lib3270.so.@MAJOR_VERSION@
%{_libdir}/lib3270.so.@PACKAGE_VERSION@
%files -n lib3270-devel
%defattr(-,root,root)
%{_includedir}/pw3270/*.h
%{_includedir}/lib3270/*.h
%{_includedir}/lib3270.h
%{_includedir}/pw3270.h
%{_datadir}/@PACKAGE_NAME@/ui/99debug.xml
%{_datadir}/@PACKAGE_NAME@/ui/98trace.xml
%{_libdir}/pkgconfig/*.pc
%{_libdir}/lib3270.so
%{_libdir}/libpw3270.so
%{_libdir}/*.a
%dir %{_datadir}/@PACKAGE_NAME@/sample
%{_datadir}/@PACKAGE_NAME@/sample/*
%files plugin-dbus
%defattr(-,root,root)
%{_libdir}/@PACKAGE_NAME@-plugins/dbus3270.so
%if 0%{?_office}
%files -n %{name}-libreoffice
%defattr(-,root,root)
%dir %{_libdir}/libreoffice/share/extensions/%{name}
%{_libdir}/libreoffice/share/extensions/%{name}/META-INF/manifest.xml
%{_libdir}/libreoffice/share/extensions/%{name}/description.txt
%{_libdir}/libreoffice/share/extensions/%{name}/description.xml
%{_libdir}/libreoffice/share/extensions/%{name}/pw3270.png
%{_libdir}/libreoffice/share/extensions/%{name}/pw3270.rdb
%{_libdir}/libreoffice/share/extensions/%{name}/pw3270.uno.so
%endif
%if 0%{?_ooRexx}
%files -n %{name}-plugin-rexx
%defattr(-,root,root)
%{_rexxlibdir}/librx3270.so.@PACKAGE_VERSION@
%{_rexxlibdir}/librx3270.so
%{_rexxclassdir}/rx3270.cls
%{_libdir}/@PACKAGE_NAME@-plugins/rx3270.so
%{_datadir}/pw3270/ui/80rexx.xml
%endif
%if 0%{?_php}
%files -n php%{phpmajor}-tn3270
%defattr(-,root,root)
%{_sysconfdir}/php%{phpmajor}/conf.d/tn3270.ini
%{_libdir}/php%{phpmajor}/extensions/tn3270.so
%endif
%if 0%{?_php}
%files -n python-tn3270
%defattr(-,root,root)
%{_libdir}/python/site-packages/py3270.so
%endif
%if 0%{?_java}
%files java
%defattr(-,root,root)
%{_jnidir}/libjni3270.so
%{_jvmjardir}/pw3270.jar
%files -n %{name}-plugin-java
%{_libdir}/@PACKAGE_NAME@-plugins/j3270.so
%files javadoc
%dir %{_javadocdir}/%{name}/*
%{_javadocdir}/%{name}/*
%{_datadir}/pw3270/ui/80javasamples.xml
%endif
#---[ Scripts ]-------------------------------------------------------------------------------------------------------
%post
/sbin/ldconfig
exit 0
%postun
/sbin/ldconfig
exit 0
%post -n lib3270
/sbin/ldconfig
exit 0
%postun -n lib3270
/sbin/ldconfig
exit 0
%if 0%{?_ooRexx}
%postun -n %{name}-plugin-rexx
/sbin/ldconfig
exit 0
%endif