%global commit 05da4ea824fdb65afe72226a9cbd2ab7a0c299f7 %global commitdate 20180822 %global shortcommit %(c=%{commit}; echo ${c:0:7}) # Work around our broken build system... %if ! 0%{?gobuild:1} %define gobuild(o:) go build -buildmode pie -tags=rpm_crashtraceback -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro,-z,now'" -a -v -x %{?**}; %endif Name: realtime Version: 0.1 Release: 0.1.%{commitdate}git%{shortcommit}%{?dist} Summary: A simple tool for managing real-time configuration of systemd units License: MIT URL: https://github.com/jsynacek/realtime Source0: https://github.com/jsynacek/realtime/archive/%{?commit}.tar.gz#/%{name}-%{shortcommit}.tar.gz %if 0%{?rhel} == 7 ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:x86_64 aarch64 ppc64le s390x} BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} %else BuildRequires: go-compilers-golang-compiler %endif %description A simple tool for managing real-time configuration of systemd units. %prep %setup -q -n %{name}-%{commit} %build %gobuild -o realtime cp realtime.man realtime.1 gzip realtime.1 %install mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_mandir}/man1/ install -m 0755 realtime %{buildroot}%{_bindir}/realtime install -m 0755 realtime.1.gz %{buildroot}%{_mandir}/man1/realtime.1.gz %files %license LICENSE %doc %{_mandir}/man1/realtime.1.gz %{_bindir}/realtime %changelog * Thu Aug 23 2018 Jan Synáček - 0.1-0.1.20180822git - initial version