From 175f238a18a9c75a40ff7551d383cebe32726390 Mon Sep 17 00:00:00 2001 From: Arthur Bols Date: Feb 10 2021 16:38:56 +0000 Subject: Cleanup spec and add .desktop --- diff --git a/noisetorch.spec b/noisetorch.spec index 7bcda3d..186bf2c 100644 --- a/noisetorch.spec +++ b/noisetorch.spec @@ -1,4 +1,3 @@ -# Generated by go2rpm 1.3 %bcond_without check # https://github.com/lawl/NoiseTorch @@ -8,23 +7,24 @@ Version: 0.10.0 %gometa -%global common_description %{expand: -Real-time microphone noise suppression on Linux.} +%global common_description Real-time microphone noise suppression on Linux. %global golicenses LICENSE %global godocs README.md -Name: noisetorch +Name: noisetorch Release: 1%{?dist} Summary: Real-time microphone noise suppression on Linux # Upstream license specification: BSD-3-Clause and GPL-3.0-only -License: BSD and GPL-3.0-only +License: GPLv3 # FIXME: Upstream uses unknown SPDX tag GPL-3.0-only! URL: %{gourl} Source0: %{gosource} -Source1: version.go -Patch0: 0001-version.patch +Source1: version.go +Patch0: 0001-version.patch + +BuildRequires: desktop-file-utils %description %{common_description} @@ -34,7 +34,7 @@ Patch0: 0001-version.patch %prep %goprep -k %patch0 -p1 -sed "s/VERSIONTOKEN/%{Version}/" %{_sourcedir}/version.go > version.go +sed "s/VERSIONTOKEN/%{Version}/" %{SOURCE1} > version.go %build @@ -42,11 +42,23 @@ sed "s/VERSIONTOKEN/%{Version}/" %{_sourcedir}/version.go > version.go go generate %gobuild -o %{gobuilddir}/bin/noisetorch %{goipath} + %install %gopkginstall install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ +ls -lah %{gobuilddir} + +desktop-file-install \ +--dir=%{buildroot}%{_datadir}/applications \ +--set-icon=noisetorch \ +%{gobuilddir}/../assets/noisetorch.desktop + +install -m 0755 -vd %{buildroot}%{_datadir}/icons/hicolor/256x256/apps +install -m 0664 -vp %{gobuilddir}/../assets/icon/noisetorch.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/noisetorch.png + + %if %{with check} %check %gocheck @@ -56,10 +68,12 @@ install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ %license LICENSE %doc README.md %{_bindir}/* +%{_datadir}/applications/noisetorch.desktop +%{_datadir}/icons/hicolor/256x256/apps/noisetorch.png %gopkgfiles %changelog -* Wed Feb 10 15:26:08 CET 2021 Arthur Bols - 0.10.0-1 +* Wed Feb 10 2021 Arthur Bols - 0.10.0-1 - Initial package