@@ -81,13 +81,12 @@ LIBSECCOMP_COMMIT := release-2.3
81
81
# caller may override in special circumstances if needed.
82
82
GINKGOTIMEOUT ?= -timeout=90m
83
83
84
- RELEASE_VERSION ?= $(shell git fetch --tags && git describe HEAD 2> /dev/null)
85
- RELEASE_NUMBER ?= $(shell echo $(RELEASE_VERSION ) | sed 's/-.* //')
86
- RELEASE_DIST ?= $(shell ( source /etc/os-release; echo $$ID ) )
87
- RELEASE_DIST_VER ?= $(shell ( source /etc/os-release; echo $$VERSION_ID | cut -d '.' -f 1) )
88
- RELEASE_ARCH ?= $(shell go env GOARCH 2> /dev/null)
89
- RELEASE_BASENAME := $(shell basename $(PROJECT ) )
90
-
84
+ RELEASE_VERSION ?= $(shell hack/get_release_info.sh VERSION)
85
+ RELEASE_NUMBER ?= $(shell hack/get_release_info.sh NUMBER)
86
+ RELEASE_DIST ?= $(shell hack/get_release_info.sh DIST)
87
+ RELEASE_DIST_VER ?= $(shell hack/get_release_info.sh DIST_VER)
88
+ RELEASE_ARCH ?= $(shell hack/get_release_info.sh ARCH)
89
+ RELEASE_BASENAME := $(shell hack/get_release_info.sh BASENAME)
91
90
92
91
# If GOPATH not specified, use one in the local directory
93
92
ifeq ($(GOPATH ) ,)
@@ -164,11 +163,9 @@ podman: .gopathok $(PODMAN_VARLINK_DEPENDENCIES) ## Build with podman
164
163
podman-remote : .gopathok $(PODMAN_VARLINK_DEPENDENCIES ) # # Build with podman on remote environment
165
164
$(GO_BUILD ) $(BUILDFLAGS ) -gcflags ' $(GCFLAGS)' -asmflags ' $(ASMFLAGS)' -ldflags ' $(LDFLAGS_PODMAN)' -tags " $( BUILDTAGS) remoteclient" -o bin/$@ $(PROJECT ) /cmd/podman
166
165
167
- podman-remote-darwin : .gopathok $(PODMAN_VARLINK_DEPENDENCIES ) # # Build with podman on remote OSX environment
168
- CGO_ENABLED=0 GOOS=darwin $(GO_BUILD ) -gcflags ' $(GCFLAGS)' -asmflags ' $(ASMFLAGS)' -ldflags ' $(LDFLAGS_PODMAN)' -tags " remoteclient containers_image_openpgp exclude_graphdriver_devicemapper" -o bin/$@ $(PROJECT ) /cmd/podman
169
-
170
- podman-remote-windows : .gopathok $(PODMAN_VARLINK_DEPENDENCIES ) # # Build with podman for a remote windows environment
171
- CGO_ENABLED=0 GOOS=windows $(GO_BUILD ) -gcflags ' $(GCFLAGS)' -asmflags ' $(ASMFLAGS)' -ldflags ' $(LDFLAGS_PODMAN)' -tags " remoteclient containers_image_openpgp exclude_graphdriver_devicemapper" -o bin/$@ .exe $(PROJECT ) /cmd/podman
166
+ podman-remote-% : .gopathok $(PODMAN_VARLINK_DEPENDENCIES ) # # Build podman for a specific GOOS
167
+ $(eval BINSFX := $(shell test "$* " != "windows" || echo ".exe") )
168
+ CGO_ENABLED=0 GOOS=$* $(GO_BUILD ) -gcflags ' $(GCFLAGS)' -asmflags ' $(ASMFLAGS)' -ldflags ' $(LDFLAGS_PODMAN)' -tags " remoteclient containers_image_openpgp exclude_graphdriver_devicemapper" -o bin/$@ $(BINSFX ) $(PROJECT ) /cmd/podman
172
169
173
170
local-cross : $(CROSS_BUILD_TARGETS ) # # Cross local compilation
174
171
@@ -182,8 +179,9 @@ clean: ## Clean artifacts
182
179
rm -rf \
183
180
.gopathok \
184
181
_output \
185
- podman* .zip \
186
- podman* .tar.gz \
182
+ release.txt
183
+ $(wildcard podman-remote* .zip) \
184
+ $(wildcard podman* .tar.gz) \
187
185
bin \
188
186
build \
189
187
docs/remote \
@@ -300,23 +298,6 @@ vagrant-check:
300
298
301
299
binaries : varlink_generate podman podman-remote # # Build podman
302
300
303
- # Zip archives are supported on all platforms + allows embedding metadata
304
- podman.zip : binaries docs
305
- $(eval TMPDIR := $(shell mktemp -d -p '' $@ _XXXX) )
306
- test -n " $( TMPDIR) "
307
- $(MAKE ) install " DESTDIR=$( TMPDIR) " " PREFIX=$( TMPDIR) /usr"
308
- # Encoded RELEASE_INFO format depended upon by CI tooling
309
- # X-RELEASE-INFO format depended upon by CI tooling
310
- cd " $( TMPDIR) " && echo \
311
- " X-RELEASE-INFO: $( RELEASE_BASENAME) $( RELEASE_VERSION) $( RELEASE_DIST) $( RELEASE_DIST_VER) $( RELEASE_ARCH) " | \
312
- zip --recurse-paths --archive-comment " $( CURDIR) /$@ " " ./"
313
- -rm -rf " $( TMPDIR) "
314
-
315
- podman-remote-% .zip : podman-remote-%
316
- # Don't label darwin/windows cros-compiles with local distribution & version
317
- echo " X-RELEASE-INFO: podman-remote $( RELEASE_VERSION) $* cc $( RELEASE_ARCH) " | \
318
- zip --archive-comment "$(CURDIR)/$@" ./bin/$<*
319
-
320
301
install.catatonit :
321
302
./hack/install_catatonit.sh
322
303
@@ -333,19 +314,58 @@ docs: $(MANPAGES) ## Generate documentation
333
314
install-podman-remote-docs : docs
334
315
@ (cd docs; ./podman-remote.sh ./remote)
335
316
317
+ # When publishing releases include critical build-time details
318
+ .PHONY : release.txt
319
+ release.txt :
320
+ # X-RELEASE-INFO format depended upon by automated tooling
321
+ echo -n " X-RELEASE-INFO:" > " $@ "
322
+ for field in " $( RELEASE_BASENAME) " " $( RELEASE_VERSION) " \
323
+ " $( RELEASE_DIST) " " $( RELEASE_DIST_VER) " " $( RELEASE_ARCH) " ; do \
324
+ echo -n " $$ field" ; done >> " $@ "
325
+ echo " " >> " $@ "
326
+
327
+ podman-$(RELEASE_NUMBER ) .tar.gz : binaries docs release.txt
328
+ $(eval TMPDIR := $(shell mktemp -d -p '' podman_XXXX) )
329
+ $(eval SUBDIR := podman-$(RELEASE_NUMBER ) )
330
+ mkdir -p " $( TMPDIR) /$( SUBDIR) "
331
+ $(MAKE ) install.bin install.man install.cni install.systemd " DESTDIR=$( TMPDIR) /$( SUBDIR) " " PREFIX=/usr"
332
+ # release.txt location and content depended upon by automated tooling
333
+ cp release.txt " $( TMPDIR) /"
334
+ tar -czvf $@ --xattrs -C " $( TMPDIR) " " ./release.txt" " ./$( SUBDIR) "
335
+ -rm -rf " $( TMPDIR) "
336
+
337
+ # Must call make in-line: Dependency-spec. w/ wild-card also consumes variable value.
338
+ podman-remote-$(RELEASE_NUMBER ) -% .zip :
339
+ $(MAKE ) podman-remote-$* install-podman-remote-docs release.txt \
340
+ RELEASE_BASENAME=$(shell hack/get_release_info.sh REMOTENAME) \
341
+ RELEASE_DIST=$* RELEASE_DIST_VER=" -"
342
+ $(eval TMPDIR := $(shell mktemp -d -p '' $podman_remote_XXXX) )
343
+ $(eval SUBDIR := podman-$(RELEASE_VERSION ) )
344
+ $(eval BINSFX := $(shell test "$* " != "windows" || echo ".exe") )
345
+ mkdir -p " $( TMPDIR) /$( SUBDIR) "
346
+ # release.txt location and content depended upon by automated tooling
347
+ cp release.txt " $( TMPDIR) /"
348
+ cp ./bin/podman-remote-$* $(BINSFX ) " $( TMPDIR) /$( SUBDIR) /podman$( BINSFX) "
349
+ cp -r ./docs/remote " $( TMPDIR) /$( SUBDIR) /docs/"
350
+ $(eval DOCFILE := $(TMPDIR ) /$(SUBDIR ) /docs/podman.1)
351
+ cp docs/podman-remote.1 " $( DOCFILE) "
352
+ sed -i ' s/podman\\*-remote/podman/g' " $( DOCFILE) "
353
+ sed -i ' s/Podman\\*-remote/Podman\ for\ $*/g' " $( DOCFILE) "
354
+ sed -i ' s/podman\.conf/podman\-remote\.conf/g' " $( DOCFILE) "
355
+ sed -i ' s/A\ remote\ CLI\ for\ Podman\:\ //g' " $( DOCFILE) "
356
+ cd " $( TMPDIR) " && \
357
+ zip --recurse-paths " $( CURDIR) /$@ " " ./release.txt" " ./"
358
+ -rm -rf " $( TMPDIR) "
359
+
360
+ .PHONY : podman-release
361
+ podman-release :
362
+ rm -f release.txt
363
+ $(MAKE ) podman-$(RELEASE_NUMBER ) .tar.gz
336
364
337
- brew-pkg : install-podman-remote-docs podman-remote-darwin
338
- @mkdir -p ./brew
339
- @cp ./bin/podman-remote-darwin ./brew/podman
340
- @cp -r ./docs/remote ./brew/docs/
341
- @cp docs/podman-remote.1 ./brew/docs/podman.1
342
- @cp docs/podman-remote.conf.5 ./brew/docs/podman-remote.conf.5
343
- @sed -i ' s/podman\\*-remote/podman/g' ./brew/docs/podman.1
344
- @sed -i ' s/Podman\\*-remote/Podman\ for\ Mac/g' ./brew/docs/podman.1
345
- @sed -i ' s/podman\.conf/podman\-remote\.conf/g' ./brew/docs/podman.1
346
- @sed -i ' s/A\ remote\ CLI\ for\ Podman\:\ //g' ./brew/docs/podman.1
347
- tar -czvf podman-${RELEASE_NUMBER} .tar.gz ./brew
348
- @rm -rf ./brew
365
+ .PHONY : podman-remote-% -release
366
+ podman-remote-% -release :
367
+ rm -f release.txt
368
+ $(MAKE ) podman-remote-$(RELEASE_NUMBER ) -$* .zip
349
369
350
370
docker-docs : docs
351
371
(cd docs; ./dckrman.sh * .1)
0 commit comments