x3270/x3270.spec

261 lines
8.2 KiB
RPMSpec
Raw Normal View History

#
# spec file for package x3270
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define _suffix ga8
%define _fullname suite3270-%{version}%{_suffix}
%define _x026ver 1.2
Name: x3270
Version: 3.3.15
Release: 0
Summary: A Family of IBM 3270 Terminal Emulators
License: MIT
Group: System/X11/Terminals
Url: http://x3270.bgp.nu
Source0: http://download.sourceforge.net/%{name}/%{_fullname}-src.tgz
Source1: http://download.sourceforge.net/%{name}/x026-%{_x026ver}.tgz
Patch0: mknod.patch
Patch100: usr_local_bin.patch
Patch102: x026-offset.diff
Patch104: pr3270-memleak.patch
BuildRequires: bdftopcf
BuildRequires: fdupes
BuildRequires: fontpackages-devel
BuildRequires: freetype2
BuildRequires: imake
BuildRequires: mkfontdir
BuildRequires: ncurses-devel
BuildRequires: openssl-devel
BuildRequires: tcl-devel
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xaw7)
BuildRequires: pkgconfig(xmu)
BuildRequires: pkgconfig(xpm)
BuildRequires: pkgconfig(xt)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This package contains a family of IBM 3270 mainframe terminal
emulators:
* terminal emulators for interactive use x3270 X Window System
c3270 curses based
* terminal emulators for scripted use s3270 see the x3270-script
man page tcl3270 Tcl based
* printer emulator pr3287
* do not miss the punch card puncher emulator x026
x3270 is an IBM 3270 terminal emulator for the X Window System. x3270
runs over a telnet connection (with or without TN3270E) and emulates
either an IBM 3279 (color) or 3278 (monochrome). It supports APL2
characters, IND$FILE file transfer, NVT mode, a pop-up keypad for
3270-specific keys, alternative keymaps, 3287 printer sessions, and a
scrollbar and has extensive debugging and scripting facilities.
c3270 is the curses-based version of x3270. It runs on any dumb
terminal (an xterm or a console, for example), and supports (almost)
all of the x3270 features. c3270 scripts are compatible with x3270
scripts, and the subset of command line options and resource
definitions are also compatible.
s3270 is a scripting-only version of x3270. This program is intended
primarily for writing "screen-scraping" applications, for example a CGI
back-end script that retrieves database information from a mainframe.
tcl3270 is a Tcl-based 3270 scripting engine. It lets you write Tcl
scripts that manipulate 3270 sessions, and is quite a bit easier to set
up and use than s3270.
pr3287 is the printer companion for the above tools, and allows printer
output from a 3270 session to be directed to a Unix printer queue.
x026 is a fun toy which emulates an x026 puncher.
%prep
# the source-packages all extract to corresponding subdirectories.
# they are all expanded below a 'all3270' directory. this directory
# will also hold the common config.cache
# -q uietly -c reate -name all3270
# -a fter changing into all3270, expand sources
%setup -q -c -n all3270 -T -a0 -a1
%patch0
%patch100
%patch102
%patch104
%build
export CFLAGS="%{optflags}"
export LIBX3270DIR=%{_sysconfdir}/x3270
# the tcl variant
cd tcl3270-3.3
%configure \
--cache-file=../config.cache \
--enable-ssl
make %{?_smp_mflags} LIBX3270DIR=${LIBX3270DIR}
cd ..
# the X variant
cd x3270-3.3
%configure \
--cache-file=../config.cache \
--enable-app-defaults \
--x-includes=%{_includedir} \
--x-libraries=%{_libdir} \
--with-all-xinstall \
--with-fontdir=%{_miscfontsdir} \
--enable-ssl
xmkmf -a
make depend
make %{?_smp_mflags} LIBX3270DIR=${LIBX3270DIR}
cd ..
# the console variant
cd c3270-3.3
%configure \
--cache-file=../config.cache \
--enable-ssl
make %{?_smp_mflags} LIBX3270DIR=${LIBX3270DIR}
cd ..
# the scripting variant
cd s3270-3.3
%configure \
--cache-file=../config.cache \
--enable-ssl
make %{?_smp_mflags} LIBX3270DIR=${LIBX3270DIR}
cd ..
# the printer
cd pr3287-3.3
%configure \
--cache-file=../config.cache \
--enable-ssl
make %{?_smp_mflags} LIBX3270DIR=${LIBX3270DIR}
cd ..
# the IBM 026 keypunch emulator
cd x026-%{_x026ver}
xmkmf
make %{?_smp_mflags}
cd ..
%install
export LIBX3270DIR=%{_sysconfdir}/x3270
# create the default directory structure in the build root
mkdir --parents %{buildroot}{%{_bindir},%{_mandir}/{man1,man5}}
# the X variant
cd x3270-3.3
chmod -x html/Keymap.html
make DESTDIR=%{buildroot} LIBX3270DIR=${LIBX3270DIR} install
make DESTDIR=%{buildroot} LIBX3270DIR=${LIBX3270DIR} install.man
# make install does a mkfontdir, that creates a fonts.dir we don't
# want in the package. remove that:
rm %{buildroot}%{_miscfontsdir}/fonts.dir
install -d -m 755 \
%{buildroot}%{_datadir}/X11/app-defaults
install -m 644 X3270.xad \
%{buildroot}%{_datadir}/X11/app-defaults/X3270
# clean up:
# remove remainders of patching the examples, if existing
rm -v Examples/*.orig || true
cd ..
# the console variant
cd c3270-3.3
make DESTDIR=%{buildroot} LIBX3270DIR=${LIBX3270DIR} install
make DESTDIR=%{buildroot} LIBX3270DIR=${LIBX3270DIR} install.man
cd ..
# the scripting variant
cd s3270-3.3
make DESTDIR=%{buildroot} LIBX3270DIR=${LIBX3270DIR} install
make DESTDIR=%{buildroot} LIBX3270DIR=${LIBX3270DIR} install.man
cd ..
# the tcl variant
cd tcl3270-3.3
make DESTDIR=%{buildroot} LIBX3270DIR=${LIBX3270DIR} install
make DESTDIR=%{buildroot} LIBX3270DIR=${LIBX3270DIR} install.man
cd ..
# the printer
cd pr3287-3.3
make DESTDIR=%{buildroot} LIBX3270DIR=${LIBX3270DIR} install
make DESTDIR=%{buildroot} LIBX3270DIR=${LIBX3270DIR} install.man
cd ..
# the IBM 026 keypunch emulator
cd x026-%{_x026ver}
make DESTDIR=%{buildroot} install install.man
cd ..
# move site config files to the standard locations
mkdir -p %{buildroot}%{_libexecdir}/x3270
# this is a per-site, not a per-machine config file
chmod 644 %{buildroot}%{_sysconfdir}/x3270/ibm_hosts
# set permissions correct
chmod ugo-x %{buildroot}%{_mandir}/man{1,5}/*
# copy the docs
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -pr --parents Playback %{buildroot}%{_docdir}/%{name}
cp -pr --parents x3270-3.3/{Examples,html} %{buildroot}%{_docdir}/%{name}
cp -pr --parents c3270-3.3/html %{buildroot}%{_docdir}/%{name}
cp -pr --parents pr3287-3.3/html %{buildroot}%{_docdir}/%{name}
cp -pr --parents s3270-3.3/{Examples,html} %{buildroot}%{_docdir}/%{name}
cp -pr --parents tcl3270-3.3/{Examples,html} %{buildroot}%{_docdir}/%{name}
# create symlinks in documentation
%fdupes -s %{buildroot}/%{_docdir}
%{reconfigure_fonts_scriptlets}
%files
%defattr(-,root,root,755)
# common files
%dir %{_sysconfdir}/x3270
%dir %{_docdir}/%{name}
%dir %{_docdir}/%{name}/*
%config(noreplace) %{_sysconfdir}/x3270/ibm_hosts
%doc %{_mandir}/man5/ibm_hosts.5.gz
%doc %{_mandir}/man1/x3270if.1.gz
%doc %{_mandir}/man1/x3270-script.1.gz
%{_bindir}/x3270if
# x3270
%{_bindir}/x3270
%dir %{_datadir}/X11/app-defaults
%{_datadir}/X11/app-defaults/X3270
%dir %{_miscfontsdir}
%{_miscfontsdir}/*
%doc %{_mandir}/man1/x3270.1x.gz
%doc %{_docdir}/%{name}/x3270-3.3/Examples
%doc %{_docdir}/%{name}/x3270-3.3/html
%doc %{_docdir}/%{name}/Playback
# c3270
%{_bindir}/c3270
%doc %{_mandir}/man1/c3270.1.gz
%doc %{_docdir}/%{name}/c3270-3.3/html
# pr3287
%{_bindir}/pr3287
%doc %{_mandir}/man1/pr3287.1.gz
%doc %{_docdir}/%{name}/pr3287-3.3/html
# s3270
%{_bindir}/s3270
%doc %{_mandir}/man1/s3270.1.gz
%doc %{_docdir}/%{name}/s3270-3.3/Examples
%doc %{_docdir}/%{name}/s3270-3.3/html
# tcl3270
%{_bindir}/tcl3270
%doc %{_mandir}/man1/tcl3270.1.gz
%doc %{_docdir}/%{name}/tcl3270-3.3/Examples
%doc %{_docdir}/%{name}/tcl3270-3.3/html
# x026
%{_bindir}/x026
%doc %{_mandir}/man1/x026.1x.gz
%changelog