File libt3key.spec of Package libt3key

#
# spec file for package libt3key
#
# Copyright (c) 2010 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/
#

# norootforbuild
%define debug_package %{nil}

Name:           libt3key
Version:        0.2.7
Release:        1
Summary:        Terminal key sequence database library
Group:          Development/Libraries/C and C++
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

License:        GPLv3
URL:            http://os.ghalkes.nl/t3/libt3key.html
Source0:        http://os.ghalkes.nl/dist/libt3key-0.2.7.tar.bz2

BuildRequires:  libtool, gettext, ncurses-devel, libt3config-devel >= 0.2.5
%if 0%{?suse_version}
%if 0%{?suse_version} >= 1110
BuildRequires:  pkg-config, xorg-x11-libX11-devel
%else
BuildRequires:  pkgconfig, xorg-x11-devel
%endif
%endif
%if 0%{?mdkversion}
BuildRequires:  pkgconfig, libx11-devel
%endif
%if 0%{?fedora}%{?rhel_version}%{?centos_version}%{?rhel}
BuildRequires:  pkgconfig, libX11-devel
%endif

%description
libt3key is library that provides a database of mappings from escape sequences
as generated by different consoles and terminals or emulators, to key symbols.
It is part of the Tilde Terminal Toolkit.

%package -n %{name}1
Summary:        Terminal key sequence database library
Group:          Development/Libraries/C and C++

%description -n %{name}1
libt3key is library that provides a database of mappings from escape sequences
as generated by different consoles and terminals or emulators, to key symbols.
It is part of the Tilde Terminal Toolkit.


%package        devel
Group:          Development/Libraries/C and C++
Summary:        Development files for %{name}
Requires:       %{name}1 = %{version}-%{release}, libt3config-devel >= 0.2.5

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package        utils
Group:          System/Base
Summary:        Utilities for working with %{name} terminal descriptions

%description    utils
The %{name}-utils package contains the t3learnkeys and t3keyc programs.

%prep
%setup -q


%build
./configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_docdir}/%{name}1 --mandir=%{_mandir} --dump-log
make %{?_smp_mflags}


%install
make install DESTDIR=%{buildroot}
find %{buildroot} '(' -name '*.la' -o -name '*.a' ')' -exec rm -f {} ';'
install -d %{buildroot}/%{_docdir}/%{name}-dev
install -d %{buildroot}/%{_docdir}/%{name}-utils
cp %{buildroot}/%{_docdir}/%{name}1/COPYING %{buildroot}/%{_docdir}/%{name}-dev/
cp %{buildroot}/%{_docdir}/%{name}1/COPYING %{buildroot}/%{_docdir}/%{name}-utils/
%if 0%{?fedora}%{?rhel_version}%{?centos_version}%{?rhel}
find %{buildroot}/%{_libdir} -type f -name '*.so.*' | xargs chmod +x
%endif

%clean
rm -rf %{buildroot}


%post -n %{name}1 -p /sbin/ldconfig

%postun -n %{name}1 -p /sbin/ldconfig


%files -n %{name}1
%defattr(-, root, root, -)
%{_libdir}/*.so.*
%{_datadir}/%{name}1
%docdir %{_docdir}/%{name}1
%{_docdir}/%{name}1

%files devel
%defattr(-, root, root, -)
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc
%docdir %{_docdir}/%{name}-dev
%{_docdir}/%{name}-dev

%files utils
%defattr(-, root, root, -)
%{_bindir}/*
%{_mandir}/man1/*
%docdir %{_docdir}/%{name}-utils
%{_docdir}/%{name}-utils