github.com/pojntfx/hydrapp/hydrapp@v0.0.0-20240516002902-d08759d6ca9f/pkg/renderers/rpm/spec.spec (about) 1 Name: {{ .AppID }} 2 Version: {{ (LastRelease .AppReleases).Version }} 3 Release: {{ .BranchTimestampUNIX }}%{?dist} 4 Summary: {{ .AppSummary }} 5 6 License: {{ .AppSPDX }} 7 URL: {{ .AppURL }} 8 Source0: %{name}-%{version}.tar.gz 9 10 %if 0%{?suse_version} 11 BuildRequires: go >= 1.21, desktop-file-utils >= 0.23, git >= 2.27.0, appstream-glib >= 0.7.16, npm >= 8.11.0{{ range $pkg := .ExtraPackages }}, {{ $pkg.Name }} >= {{ $pkg.Version }}{{ end }} 12 %else 13 BuildRequires: golang >= 1.21, desktop-file-utils >= 0.23, git >= 2.27.0, libappstream-glib >= 0.7.14, npm >= 8.11.0{{ range $pkg := .ExtraPackages }}, {{ $pkg.Name }} >= {{ $pkg.Version }}{{ end }} 14 %endif 15 16 Suggests: chromium >= 90 17 18 %description 19 {{ .AppDescription }} 20 21 %global debug_package %{nil} 22 23 %prep 24 %autosetup 25 26 27 %build 28 GOPROXY='https://proxy.golang.org,direct' GOFLAGS="{{ .GoFlags }}" sh -c '{{ .GoGenerate }}' 29 GOPROXY='https://proxy.golang.org,direct' GOFLAGS="{{ .GoFlags }}" CGO_ENABLED=1 go build -o out/{{ .AppID }} {{ .GoMain }} 30 for icon in 16x16 22x22 24x24 32x32 36x36 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512; do cp "{{ .GoMain }}/icon-${icon}.png" out/icon-${icon}.png; done 31 32 %install 33 install -D out/{{ .AppID }} %{?buildroot}/%{_bindir}/{{ .AppID }} 34 desktop-file-install --dir=%{?buildroot}/usr/share/applications {{ .GoMain }}/{{ .AppID }}.desktop 35 appstream-util validate-relax {{ .GoMain }}/{{ .AppID }}.metainfo.xml 36 for icon in 16x16 22x22 24x24 32x32 36x36 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512; do install -D -m 0644 out/icon-${icon}.png %{?buildroot}/usr/share/icons/hicolor/${icon}/apps/{{ .AppID }}.png; done 37 install -D -m 0644 {{ .GoMain }}/{{ .AppID }}.metainfo.xml ${RPM_BUILD_ROOT}%{_datadir}/metainfo/{{ .AppID }}.metainfo.xml 38 39 %files 40 %license LICENSE 41 %{_bindir}/{{ .AppID }} 42 %{_datadir}/applications/{{ .AppID }}.desktop 43 %{_datadir}/metainfo/{{ .AppID }}.metainfo.xml 44 %{_datadir}/icons/hicolor/*/apps/{{ .AppID }}.png 45 46 %changelog{{ range $release := .AppReleases }} 47 * {{ $release.Date.Format "Mon Jan 02 2006" }} {{ $release.Author }} <{{ $release.Email }}> {{ $release.Version }}-{{ $.BranchTimestampUNIX }}%{?dist} 48 - {{ $release.Description }} 49 {{ end }}