You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-rpm-macros-epel/go-rpm-macros-epel.spec

113 lines
3.5 KiB

# This specfile is licensed under:
# SPDX-License-Identifier: MIT
# License text: https://spdx.org/licenses/MIT.html
# SPDX-FileCopyrightText: 2022 Maxwell G <gotmax@e.email>
# SPDX-FileCopyrightText: Fedora Project Authors
%global _docdir_fmt %{name}
# Pagure does not support downloading raw files of tags.
# Referencing the commit hash is necessary
%dnl %global upstream_version 3.2.0
%global upstream_version c32fbbd25bbcedee8c0b898d3653255b18a0d30e
Name: go-rpm-macros-epel
Version: 1
Release: 4%{?dist}
Summary: Backport of certain Fedora Go RPM macros to EPEL
License: GPL-3.0-or-later
URL: https://pagure.io/go-rpm-macros
Source: macros.zzz-go-rpm-macros-epel
Source: macros.zzz-go-srpm-macros-epel
Source: https://pagure.io/go-rpm-macros/raw/%{upstream_version}/f/rpm/go_mod_vendor.prov
Source: https://pagure.io/go-rpm-macros/raw/%{upstream_version}/f/rpm/fileattrs/go_mod_vendor.attr
Source: https://pagure.io/go-rpm-macros/raw/%{upstream_version}/f/README.md#/README.upstream.md
Source: https://pagure.io/go-rpm-macros/raw/%{upstream_version}/f/LICENSE.txt
# golist-symlink subpackage license
Source: https://github.com/spdx/license-list-data/raw/master/text/Unlicense.txt
# Require RHEL's macros
BuildRequires: go-rpm-macros
BuildRequires: go-srpm-macros
Requires: go-rpm-macros
Requires: go-srpm-macros
Requires: go-srpm-macros-epel = %{version}-%{release}
Requires: /usr/bin/golist
%description
This package contains backports of certain Go RPM macros from Fedora.
%package -n go-srpm-macros-epel
Summary: Backport of certain Go SRPM macros from Fedora
BuildArch: noarch
%description -n go-srpm-macros-epel
This package contains backports of certain Go SRPM macros from Fedora.
%package golist-symlink
Summary: Provides symlink to the bundled golist in go-rpm-macros
# The package just provides a symlink.
License: Unlicense
Requires: go-rpm-macros
%description golist-symlink
This package provides symlink to the bundled golist in go-rpm-macros
RHEL's go-rpm-macros package bundled a modified golist and installs it to
%{_libexecdir}/go-rpm-macros. However, the macros expect it to be installed in
%{_bindir}.
This package is split out and namespaced to allow the upstream golist to be
packaged as golist.
%prep
cp -a %{sources} .
%install
# Install macros and lua
install -Dpm 0644 macros.* -t %{buildroot}%{_rpmmacrodir}
# Install go_mod_vendor generator
install -Dpm 0644 go_mod_vendor.attr -t %{buildroot}%{_rpmconfigdir}/fileattrs
install -Dpm 0755 go_mod_vendor.prov -t %{buildroot}%{_rpmconfigdir}
# Create symlink for golist-symlink subpackage
mkdir %{buildroot}%{_bindir}
ln -s %{_libexecdir}/go-rpm-macros/golist %{buildroot}%{_bindir}/golist
# Install REAMDE
install -Dpm 0644 README.upstream.md %{buildroot}%{_pkgdocdir}/README.md
%ifarch %{go_arches}
%files
%{_rpmmacrodir}/macros.zzz-go-rpm-macros-epel
%endif
%files -n go-srpm-macros-epel
%license LICENSE.txt
%doc %{_pkgdocdir}
%{_rpmmacrodir}/macros.zzz-go-srpm-macros-epel
%{_rpmconfigdir}/go_mod_vendor.prov
%{_rpmconfigdir}/fileattrs/go_mod_vendor.attr
%files golist-symlink
%license Unlicense.txt
%{_bindir}/golist
%changelog
* Wed Aug 31 2022 Maxwell G <gotmax@e.email> - 1-1
- Redfine %%goinstallflags
Relates: rhbz#2098400
- Add support for `%%golang_arches_future` and `%%gometa -f`.
Relates: rhbz#2121796
- Add go-rpm-macros-golist-symlink
Relates: rhbz#2100618