summaryrefslogtreecommitdiffstats
path: root/libhandlebars.spec
blob: 1ccd3ce7d8a81876351fa7f17fb40e67a195f5a1 (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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# remirepo/fedora spec file for libhandlebars
#
# Copyright (c) 2017-2022 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

%global soname        9

%global libname       libhandlebars
%global gh_commit     bc10ea7c40b25ec4678e44a2d4d6640336be789b
%global gh_short      %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner      jbboehr
%global gh_project    handlebars.c

%global hspec_commit  3eb919f19988f37a539779c08342d2ce50aa75d0
%global hspec_short   %(c=%{hspec_commit}; echo ${c:0:7})
%global hspec_owner   jbboehr
%global hspec_project handlebars-spec

%global mspec_commit  83b0721610a4e11832e83df19c73ace3289972b9
%global mspec_short   %(c=%{mspec_commit}; echo ${c:0:7})
%global mspec_owner   mustache
%global mspec_project spec

Name:    %{libname}
Version: 1.0.0
Release: 1%{?dist}
Summary: Handlebars C library

# SPDX
# The executable and the test suite are now licensed under the AGPLv3 or later.
# The library remains licensed under the LGPLv2.1 or later.
License: LGPL-2.1-or-later
URL:     https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?prever}-%{gh_short}.tar.gz
Source1: https://github.com/%{hspec_owner}/%{hspec_project}/archive/%{hspec_commit}/%{hspec_project}-%{hspec_short}.tar.gz
Source2: https://github.com/%{mspec_owner}/%{mspec_project}/archive/%{mspec_commit}/%{mspec_project}-%{mspec_short}.tar.gz

BuildRequires:  gcc
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  libyaml-devel
BuildRequires:  json-c-devel
BuildRequires:  libtalloc-devel
BuildRequires:  pcre-devel
BuildRequires:  lmdb-devel
BuildRequires:  check-devel >= 0.9.9
%if 0%{?fedora}
# Else, use upstream generated files
BuildRequires:  bison >= 3.0.2
BuildRequires:  flex >= 2.5.35
%endif


%description
C implementation of handlebars.js[1], developed in conjunction with
php-handlebars[2] and handlebars.php[3].

[1] http://handlebarsjs.com/
[2] https://github.com/jbboehr/php-handlebars
[3] https://github.com/jbboehr/php-handlebars


%package devel
Summary:  Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
# previous soname
Conflicts:%{name}5-devel <  %{version}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%package -n handlebarsc
License:  AGPL-3.0-or-later
Summary:  Command line tools from %{libname}
Requires: %{name}%{?_isa} = %{version}-%{release}

%description -n handlebarsc
This package provides handlebarsc command line tool split off %{libname}.


%prep
%setup -qn %{gh_project}-%{gh_commit} -a1 -a2

mkdir spec
mv %{hspec_project}-%{hspec_commit} spec/handlebars
mv %{mspec_project}-%{mspec_commit} spec/mustache
./bootstrap


%build
%configure

make %{?_smp_mflags}


%install
make install DESTDIR=%{buildroot}

rm %{buildroot}%{_libdir}/*.{a,la}


%check
make test


%if 0%{?fedora} < 28 && 0%{?rhel} < 8
%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%endif


%files
%{!?_licensedir:%global license %%doc}
%license LICENSE*
%{_libdir}/%{libname}.so.%{soname}*

%files devel
%doc CHANGELOG.md
%{_includedir}/handlebars*
%{_libdir}/%{libname}.so
%{_libdir}/pkgconfig/handlebars.pc

%files -n handlebarsc
%{_bindir}/handlebarsc


%changelog
* Mon Nov 28 2022 Remi Collet <remi@remirepo.net> - 1.0.0-1
- update to 1.0.0
- soname bump

* Mon Dec  7 2020 Remi Collet <remi@remirepo.net> - 0.7.3-1
- update to 0.7.3
- drop patch merged upstream

* Wed Aug 19 2020 Remi Collet <remi@remirepo.net> - 0.7.2-2
- F33 build with patch for -Werror=format-security
  reported as https://github.com/jbboehr/handlebars.c/issues/87

* Wed Apr 22 2020 Remi Collet <remi@remirepo.net> - 0.7.2-1
- update to 0.7.2

* Sun Apr 19 2020 Remi Collet <remi@remirepo.net> - 0.7.1-1
- update to 0.7.1

* Sat Apr 18 2020 Remi Collet <remi@remirepo.net> - 0.7.0-2
- build with upstream patch for _hardened_ldflags

* Fri Apr 17 2020 Remi Collet <remi@remirepo.net> - 0.7.0-1
- update to 0.7.0
- drop patches merged upstream
- open https://github.com/jbboehr/handlebars.c/issues/81
  _hardened_ldflags break build

* Wed Feb 19 2020 Remi Collet <remi@remirepo.net> - 0.6.4-4
- add fix for GCC 10 from
  https://github.com/jbboehr/handlebars.c/pull/76
- add fix for new check library adapted from upstream

* Tue Jun 26 2018 Remi Collet <remi@remirepo.net> - 0.6.4-3
- F28 rebuild

* Mon Feb 26 2018 Remi Collet <remi@remirepo.net> - 0.6.4-2
- F28 cleanup

* Tue Jul 18 2017 Remi Collet <remi@remirepo.net> - 0.6.4-1
- update to 0.6.4

* Sat Jun 10 2017 Remi Collet <remi@remirepo.net> - 0.6.3-2
- latest upstream git snapshot for EL-7

* Fri Jun  9 2017 Remi Collet <remi@remirepo.net> - 0.6.3-1
- initial package