]>
Commit | Line | Data |
---|---|---|
baa8ed58 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | %bcond_without unibilium | |
5 | ||
6 | Summary: Library for easy processing of keyboard entry from terminal-based programs | |
7 | Name: libtermkey | |
713a2b27 | 8 | Version: 0.22 |
8810bbb0 | 9 | Release: 1 |
baa8ed58 ER |
10 | License: MIT |
11 | Group: Libraries | |
12 | Source0: http://www.leonerd.org.uk/code/libtermkey/%{name}-%{version}.tar.gz | |
713a2b27 | 13 | # Source0-md5: 08bf514d59660391c3a21b3977a16c8c |
721993b3 ER |
14 | Patch0: 0001-build-take-into-account-CFLAGS-LDFLAGS-for-tests.patch |
15 | Patch1: 0002-include-stdlib.h-for-putenv.patch | |
baa8ed58 ER |
16 | URL: http://www.leonerd.org.uk/code/libtermkey/ |
17 | BuildRequires: gcc | |
18 | BuildRequires: libtool | |
82678d91 | 19 | BuildRequires: pkgconfig |
baa8ed58 | 20 | %if %{with unibilium} |
82678d91 | 21 | BuildRequires: unibilium-devel >= 0.1.0 |
baa8ed58 ER |
22 | %else |
23 | BuildRequires: pkgconfig(tinfo) | |
24 | %endif | |
25 | %if %{with tests} | |
26 | BuildRequires: /usr/bin/prove | |
27 | %endif | |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
31 | This library allows easy processing of keyboard entry from | |
32 | terminal-based programs. It handles all the necessary logic to | |
33 | recognise special keys, UTF-8 combining, and so on, with a simple | |
34 | interface. | |
35 | ||
36 | %package devel | |
37 | Summary: Development files needed for %{name} | |
38 | Group: Development/Libraries | |
39 | Requires: %{name} = %{version}-%{release} | |
40 | ||
41 | %description devel | |
42 | Development files needed for %{name}. | |
43 | ||
44 | %prep | |
45 | %setup -q | |
46 | ||
8810bbb0 ER |
47 | # No need for demos |
48 | %{__sed} -i -e '/^all:/s/$(DEMOS)//' Makefile | |
49 | ||
baa8ed58 ER |
50 | %build |
51 | %{__make} \ | |
52 | CC="%{__cc}" \ | |
53 | CFLAGS="%{rpmcflags}" \ | |
54 | PREFIX=%{_prefix} \ | |
8810bbb0 ER |
55 | LIBDIR=%{_libdir} \ |
56 | VERBOSE=1 | |
baa8ed58 ER |
57 | |
58 | %if %{with tests} | |
59 | %{__make} test \ | |
60 | CC="%{__cc}" \ | |
8810bbb0 ER |
61 | CFLAGS="%{rpmcflags}" \ |
62 | VERBOSE=1 | |
baa8ed58 ER |
63 | %endif |
64 | ||
65 | %install | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | %{__make} install \ | |
68 | PREFIX=%{_prefix} \ | |
69 | LIBDIR=%{_libdir} \ | |
70 | DESTDIR=$RPM_BUILD_ROOT | |
71 | ||
72 | rm -vf $RPM_BUILD_ROOT%{_libdir}/*.{a,la} | |
73 | ||
74 | %clean | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %post -p /sbin/ldconfig | |
78 | %postun -p /sbin/ldconfig | |
79 | ||
80 | %files | |
81 | %defattr(644,root,root,755) | |
82 | %doc LICENSE | |
83 | %attr(755,root,root) %{_libdir}/libtermkey.so.*.*.* | |
84 | %{_libdir}/libtermkey.so.1 | |
85 | ||
86 | %files devel | |
87 | %defattr(644,root,root,755) | |
88 | %{_libdir}/libtermkey.so | |
89 | %{_includedir}/termkey.h | |
90 | %{_pkgconfigdir}/termkey.pc | |
91 | %{_mandir}/man3/termkey_*.3* | |
92 | %{_mandir}/man7/termkey.7* |