File xiterm.spec of Package xiterm

#
# spec file for package xiterm
#
# Copyright (c) 2011 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 http://bugs.opensuse.org/
#



Name:           xiterm
BuildRequires:  fribidi-devel gtk2-devel ncurses-devel update-desktop-files xorg-x11 xorg-x11-devel
%if 0%{?suse_version} > 1130
BuildRequires:  utempter-devel
%else
BuildRequires:  utempter
%endif
%define	appdefdir  /usr/share/X11
%define xincludes  /usr/include
%define xlibraries /usr/%{_lib}
License:        IBM Public License ..
Group:          System/X11/Terminals
AutoReqProv:    on
Provides:       locale(xorg-x11:ja;ko;zh)
Version:        0.5.20040304
Release:        275
# cvs -d:pserver:anonymous@www.openi18n.org:/cvsroot login (no password to login)
# cvs -d:pserver:anonymous@www.openi18n.org:/cvsroot co iterm
# tar jcvf iterm-0.5.20040304.tar.bz2 iterm
Source0:        iterm-0.5.20040304.tar.bz2
Source1:        fonts.tar.bz2
Patch0:         xiterm-fontset.patch
Patch1:         fbiterm-enhance.dif
Patch2:         intptr.patch
Patch3:         null-pointer.patch
Patch4:         enable-scrollbar.patch
Patch5:         fbiterm-exit-code.dif
Patch6:         fbiterm-devconsole.dif
Patch7:         fbiterm-combine-optimize.patch
Patch8:         xiterm-implicit-fortify-decl.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        Internationalized Terminal Emulator for X11

%description
Internationalized Terminal Emulator for X11

%package -n fbiterm
License:        IBM Public License ..
Summary:        Internationalized Terminal Emulator for Framebuffers
Group:          System/X11/Terminals
Provides:       locale(ja;ko;zh)

%description -n fbiterm
An internationalized terminal emulator for framebuffers.

%package -n gtkiterm
License:        IBM Public License ..
Summary:        Internationalized Terminal Emulator for GTK
Group:          System/X11/Terminals
Provides:       locale(gtk2:ja;ko;zh)

%description -n gtkiterm
An internationalized terminal emulator for GTK.

%package -n libiterm
License:        IBM Public License ..
Group:          System/Libraries
Summary:        Internationalized Terminal Emulator Library

%description -n libiterm
This is a portable library for internationalized terminal emulator. All
you need to make terminal emulator is to implements Callback functions,
like a drawing string on specific column and row, or set
fore/background color and so on.

%package -n libiterm-devel
License:        IBM Public License ..
Summary:        Header files and development libraries for libiterm
Group:          Development/Libraries/Other
Requires:       libiterm = %{version}

%description -n libiterm-devel
Header files and development libraries for libiterm

%package -n libXiterm
License:        IBM Public License ..
Group:          System/Libraries
Summary:        Terminal emulator Xaw widget library based on libiterm

%description -n libXiterm
Terminal emulator Xaw widget library based on libiterm

%package -n libXiterm-devel
License:        IBM Public License ..
Summary:        Header files and development libraries for libXiterm
Group:          Development/Libraries/Other
Requires:       libXiterm = %{version}

%description -n libXiterm-devel
Header files and development libraries for libXiterm

%prep
%setup0 -q -n iterm -a 1
%patch0 -p 1 -b .fontset
%patch1 -p 0
%patch2 -p 0 -b .intptr
%patch3 -p 1 -b .null-pointer
%patch4 -p 1 -b .enable-scrollbar
%patch5 -p 0 -b .exit-code
%patch6 -p 0
%patch7
%patch8
find . -name CVS -type d | xargs rm -rf
find . -name .cvsignore -type f | xargs rm -f
find . -type f | xargs chmod u+w
for i in INSTALL* README*
do
   mv $i $i.framework
done

%build
# This package failed when testing with -Wl,-as-needed being default.
# So we disable it here, if you want to retest, just delete this comment and the line below.
export SUSE_ASNEEDED=0
%{?suse_update_config:%{suse_update_config -f lib unix/Xaw/lib unix/Xaw/src unix/fbiterm }}
export CFLAGS="$RPM_OPT_FLAGS"
pushd lib
    autoreconf --force --install
%configure --with-pic --disable-static --x-includes=%{xincludes} \
		--x-libraries=%{xlibraries} \
		--with-utempter \
		--enable-fribidi
%{__make} %{?jobs:-j%jobs}
popd
pushd unix/Xaw/lib
    autoreconf --force --install
%configure --with-pic --disable-static --x-includes=%{xincludes} \
		--x-libraries=%{xlibraries}
    %{__make} %{?jobs:-j%jobs} 'INCLUDES=-I../../../lib/include -I../lib'
