Refactor and simplify Makefile
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
This commit is contained in:
parent
07d3f19d07
commit
3e9d6db60a
23
Makefile
23
Makefile
|
@ -3,27 +3,22 @@ PKG_VERSION := 3.9.2
|
|||
PKG_OPSI_RELEASE := 1.0
|
||||
PKG_DEB_RELEASE := 1
|
||||
|
||||
# Sources and Checksums can be found on https://www.python.org/downloads/windows/
|
||||
# sources and checksums can be found on https://www.python.org/downloads/windows/
|
||||
SOURCE_FILENAME := python-$(PKG_VERSION)-amd64.exe
|
||||
SOURCE := https://www.python.org/ftp/python/$(PKG_VERSION)/$(SOURCE_FILENAME)
|
||||
CHECKSUM := efb20aa1b648a2baddd949c142d6eb06
|
||||
|
||||
default: fetch-sources patch-fields
|
||||
|
||||
#Variables below are set automatically
|
||||
#DEB_CHANGELOG_VERSION := $(shell dpkg-parsechangelog -S Version | sed -rne 's|((-*[^-]+)+)(-[^-]+)|\1|p')
|
||||
|
||||
# default target
|
||||
BUILDDIR := build
|
||||
$(BUILDDIR): fetch-sources patch-fields
|
||||
$(BUILDDIR):
|
||||
mkdir -p $(BUILDDIR)/data
|
||||
|
||||
create-builddir:
|
||||
[ -d "$(BUILDDIR)/data" ] || mkdir -p $(BUILDDIR)/data
|
||||
|
||||
fetch-sources: create-builddir
|
||||
fetch-sources: $(BUILDDIR)
|
||||
curl -o $(BUILDDIR)/data/$(SOURCE_FILENAME) $(SOURCE)
|
||||
echo "$(CHECKSUM) $(BUILDDIR)/data/$(SOURCE_FILENAME)" | md5sum -c
|
||||
|
||||
patch-fields: create-builddir
|
||||
patch-fields: $(BUILDDIR)
|
||||
sed -e "s|@PKG_VERSION@|$(PKG_VERSION)|" \
|
||||
-e "s|@PKG_OPSI_RELEASE@|$(PKG_OPSI_RELEASE)|" \
|
||||
control.in > $(BUILDDIR)/control
|
||||
|
@ -31,7 +26,6 @@ patch-fields: create-builddir
|
|||
clean:
|
||||
rm -rf $(BUILDDIR)
|
||||
|
||||
|
||||
install: $(BUILDDIR)
|
||||
install -Dm644 $(BUILDDIR)/control -t $(DESTDIR)/srv/deploy/install/$(PKG_NAME)
|
||||
install -Dm644 $(BUILDDIR)/data/* -t $(DESTDIR)/srv/deploy/install/$(PKG_NAME)/data
|
||||
|
@ -44,7 +38,8 @@ uninstall:
|
|||
package:
|
||||
dpkg-buildpackage --unsigned-source --unsigned-changes --no-check-builddeps
|
||||
|
||||
package-check:
|
||||
# DEB_CHANGELOG_VERSION := $(shell dpkg-parsechangelog -S Version | sed -rne 's|((-*[^-]+)+)(-[^-]+)|\1|p')
|
||||
package-check-changelog:
|
||||
@if [ "$(DEB_CHANGELOG_VERSION)" != "$(PKG_FULL_VERSION)" ]; then \
|
||||
echo "Mismatch between debian changelog file and Makefile version"; \
|
||||
echo "Debian changelog version: $(DEB_CHANGELOG_VERSION)"; \
|
||||
|
@ -53,4 +48,4 @@ package-check:
|
|||
fi
|
||||
|
||||
|
||||
.PHONY: create-builddir fetch-sources patch-fields clean install uninstall package package-check
|
||||
.PHONY: default fetch-sources patch-fields clean install uninstall package package-check-changelog
|
||||
|
|
Loading…
Reference in New Issue