File xterm.spec of Package xterm

# spec file for package xterm
# Copyright (c) 2013 SUSE LINUX Products 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

Name:           xterm
%if 0%{?suse_version} > 1220
BuildRequires:  fontpackages-devel
BuildRequires:  freetype2-devel
%if 0%{?suse_version} > 1220
BuildRequires:  gpg-offline
BuildRequires:  ncurses-devel
BuildRequires:  update-desktop-files
%if 0%{?suse_version} > 1130
BuildRequires:  utempter-devel
BuildRequires:  utempter
%if 0%{?suse_version} >= 1000
BuildRequires:  xorg-x11
BuildRequires:  xorg-x11-devel
%if 0%{?suse_version} > 1210
# post xorg libs split
BuildRequires:  libXaw-devel
# separate package now
BuildRequires:  bdftopcf
BuildRequires:  XFree86-devel
BuildRequires:  XFree86-libs
BuildRequires:  xaw3d
Provides:       XFree86:/usr/X11R6/bin/xterm
Provides:       xorg-x11:/usr/X11R6/bin/xterm
# post xorg apps split
%if 0%{?suse_version} > 1210
Requires:       luit
Version:        297
Release:        0
Summary:        The basic X terminal program
License:        MIT
Group:          System/X11/Utilities
Source2:        luitx
Source3:        Backarrow2Delete
Source4:        Backarrow2BackSpace
Source5:        README.SuSE
Source6:        terminal.png
Source11:       xterm.keyring
Source8:        20x20ja.bdf.bz2
Source9:        20x20ko.bdf.bz2
# Snoop for the escape sequence assignment of the keypad
Source20:       snooper.tar.bz2
%define vttest_version 20120506
Patch1:         xterm-settings.patch
Patch2:         xterm-sigwinch.patch
Patch3:         xterm-double_width_fonts.patch
Patch4:         xterm-desktop_file_icon.patch
Patch5:         xterm-forbid_window_and_font_ops.patch
Patch6:         xterm-enable_libtinfo.patch
Patch7:         xterm-allow_iso-utf_fonts_in_menu.patch
Patch101:       vttest-config_update_aarch64.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1220

This package contains the basic X.Org terminal program.

%if 0%{?suse_version} > 1220
%gpg_verify %{S:1}
%gpg_verify %{S:101}
%setup -q -b100
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
cp -t . %{S:8} %{S:9}
bunzip2 %{basename:%{S:8}} %{basename:%{S:9}}
cd ../vttest-%{vttest_version}
%patch101 -p1

# suse 10.x uses older X11 directory structure
%if 0%{?suse_version} < 1100
%define xappdefs   /usr/X11R6/lib/X11/app-defaults
%define xfontsd    /usr/X11R6/lib/X11/fonts
%define xterminfo  /usr/X11R6/lib/X11/etc
%define xappdefs   /usr/share/X11/app-defaults
%define xfontsd    /usr/share/fonts
%define xterminfo  /usr/lib/X11/etc

%configure \
    --enable-256-color \
    --enable-dec-locator \
    --enable-hp-fkeys \
    --enable-luit \
    --enable-mini-luit \
    --enable-sco-fkeys \
    --enable-wide-chars \
    --with-utempter \
    --with-tty-group=tty \
    --with-app-defaults=%{xappdefs} \
%if 0%{?suse_version} < 1000
    --x-includes=/usr/X11R6/include \
    --x-libraries=/usr/X11R6/%{_lib} \
    --enable-backarrow-is-erase \

make %{?_smp_mflags}

pushd "../vttest-%{vttest_version}"
make %{?_smp_mflags}

if ! which bdftopcf &> /dev/null; then exit 1; fi
for i in *.bdf
    bdftopcf "$i" | gzip -9 >"${i%.bdf}.pcf.gz"


mkdir -p $RPM_BUILD_ROOT%{xterminfo}
install -m 644 terminfo $RPM_BUILD_ROOT%{xterminfo}/xterm.terminfo
install -m 644 termcap  $RPM_BUILD_ROOT%{xterminfo}/xterm.termcap

pushd "../vttest-%vttest_version"
    make install DESTDIR=$RPM_BUILD_ROOT
install -m 755 $RPM_SOURCE_DIR/luitx $RPM_BUILD_ROOT/usr/bin
install -m 755 $RPM_SOURCE_DIR/Backarrow2Delete $RPM_BUILD_ROOT/usr/bin
install -m 755 $RPM_SOURCE_DIR/Backarrow2BackSpace $RPM_BUILD_ROOT/usr/bin
install -m 644 $RPM_SOURCE_DIR/README.SuSE .

mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
install -m 644 $RPM_SOURCE_DIR/terminal.png \

mkdir -p $RPM_BUILD_ROOT%{xfontsd}/misc/
install -m 644 *.pcf.gz $RPM_BUILD_ROOT%{xfontsd}/misc/
%suse_update_desktop_file -i xterm TerminalEmulator

%if 0%{?suse_version} > 1220

%attr(755,root,root) /usr/bin/xterm
%dir %{xterminfo}
%dir %{xfontsd}/misc

openSUSE Build Service is sponsored by