Compare commits

...

No commits in common. "c9s" and "c9-beta" have entirely different histories.
c9s ... c9-beta

10 changed files with 54 additions and 90 deletions

8
.gitignore vendored
View File

@ -1,6 +1,2 @@
/go-rpm-macros-3.0.8.tar.gz
/go-rpm-macros-3.0.9.tar.gz
/golist-0.10.1.tar.gz
/go-rpm-macros-3.2.0.tar.gz
/go-rpm-macros-3.6.0.tar.gz
/golist-0.10.4.tar.gz
SOURCES/go-rpm-macros-3.6.0.tar.gz
SOURCES/golist-0.10.4.tar.gz

2
.go-rpm-macros.metadata Normal file
View File

@ -0,0 +1,2 @@
9db262bd1b5acd1c3490d55b839819a878e6659c SOURCES/go-rpm-macros-3.6.0.tar.gz
4a105131658d029fe0b2d312b078a056748af2b4 SOURCES/golist-0.10.4.tar.gz

View File

@ -1,3 +0,0 @@
# go-rpm-macros
The go-rpm-macros package

View File

@ -18,26 +18,25 @@ Version: 3.6.0
# make Go devel packages archful
%global gopath %{_datadir}/gocode
# whether to bundle golist or require it as a dependency
%global bundle_golist 1
%global golist_version 0.10.4
%if 0%{?bundle_golist}
%global golist_builddir golist-%{golist_version}
# do not create debuginfo packages when we add a build section
%global debug_package %{nil}
%global golist_version 0.10.4
%global golist_builddir %{_builddir}/golist-%{golist_version}/_build
%global golist_goipath pagure.io/golist
# where to bundle the golist executable
%global golist_execdir %{_libexecdir}/go-rpm-macros
%global golist_execdir %{_libexecdir}/go-rpm-macros/
# define gobuild to avoid this package requiring itself to build
%undefine _auto_set_build_flags
%global _dwz_low_mem_die_limit 0
%define gobuild(o:) GO111MODULE=on go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${GO_BUILDTAGS-${BUILDTAGS-}}" -a -v -x -ldflags "${GO_LDFLAGS-${LDFLAGS-}} -B 0x$(echo "%{name}-%{version}-%{release}-${SOURCE_DATE_EPOCH:-}" | sha1sum | cut -d ' ' -f1) -compressdwarf=false -linkmode=external -extldflags '%{build_ldflags}'" %{?**};
%else
%global debug_package %{nil}
%define gobuild(o:) GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v %{?**};
%endif
ExclusiveArch: %{golang_arches} %{gccgo_arches}
Name: go-rpm-macros
Release: 7%{?dist}
Release: 3%{?dist}
Summary: Build-stage rpm automation for Go packages
License: GPLv3+
@ -52,7 +51,6 @@ Requires: go-filesystem = %{version}-%{release}
%if 0%{?bundle_golist}
BuildRequires: golang
Provides: bundled(golist) = %{golist_version}
%else
Requires: golist
%endif
@ -144,11 +142,23 @@ done
%if 0%{?bundle_golist}
# Add libexec to PATH
%patch2 -p1
tar -xf %{SOURCE1}
pushd %{golist_builddir}
pushd %{_builddir}
tar -xf %{_sourcedir}/golist-%{golist_version}.tar.gz
cd golist-%{golist_version}
%patch1 -p1
cp %{_builddir}/golist-%{golist_version}/LICENSE %{_builddir}/go-rpm-macros-%{version}/LICENSE-golist
popd
cp %{golist_builddir}/LICENSE LICENSE-golist
# create directory structure for a Go build
if [[ ! -e %{golist_builddir}/bin ]]; then
install -m 0755 -vd %{golist_builddir}/bin
export GOPATH=%{golist_builddir}:${GOPATH:+${GOPATH}:}/usr/share/gocode
fi
if [[ ! -e %{golist_builddir}/src/%{golist_goipath} ]]; then
install -m 0755 -vd %{golist_builddir}/src/pagure.io
ln -sf $(dirname %{golist_builddir}) %{golist_builddir}/src/%{golist_goipath}
fi
%endif
%patch3 -p1
@ -157,22 +167,15 @@ cp %{golist_builddir}/LICENSE LICENSE-golist
%build
# build golist
%if 0%{?bundle_golist}
pushd %{golist_builddir}
go mod init %{golist_goipath} && go mod tidy
pushd %{golist_builddir}/src/%{golist_goipath}
export GOPATH=%{golist_builddir}:${GOPATH:+${GOPATH}:}/usr/share/gocode
for cmd in cmd/* ; do
%gobuild -o bin/$(basename $cmd) ./$cmd
%gobuild -o %{golist_builddir}/bin/$(basename $cmd) %{golist_goipath}/$cmd
done
popd
%endif
%install
install -m 0755 -vd %{buildroot}%{rpmmacrodir}
install -m 0755 -vd %{buildroot}%{_rpmluadir}/fedora/srpm
install -m 0644 -vp rpm/lua/srpm/*lua \
%{buildroot}%{_rpmluadir}/fedora/srpm
%ifarch %{golang_arches} %{gccgo_arches}
# Some of those probably do not work with gcc-go right now
# This is not intentional, but mips is not a primary Fedora architecture
# Patches and PRs are welcome
@ -181,14 +184,20 @@ install -m 0755 -vd %{buildroot}%{gopath}/src
install -m 0755 -vd %{buildroot}%{_spectemplatedir}
install -m 0644 -vp templates/rpm/*spec \
%{buildroot}%{_spectemplatedir}
if ls templates/rpm/*\.spec; then
install -m 0644 -vp templates/rpm/*spec \
%{buildroot}%{_spectemplatedir}
fi
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 bin/* %{buildroot}%{_bindir}
install -m 0644 -vp rpm/macros.d/macros.go-*rpm* \
install -m 0755 -vd %{buildroot}%{rpmmacrodir}
install -m 0644 -vp rpm/macros.d/macros.go-* \
%{buildroot}%{rpmmacrodir}
install -m 0755 -vd %{buildroot}%{_rpmluadir}/fedora/srpm
install -m 0644 -vp rpm/lua/srpm/*lua \
%{buildroot}%{_rpmluadir}/fedora/srpm
install -m 0755 -vd %{buildroot}%{_rpmluadir}/fedora/rpm
install -m 0644 -vp rpm/lua/rpm/*lua \
%{buildroot}%{_rpmluadir}/fedora/rpm
@ -197,50 +206,47 @@ install -m 0644 -vp rpm/fileattrs/*.attr \
%{buildroot}%{_rpmconfigdir}/fileattrs/
install -m 0755 -vp rpm/*\.{prov,deps} \
%{buildroot}%{_rpmconfigdir}/
%else
install -m 0644 -vp rpm/macros.d/macros.go-srpm \
%{buildroot}%{rpmmacrodir}
%endif
%ifarch %{golang_arches}
install -m 0644 -vp rpm/macros.d/macros.go-compilers-golang{,-pie} \
%{buildroot}%{_rpmconfigdir}/macros.d/
install -m 0644 -vp rpm/macros.d/macros.go-compilers-golang \
%{buildroot}%{_rpmconfigdir}/macros.d/macros.go-compiler-golang
%endif
%ifarch %{gccgo_arches}
install -m 0644 -vp rpm/macros.d/macros.go-compilers-gcc \
%{buildroot}%{_rpmconfigdir}/macros.d/
%{buildroot}%{_rpmconfigdir}/macros.d/macros.go-compiler-gcc
%endif
# install golist
%if 0%{?bundle_golist}
install -m 0755 -vd %{buildroot}%{golist_execdir}
install -m 0755 -vp %{golist_builddir}/bin/* %{buildroot}%{golist_execdir}/
sed -i "s,golist ,%{golist_execdir}/golist ,g" \
%{buildroot}%{_bindir}/go-rpm-integration \
%{buildroot}%{_rpmconfigdir}/gosymlink.deps \
%{buildroot}%{_rpmmacrodir}/macros.go-rpm
%endif
%ifarch %{golang_arches} %{gccgo_arches}
%files
%license LICENSE.txt
%if %{defined bundle_golist}
%license LICENSE-golist
%endif
%license LICENSE.txt LICENSE-golist
%doc README.md
%{_bindir}/*
%{_rpmconfigdir}/fileattrs/*.attr
%{_rpmconfigdir}/*.prov
%{_rpmconfigdir}/*.deps
%{_rpmmacrodir}/macros.go-rpm*
%{_rpmmacrodir}/macros.go-compiler*
%{_rpmconfigdir}/macros.d/macros.go-rpm*
%{_rpmconfigdir}/macros.d/macros.go-compiler*
%{_rpmluadir}/fedora/rpm/*.lua
# package golist
%if 0%{?bundle_golist}
%{golist_execdir}/golist
%endif
%files -n go-srpm-macros
%license LICENSE.txt
%doc README.md
%{_rpmconfigdir}/macros.d/macros.go-srpm
%{_rpmluadir}/fedora/srpm/*.lua
%files -n go-filesystem
%dir %{gopath}
%dir %{gopath}/src
%files -n go-rpm-templates
%license LICENSE-templates.txt
@ -250,36 +256,7 @@ sed -i "s,golist ,%{golist_execdir}/golist ,g" \
%dir %{_spectemplatedir}
%{_spectemplatedir}/*.spec
%files -n go-filesystem
%dir %{gopath}
%dir %{gopath}/src
%endif
# we only build go-srpm-macros on all architectures
%files -n go-srpm-macros
%license LICENSE.txt
%doc README.md
%{_rpmmacrodir}/macros.go-srpm
%{_rpmluadir}/fedora/srpm/*.lua
%changelog
* Wed Nov 13 2024 Alejandro Sáez <asm@redhat.com>
- Revert go-rpm-templates to noarch
- Resolves: RHEL-67300
- Related: RHEL-52226
* Wed Nov 06 2024 Alejandro Sáez <asm@redhat.com> - 3.6.0-6
- Add back again ExclusiveArch, it was removed by mistake.
- Resolves: RHEL-52226
* Mon Nov 04 2024 Alejandro Sáez <asm@redhat.com> - 3.6.0-5
- Make golist non optional
- Resolves: RHEL-52226
* Thu Oct 31 2024 Alejandro Sáez <asm@redhat.com> - 3.6.0-4
- Enable debuginfo package
- Resolves: RHEL-52226
* Wed Jul 31 2024 Alejandro Sáez <asm@redhat.com> - 3.6.0-3
- Fix typo in add-gobuild-and-gotest.patch
- Resolves: RHEL-7437

View File

@ -1,6 +0,0 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

View File

@ -1,2 +0,0 @@
SHA512 (go-rpm-macros-3.6.0.tar.gz) = 904406180a1bedb70dd0bacc3794dee7f1ff8e4329230750ef903338f22c2beb995e23f1d647191a4e094860b31933ae7b3acfa35d6ca67aed8c591bdd45c3bb
SHA512 (golist-0.10.4.tar.gz) = 81fc9cdc4cb0fa1b78ade56c60cb2ac0070dcb11130a333e61053a266e2312b03e64a6705415d6d20883ae4f8cd0be57722c93835c3efffdfaeb9330f4cc12ea