From d57b1f0fd4b9a72345bab8d3bc92d50cc634e436 Mon Sep 17 00:00:00 2001 From: Thomas Hobson Date: Fri, 19 Feb 2021 16:09:56 +1300 Subject: [PATCH] Python Package example --- packages/Makefile | 22 ++++++++++++++++++++++ packages/python/3.9.1/Makefile | 17 +++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 packages/Makefile create mode 100644 packages/python/3.9.1/Makefile diff --git a/packages/Makefile b/packages/Makefile new file mode 100644 index 0000000..56fba4f --- /dev/null +++ b/packages/Makefile @@ -0,0 +1,22 @@ +LANG_NAME=$(or ${NAME},none) +LANG_VERSION=$(or ${VERSION},0.0.0) +LANG_AUTHOR=$(or ${AUTHOR},HexF ) +LANG_DEPS=$(or ${DEPS}) +LANG_BINARY_FILES=$(or ${BINARY_FILES},) + +${LANG_NAME}-${LANG_VERSION}.pkg.tar.gz: pkg-info.json package.squashfs + tar czvf $@ $* + +package.squashfs: ${LANG_BINARY_FILES} + mksquashfs $* $@ + +%.json: %.jq + jq '$(shell tr '\n' '|' < $<).' <<< "{}" > $@ + +pkg-info.jq: + echo '.language="${LANG_NAME}"' > pkg-info.jq + echo '.version="${LANG_VERSION}"' >> pkg-info.jq + echo '.author="${LANG_AUTHOR}"' >> pkg-info.jq + echo '.dependencies={}' >> pkg-info.jq + $(foreach dep, ${LANG_DEPS}, echo '.dependencies.$(word 1,$(subst =, ,${dep}))="$(word 2,$(subst =, ,${dep}))"' >> pkg-info.jq) + diff --git a/packages/python/3.9.1/Makefile b/packages/python/3.9.1/Makefile new file mode 100644 index 0000000..ebfa3fe --- /dev/null +++ b/packages/python/3.9.1/Makefile @@ -0,0 +1,17 @@ +NAME=python +VERSION=3.9.1 +AUTHOR=Thomas Hobson +DEPS= +BINARY_FILES= + +include ../../Makefile + +bin: + +Python-${VERSION}.tgz: + curl "https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz" -O $@ + +%: %.tgz + tar xzvf $@ + +