summaryrefslogtreecommitdiffstats
path: root/sexpp.spec
blob: 012c1c70061bba1e4847a7dfba2d4386f7ccc5b0 (plain)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# remirepo/fedora spec file for sexpp
#
# Copyright (c) 2023 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

%bcond_without      tests
%bcond_with         licensecheck

%global libname     libsexpp
%global soname      0

Name:          sexpp
Summary:       S-expressions parser and generator tools
Version:       0.8.7
Release:       1%{?dist}
License:       MIT

URL:           https://github.com/rnpgp/%{name}
Source0:       %{url}/archive/refs/tags/v%{version}.tar.gz
# Use --with licensecheck to generate
Source3:       %{name}-files-by-license.txt

BuildRequires:  cmake >= 3.14
BuildRequires:  gcc
BuildRequires:  gcc-c++
%if 0%{?rhel} == 8
BuildRequires:  gtest-devel
%else
BuildRequires:  cmake(GTest)
%endif
%if %{with licensecheck}
BuildRequires:  licensecheck
%endif

Requires:       %{libname}%{?_isa} = %{version}-%{release}


%description
S-expressions parser and generator tools.


%package -n %{libname}
Summary:    S-expressions parser and generator library

%description -n %{libname}
%{libname} is a C++ library for working with S-expressions.

This implementation is derived from the reference SEXP C library developed by
Professors Ronald Rivest and Butler Lampson of MIT LCS (now CSAIL).



%package -n %{libname}-devel
Summary:    Header files and development libraries for %{libname}
Requires:   %{libname}%{?_isa} = %{version}-%{release}

%description -n %{libname}-devel
This package contains the header files and development libraries
for %{libname}.


%prep
%setup -q

%if %{with licensecheck}
LST=$(mktemp)

licensecheck -r . | sed -e 's:^./::' >$LST
grep -v UNKNOWN $LST | sed -e 's/.*: //' | sort -u | while read lic
do
    echo -e "\n$lic\n------------"
    grep ": $lic\$" $LST | sed -e "s/: $lic//"
done  | tee %{SOURCE3}
rm $LST
%endif


%build
%cmake . \
%if %{with tests}
   -DWITH_SEXP_TESTS:BOOL=ON \
%else
   -DWITH_SEXP_TESTS:BOOL=OFF \
%endif
   -DWITH_SEXP_CLI:BOOL=ON \
   -DWITH_SANITIZERS:BOOL=OFF \
   -DWITH_COVERAGE:BOOL=OFF \
   -DBUILD_SHARED_LIBS:BOOL=ON \
   -DDOWNLOAD_GTEST:BOOL=OFF

%cmake_build


%install
%cmake_install


%if %{with tests}
%check
%ctest
%endif


%files
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*

%files -n %{libname}
%license LICENSE*
%{_libdir}/%{libname}.so.%{soname}*

%files -n %{libname}-devel
%{_includedir}/%{name}
%{_libdir}/%{libname}.so
%{_libdir}/pkgconfig/%{name}.pc


%changelog
* Mon Jun 26 2023 Remi Collet <remi@remirepo.net> - 0.8.7-1
- update to 0.8.7
- rename to sexpp

* Fri Jun 23 2023 Remi Collet <remi@remirepo.net> - 0.8.6-1
- update to 0.8.6
- drop patch merged upstream

* Wed Jun 21 2023 Remi Collet <remi@remirepo.net> - 0.8.5-1
- update to 0.8.5
- open https://github.com/rnpgp/sexp/pull/37 define SOVERSION

* Thu May  4 2023 Remi Collet <remi@remirepo.net> - 0.8.4-1
- initial package
- open https://github.com/rnpgp/sexp/issues/32 build as shared
- open https://github.com/rnpgp/sexp/issues/33 clarify license