popd
pushd unix/Xaw/src
autoreconf --force --install
%configure --with-pic --disable-static --x-includes=%{xincludes} \
		--x-libraries=%{xlibraries}
    %{__make} %{?jobs:-j%jobs} 'INCLUDES=-I../../../lib/include -I../lib' 'LDFLAGS=-L../../../lib/src/.libs -L../lib/.libs'
popd
pushd unix/fbiterm
    autoreconf --force --install
    export LIBS="-lfreetype -lm"
%configure --with-pic --disable-static \
		--x-includes=%{xincludes} \
		--x-libraries=%{xlibraries}
    %{__make} %{?jobs:-j%jobs}  'INCLUDES=-I../../../lib/include' \
         'LDFLAGS=-L../../../lib/src/.libs'
popd
pushd unix/gtk
    %{__make} %{?jobs:-j%jobs} CFLAGS="$CFLAGS -I../../../lib/include -L../../../lib/src/.libs"
popd

%install
pushd lib
   make DESTDIR=$RPM_BUILD_ROOT install
popd
pushd unix/Xaw/lib
   make DESTDIR=$RPM_BUILD_ROOT install
popd
pushd unix/Xaw/src
   make DESTDIR=$RPM_BUILD_ROOT install
popd
pushd unix/fbiterm
   make DESTDIR=$RPM_BUILD_ROOT install
popd
pushd unix/gtk
    install -m 755 src/gtkiterm $RPM_BUILD_ROOT/usr/bin
popd
# install terminfo entry-description
mkdir -p $RPM_BUILD_ROOT/usr/share/terminfo/i
tic -o $RPM_BUILD_ROOT/usr/share/terminfo/ unix/terminfo/iterm.terminfo
mkdir -p $RPM_BUILD_ROOT%{appdefdir}/{ja,ja_JP.UTF-8,}/app-defaults
install -m 644 unix/Xaw/src/XIterm $RPM_BUILD_ROOT%{appdefdir}/app-defaults/XIterm
install -m 644 unix/Xaw/src/XIterm.ja $RPM_BUILD_ROOT%{appdefdir}/ja/app-defaults/XIterm
iconv -f EUC-JP -t UTF-8 < unix/Xaw/src/XIterm.ja > unix/Xaw/src/XIterm.ja.UTF-8
install -m 644 unix/Xaw/src/XIterm.ja.UTF-8 $RPM_BUILD_ROOT%{appdefdir}/ja_JP.UTF-8/app-defaults/XIterm
# install fallback fonts for fbiterm:
mkdir -p $RPM_BUILD_ROOT/usr/share/fbiterm/fonts
pushd fonts
    for i in *.bdf
    do
	bdftopcf ${i} | gzip --best --stdout --force > $RPM_BUILD_ROOT/usr/share/fbiterm/fonts/${i%.bdf}.pcf.gz
    done
popd
rm -f %{buildroot}%{_libdir}/*.la
chmod 0755 $RPM_BUILD_ROOT/%{_bindir}/*

%post -n libiterm -p /sbin/ldconfig

%postun -n libiterm -p /sbin/ldconfig

%post -n libXiterm -p /sbin/ldconfig

%postun -n libXiterm -p /sbin/ldconfig

%clean

%files
%defattr(-, root, root)
%doc unix/Xaw/README* unix/Xaw/src/{COPYING,ChangeLog,INSTALL*}
%attr(-,root,tty) %{_bindir}/xiterm
%{appdefdir}/app-defaults/*
%dir %{appdefdir}/ja/
%dir %{appdefdir}/ja/app-defaults/
%dir %{appdefdir}/ja_JP.UTF-8/
%dir %{appdefdir}/ja_JP.UTF-8/app-defaults/
%{appdefdir}/*/app-defaults/*

%files -n fbiterm
%defattr(-, root, root)
%doc unix/fbiterm/{AUTHORS,COPYING,ChangeLog,INSTALL,NEWS,README*}
%attr(-,root,tty) %{_bindir}/fbiterm
%dir /usr/share/fbiterm/
%dir /usr/share/fbiterm/fonts
/usr/share/fbiterm/fonts/*

%files -n gtkiterm
%defattr(-, root, root)
%doc unix/gtk/README*
%attr(-,root,tty) %{_bindir}/gtkiterm

%files -n libiterm
%defattr(-, root, root)
%{_libdir}/libiterm*.so.*
/usr/share/terminfo/i/iterm*

%files -n libiterm-devel
%defattr(-, root, root)
%doc README* INSTALL* RELNOTES* lib/{COPYING,README*,INSTALL*,ChangeLog} lib/docs/
%doc unix/terminfo/
%{_libdir}/libiterm*.so
/usr/include/iterm/

%files -n libXiterm
%defattr(-, root, root)
%{_libdir}/libXiterm*.so.*

%files -n libXiterm-devel
%defattr(-, root, root)
%doc unix/Xaw/lib/ChangeLog
%{_libdir}/libXiterm*.so
/usr/include/Iterm*.h

%changelog
openSUSE Build Service is sponsored by