Skip to content

Commit

Permalink
fix: debian and arch concurrents multiarch builds
Browse files Browse the repository at this point in the history
Signed-off-by: Jorropo <[email protected]>
  • Loading branch information
Jorropo committed Dec 18, 2020
1 parent 5f6fef8 commit 518489a
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -466,35 +466,37 @@ deb_version:
out/minikube_$(DEB_VERSION).deb: out/minikube_$(DEB_VERSION)-0_amd64.deb
cp $< $@

out/minikube_$(DEB_VERSION)-0_%.deb: PACKAGING_DIRECTORY=out/minikube_$(DEB_VERSION)-$*
out/minikube_$(DEB_VERSION)-0_%.deb: out/minikube-linux-%
cp -r installers/linux/deb/minikube_deb_template out/minikube_$(DEB_VERSION)
chmod 0755 out/minikube_$(DEB_VERSION)/DEBIAN
sed -E -i 's/--VERSION--/'$(DEB_VERSION)'/g' out/minikube_$(DEB_VERSION)/DEBIAN/control
sed -E -i 's/--ARCH--/'$*'/g' out/minikube_$(DEB_VERSION)/DEBIAN/control
cp -r installers/linux/deb/minikube_deb_template $(PACKAGING_DIRECTORY)
chmod 0755 $(PACKAGING_DIRECTORY)/DEBIAN
sed -E -i 's/--VERSION--/'$(DEB_VERSION)'/g' $(PACKAGING_DIRECTORY)/DEBIAN/control
sed -E -i 's/--ARCH--/'$*'/g' $(PACKAGING_DIRECTORY)/DEBIAN/control
if [ "$*" = "amd64" ]; then \
sed -E -i 's/--RECOMMENDS--/virtualbox/' out/minikube_$(DEB_VERSION)/DEBIAN/control; \
sed -E -i 's/--RECOMMENDS--/virtualbox/' $(PACKAGING_DIRECTORY)/DEBIAN/control; \
else \
sed -E -i '/Recommends: --RECOMMENDS--/d' out/minikube_$(DEB_VERSION)/DEBIAN/control; \
sed -E -i '/Recommends: --RECOMMENDS--/d' $(PACKAGING_DIRECTORY)/DEBIAN/control; \
fi
mkdir -p out/minikube_$(DEB_VERSION)/usr/bin
cp $< out/minikube_$(DEB_VERSION)/usr/bin/minikube
fakeroot dpkg-deb --build out/minikube_$(DEB_VERSION) $@
rm -rf out/minikube_$(DEB_VERSION)
mkdir -p $(PACKAGING_DIRECTORY)/usr/bin
cp $< $(PACKAGING_DIRECTORY)/usr/bin/minikube
fakeroot dpkg-deb --build $(PACKAGING_DIRECTORY) $@
rm -rf $(PACKAGING_DIRECTORY)

rpm_version:
@echo $(RPM_VERSION)

out/minikube-$(RPM_VERSION).rpm: out/minikube-$(RPM_VERSION)-0.x86_64.rpm
cp $< $@

out/minikube_$(RPM_VERSION)-0_%.deb: PACKAGING_DIRECTORY=out/minikube_$(RPM_VERSION)-$*
out/minikube-$(RPM_VERSION)-0.%.rpm: out/minikube-linux-%
cp -r installers/linux/rpm/minikube_rpm_template out/minikube-$(RPM_VERSION)
sed -E -i 's/--VERSION--/'$(RPM_VERSION)'/g' out/minikube-$(RPM_VERSION)/minikube.spec
sed -E -i 's|--OUT--|'$(PWD)/out'|g' out/minikube-$(RPM_VERSION)/minikube.spec
cp -r installers/linux/rpm/minikube_rpm_template $(PACKAGING_DIRECTORY)
sed -E -i 's/--VERSION--/'$(RPM_VERSION)'/g' $(PACKAGING_DIRECTORY)/minikube.spec
sed -E -i 's|--OUT--|'$(PWD)/out'|g' $(PACKAGING_DIRECTORY)/minikube.spec
rpmbuild -bb -D "_rpmdir $(PWD)/out" --target $* \
out/minikube-$(RPM_VERSION)/minikube.spec
$(PACKAGING_DIRECTORY)/minikube.spec
@mv out/$*/minikube-$(RPM_VERSION)-0.$*.rpm out/ && rmdir out/$*
rm -rf out/minikube-$(RPM_VERSION)
rm -rf $(PACKAGING_DIRECTORY)

.PHONY: apt
apt: out/Release ## Generate apt package file
Expand Down

0 comments on commit 518489a

Please sign in to comment.