diff --git a/.gitignore b/.gitignore index e69de29..aa0716a 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/libtermkey-0.18.tar.gz diff --git a/fix-test-compile.patch b/fix-test-compile.patch new file mode 100644 index 0000000..8dc4650 --- /dev/null +++ b/fix-test-compile.patch @@ -0,0 +1,9 @@ +diff -uNr libtermkey-0.18.orig/t/05read.c libtermkey-0.18/t/05read.c +--- libtermkey-0.18.orig/t/05read.c 2015-10-06 23:52:28.000000000 +0200 ++++ libtermkey-0.18/t/05read.c 2016-04-14 14:37:56.533341783 +0200 +@@ -1,4 +1,5 @@ + #include ++#include + #include + #include "../termkey.h" + #include "taplib.h" diff --git a/libtermkey.spec b/libtermkey.spec new file mode 100644 index 0000000..d99579f --- /dev/null +++ b/libtermkey.spec @@ -0,0 +1,72 @@ +%global libname termkey + +# Unibilium by default, otherwise ncurses +%bcond_without unibilium + +Name: lib%{libname} +Version: 0.18 +Release: 1%{?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 + +Patch0: fix-test-compile.patch + +BuildRequires: gcc +BuildRequires: make +BuildRequires: libtool +%if %{with unibilium} +BuildRequires: pkgconfig(unibilium) +%else +BuildRequires: pkgconfig(tinfo) +%endif +# For tests +BuildRequires: /usr/bin/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 +echo '#!/bin/sh' > ./configure +chmod +x ./configure + +%build +%configure +%make_build PREFIX=%{_prefix} LIBDIR=%{_libdir} + +%install +%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} +rm -vf %{buildroot}%{_libdir}/*.{a,la} + +%check +make test CFLAGS="%{optflags}" + +%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 Apr 14 2016 Igor Gnatenko - 0.18-1 +- Initial package diff --git a/sources b/sources index e69de29..a4ac28d 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +3be2e3e5a851a49cc5e8567ac108b520 libtermkey-0.18.tar.gz