summaryrefslogtreecommitdiff
path: root/termpaint.spec
blob: 8a7060cdfbd4384126a01378969d8beeb917224a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
%global forgeurl https://github.com/termpaint/termpaint
%global commit 20d324f4d1bab3665d8a36e9c6ee0062e22962f1
%forgemeta

Name: termpaint
Version: 0.3.0
Release: %autorelease
Summary: Low level terminal access

# BSD: valgrind support header, termpaint_image uses picojson
License: Boost and BSD
URL: %{forgeurl}
Source0: %{forgesource}

BuildRequires: meson
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: pkgconfig(fmt)
BuildRequires: pkgconfig(catch2)
BuildRequires: python3-sphinx
Provides: bundled(valgrind) = 3.15

%if 0%{?rhel}
Provides:      bundled(picojson) = 1.3.0-0.20170306gita944d59
Provides:      bundled(docopt-cpp) = 0.6.2-0.20200214gitc8a63d5
%global meson_use_system "disabled"
%else
BuildRequires: picojson-static
BuildRequires: pkgconfig(docopt)
%global meson_use_system "enabled"
%endif

%description
Termpaint is a low level terminal interface library for character-cell terminals
in the tradition of VT1xx (like xterm, etc).  It is designed to be portable and
flexible to integrate.  It covers event handling and rendering.


%package devel
Summary: Header files for the termpaint library
Requires: %{name}%{?_isa} = %{version}-%{release}

%description devel
This package contains the header files and symbolic links need for building
software using termpaint, as well as the documentation.


%prep
%forgeautosetup
rm -rf third-party/{catch.hpp,format.cc,format.h,linux_syscall_support.h}
%if %{undefined rhel}
rm -rf third-party/{picojson.h,docopt}
%endif


%build
%meson -Dsystem-fmt=enabled -Dsystem-catch2=enabled \
       -Dsystem-picojson=%{meson_use_system} -Dsystem-docopt=%{meson_use_system} \
       -Dttyrescue-fexec-blob=false -Dttyrescue-path=%{_libdir}/termpaint/ \
       -Dttyrescue-install=true -Dtools-path=%{_libdir}/termpaint/
%meson_build
cd doc && python3 -m sphinx -b html . _build -a


%install
%meson_install
mkdir -p %{buildroot}%{_pkgdocdir}/html
cp -r doc/_build/. %{buildroot}%{_pkgdocdir}/html
rm -rf %{buildroot}%{_pkgdocdir}/html/.doctrees
rm -f %{buildroot}%{_pkgdocdir}/html/.buildinfo


%check
%meson_test


%files
%doc README.md
%license COPYING
%{_libdir}/libtermpaint.so.0a
%{_libdir}/libtermpaint_image.so.0a
%{_libdir}/termpaint/detect
%{_libdir}/termpaint/inputevents
%{_libdir}/termpaint/ttyrescue

%files devel
%{_libdir}/libtermpaint.so
%{_libdir}/libtermpaint_image.so
%{_libdir}/pkgconfig/termpaint.pc
%{_libdir}/pkgconfig/termpaint_image.pc
%{_includedir}/termpaint.h
%{_includedir}/termpaint_event.h
%{_includedir}/termpaint_image.h
%{_includedir}/termpaint_input.h
%{_includedir}/termpaintx.h
%{_includedir}/termpaintx_ttyrescue.h

%dir %{_pkgdocdir}
%{_pkgdocdir}/html

%changelog
%autochangelog