quickjs/quickjs.spec

77 lines
1.9 KiB
RPMSpec
Raw Normal View History

#
# spec file for package quickjs
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define ver 2020-11-08
Name: quickjs
Version: 20201108
Release: 0
Summary: Small and embeddable Javascript engine
License: MIT
URL: https://bellard.org/quickjs/
Source0: https://bellard.org/quickjs/%{name}-%{ver}.tar.xz
Source10: quickjs-rpmlintrc
BuildRequires: c_compiler
BuildRequires: make
%description
QuickJS is a small and embeddable JavaScript engine and compiler that supports reference ES2020.
%package docs
Summary: Documentation for quickjs
%description docs
Documentation for quickjs
%package devel
Summary: Development headers for quickjs
%description devel
Development headers for quickjs
%prep
%setup -q -n %{name}-%{ver}
# inject optflags (cannot be passed normally to build)
cat >> "./Makefile" <<-EOF
CFLAGS += %{optflags}
LDFLAGS += %{optflags}
EOF
%build
%make_build prefix=%{_prefix}
%install
%make_install prefix=%{_prefix}
#remove extraneous binary
rm -f %{buildroot}%{_prefix}/lib/quickjs/libquickjs.lto.a
%files
%{_bindir}/qjs
%{_bindir}/qjsc
%{_bindir}/qjscalc
%dir %{_prefix}/lib/%{name}
# qjsc relies on it
%{_prefix}/lib/%{name}/lib%{name}.a
%files devel
%{_includedir}/%{name}
%files docs
%doc doc
%changelog