libtermkey/libtermkey.spec

83 lines
2.3 KiB
RPMSpec

%global libname termkey
# Unibilium by default, otherwise ncurses
%bcond_without unibilium
Name: lib%{libname}
Version: 0.18
Release: 2%{?dist}
Summary: Library for easy processing of keyboard entry from terminal-based programs
License: MIT
URL: http://www.leonerd.org.uk/code/libtermkey/
Source0: %{url}/%{name}-%{version}.tar.gz
# All patches are taken from https://github.com/neovim/libtermkey
Patch0001: 0001-Correct-handling-of-ASCII-NUL-to-imply-Ctrl-Space.patch
Patch0002: 0002-Bugfix-for-keypad-mode-switching-unibilium-TI-driver.patch
Patch0003: 0003-Endian-fix-for-unicode-keys-thanks-jamessan.patch
Patch0004: 0004-Include-unistd.h-for-write-pipe-thanks-jamessan.patch
# Non-upstream patches
Patch10: 0001-build-take-into-account-CFLAGS-LDFLAGS-for-tests.patch
Patch11: 0002-include-stdlib.h-for-putenv.patch
BuildRequires: gcc
BuildRequires: make
BuildRequires: libtool
%if %{with unibilium}
BuildRequires: pkgconfig(unibilium)
%else
BuildRequires: pkgconfig(tinfo)
%endif
# For tests
BuildRequires: %{_bindir}/prove
%description
This library allows easy processing of keyboard entry from terminal-based
programs. It handles all the necessary logic to recognise special keys, UTF-8
combining, and so on, with a simple interface.
%package devel
Summary: Development files needed for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
%{summary}.
%prep
%autosetup -p1
# no need for demos
sed -i -e '/^all:/s/$(DEMOS)//' Makefile
%build
CFLAGS="%{__global_cflags}" LDFLAGS="%{__global_ldflags}" %make_build VERBOSE=1
%install
%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir}
rm -vf %{buildroot}%{_libdir}/*.{a,la}
%check
CFLAGS="%{__global_cflags} -D_XOPEN_SOURCE" LDFLAGS="%{__global_ldflags}" make test VERBOSE=1
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%license LICENSE
%{_libdir}/%{name}.so.*
%files devel
%{_libdir}/%{name}.so
%{_includedir}/%{libname}.h
%{_libdir}/pkgconfig/%{libname}.pc
%{_mandir}/man3/%{libname}_*.3*
%{_mandir}/man7/%{libname}.7*
%changelog
* Thu Dec 08 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.18-2
- Fix FTBFS
* Thu Apr 14 2016 Igor Gnatenko <ignatenko@redhat.com> - 0.18-1
- Initial package