[packages/docker-registry] Up to 3.1.1

arekm arekm at pld-linux.org
Thu May 21 15:05:50 CEST 2026


commit 29e3f59640f827cd51a030976cc0a6f251ac8833
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu May 21 15:05:30 2026 +0200

    Up to 3.1.1

 Makefile-version-ldflags.patch | 23 +++++++++++++++++++++++
 docker-registry.spec           | 35 ++++++++++++-----------------------
 2 files changed, 35 insertions(+), 23 deletions(-)
---
diff --git a/docker-registry.spec b/docker-registry.spec
index 7e6f239..72481d6 100644
--- a/docker-registry.spec
+++ b/docker-registry.spec
@@ -1,44 +1,34 @@
-Summary:	Docker Registry 2.0
+Summary:	Docker Registry
 Name:		docker-registry
-Version:	2.5.1
-Release:	2
+Version:	3.1.1
+Release:	1
 License:	Apache v2.0
 Group:		Networking/Daemons
-Source0:	https://github.com/docker/distribution/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	97f16e2b738b1953c5b62a2275f967be
-URL:		https://github.com/docker/distribution
+Source0:	https://github.com/distribution/distribution/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	f7d474c2704e5b872af7789ff158b82f
+URL:		https://github.com/distribution/distribution
 Source1:	%{name}.service
 Source2:	%{name}.sysconfig
 Source3:	%{name}.sysvinit
-BuildRequires:	golang >= 1.5
+Patch0:		Makefile-version-ldflags.patch
+BuildRequires:	golang >= 1.25.0
 BuildRequires:	rpmbuild(macros) >= 1.714
+ExclusiveArch:	%go_arches
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-# go stuff
 %define _enable_debug_packages 0
-%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
-%define import_path	github.com/docker/distribution
 
 %description
 Registry server for Docker (hosting/delivering of repositories and
 images).
 
 %prep
-%setup -qc
-
-# go wants specific directory structure
-# otherwise version override via ldflags does not work
-install -d src/$(dirname %{import_path})
-mv distribution-%{version}/{AUTHORS,*.md} .
-mv distribution-%{version} src/%{import_path}
+%setup -q -n distribution-%{version}
+%patch -P0 -p1
 
 %build
-export GOPATH=$(pwd)
-cd src/%{import_path}
-
 %{__make} binaries \
-	VERSION=v%{version} \
-	DOCKER_BUILDTAGS="include_oss include_gcs"
+	VERSION=v%{version}
 
 v=$(./bin/registry --version)
 v=$(echo "$v" | awk '{print $NF}')
@@ -48,7 +38,6 @@ test "$v" = "v%{version}"
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/docker/registry,%{_bindir}}
 
-cd src/%{import_path}
 install -p bin/* $RPM_BUILD_ROOT%{_bindir}
 cp -p cmd/registry/config-dev.yml $RPM_BUILD_ROOT%{_sysconfdir}/docker/registry/config.yml
 
diff --git a/Makefile-version-ldflags.patch b/Makefile-version-ldflags.patch
new file mode 100644
index 0000000..2630307
--- /dev/null
+++ b/Makefile-version-ldflags.patch
@@ -0,0 +1,23 @@
+Drop the duplicate --ldflags from the bin/ and build rules: the trailing
+'-extldflags "-Wl,-z,now" -s' override clobbers GO_LDFLAGS, so the
+-X .../version.version=$(VERSION) entries never reach the linker and
+registry --version always prints "vX.Y.Z+unknown" regardless of VERSION=.
+--- distribution-3.1.1/Makefile.orig	2026-05-01 17:28:51.000000000 +0200
++++ distribution-3.1.1/Makefile	2026-05-21 01:15:06.163258509 +0200
+@@ -60,14 +60,14 @@
+
+ bin/%: cmd/% FORCE ## build individual binary
+ 	@echo "$(WHALE) $@${BINARY_SUFFIX}"
+-	@go build -buildmode=pie ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} --ldflags '-extldflags "-Wl,-z,now" -s' ${GO_TAGS}  ./$<
++	@go build -buildmode=pie ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} ${GO_TAGS}  ./$<
+
+ binaries: $(BINARIES) ## build binaries
+ 	@echo "$(WHALE) $@"
+
+ build: ## build go packages
+ 	@echo "$(WHALE) $@"
+-	@go build -buildmode=pie ${GO_GCFLAGS} ${GO_BUILD_FLAGS} ${GO_LDFLAGS} --ldflags '-extldflags "-Wl,-z,now" -s' ${GO_TAGS} $(PACKAGES)
++	@go build -buildmode=pie ${GO_GCFLAGS} ${GO_BUILD_FLAGS} ${GO_LDFLAGS} ${GO_TAGS} $(PACKAGES)
+
+ image: ## build docker image IMAGE_NAME=<name>
+ 	docker buildx bake --set "*.tags=${IMAGE_NAME}" image-local
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/docker-registry.git/commitdiff/29e3f59640f827cd51a030976cc0a6f251ac8833



More information about the pld-cvs-commit mailing list