File dettrace.spec of Package dettrace

#
# spec file for package dettrace
#
# Copyright (c) 2021 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 http://bugs.opensuse.org/
#

# clang has no lto=auto
%define _lto_cflags %{nil}

Name:           dettrace
Version:        git1740580318.edecfe6
Release:        0
Summary:        Tool to make programs deterministic
License:        MIT
Url:            https://github.com/dettrace/dettrace
#Git-Clone:     https://github.com/dettrace/dettrace.git
Source:         dettrace-%{version}.tar
Source2:        https://github.com/bmwiedemann/theunreproduciblepackage/archive/v1.0.tar.gz#/theunreproduciblepackage-1.0.tar.gz
Source3:        test.ref.md5
BuildRequires:  clang-devel
BuildRequires:  help2man
BuildRequires:  linux-glibc-devel
BuildRequires:  libseccomp-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A Reproducible Container Abstraction

%prep
%setup -q

%build
%make_build %{?_smp_mflags} EXTRA_CXXFLAGS="%{optflags}"

%install
mkdir -p %{buildroot}%{_prefix}/bin
mkdir -p %{buildroot}%{_mandir}/man1
make install DESTDIR=%{buildroot}%{_libexecdir}/%{name}
cat >%{buildroot}%{_bindir}/%{name} <<EOF
#!/bin/sh
exec %{_libexecdir}/%{name}/bin/dettrace "\$@"
EOF
help2man %{buildroot}%{_libexecdir}/%{name}/bin/dettrace > %{buildroot}%{_mandir}/man1/%{name}.1

%check
tar xf %{SOURCE2}
cd theunreproduciblepackage*
echo dummy > out/dummy
find -type d | sort | xargs -l -IDIR \
%{buildroot}%{_libexecdir}/%{name}/bin/dettrace -- make -k -C DIR || :
cd out && head * && md5sum -c %{SOURCE3}

%files
%defattr(-,root,root)
%license LICENSE
%doc README.md CONTRIBUTING.md
%{_mandir}/man1/dettrace.1.gz
%{_libexecdir}/%{name}
%attr(755, -, root) %{_bindir}/%{name}

%changelog
openSUSE Build Service is sponsored by