%global debug_package %{nil}

%global provider github
%global provider_tld com
%global project containers
%global repo conmon
# https://github.com/projectatomic/conmon
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}
%global git0 https://%{import_path}
%global commit0 #COMMIT#
%global shortcommit0 %(c=%{commit0}; echo ${c:0:8})

Name: %{repo}
Version: 0
Release: #COMMITDATE#.git%{shortcommit0}%{?dist}
Summary: OCI container runtime monitor
License: ASL 2.0
URL: %{git0}
Source0: %{git0}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz
ExclusiveArch: aarch64 %{arm} ppc64le s390x x86_64
BuildRequires: gcc
BuildRequires: glib2-devel
BuildRequires: glibc-devel
BuildRequires: libseccomp-devel
BuildRequires: git
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
BuildRequires: golang
BuildRequires: pkgconfig

%description
%{summary}

%prep
%autosetup -Sgit -n %{name}-%{shortcommit0}

%build
%{__make} all

%install
%{__make} PREFIX=%{buildroot}%{_usr} install

%check

#define license tag if not already defined
%{!?_licensedir:%global license %doc}

%files
%license LICENSE
%doc README.md
%{_usr}/bin/%{name}
%{_mandir}/man8/*.8*

%changelog
* Mon Oct 01 2018 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.1.gite7805e2
- new package

