From 7a4e7809358548e24a5debb375e6e6a368247f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Aug 2018 12:42:30 +0200 Subject: autopkg: move it back --- autopkg-branch.mk | 24 ++++++++++++++++++++++++ autopkg-head.mk | 21 +++++++++++++++++++++ autopkg-tag.mk | 8 ++++++++ autopkg-tail.mk | 13 +++++++++++++ personal-pkgs-repo/files/autopkg-branch.mk | 24 ------------------------ personal-pkgs-repo/files/autopkg-head.mk | 21 --------------------- personal-pkgs-repo/files/autopkg-tag.mk | 8 -------- personal-pkgs-repo/files/autopkg-tail.mk | 13 ------------- shellrc/Makefile | 2 +- updater-ng/Makefile | 2 +- 10 files changed, 68 insertions(+), 68 deletions(-) create mode 100644 autopkg-branch.mk create mode 100644 autopkg-head.mk create mode 100644 autopkg-tag.mk create mode 100644 autopkg-tail.mk delete mode 100644 personal-pkgs-repo/files/autopkg-branch.mk delete mode 100644 personal-pkgs-repo/files/autopkg-head.mk delete mode 100644 personal-pkgs-repo/files/autopkg-tag.mk delete mode 100644 personal-pkgs-repo/files/autopkg-tail.mk diff --git a/autopkg-branch.mk b/autopkg-branch.mk new file mode 100644 index 0000000..9b587b3 --- /dev/null +++ b/autopkg-branch.mk @@ -0,0 +1,24 @@ +# Autopkg tracking given branch +AUTOPKG_VARIANT:=branch +include $(TOPDIR)/feeds/personal/autopkg-head.mk + +ifndef PKG_SOURCE_BRANCH +$(error You have to define PKG_SOURCE_BRANCH before pkgauto.mk include) +endif + +PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) rev-parse "$(PKG_SOURCE_BRANCH)") +PKG_VERSION:=$(shell git $(GIT_ARGS) describe --abbrev=0 --tags "$(PKG_SOURCE_BRANCH)") + +ifeq ($(PKG_VERSION),) +# Count commits since initial commit. +PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_SOURCE_VERSION)") +# No previous version found (no tag) so we use 9999 instead +PKG_VERSION:=9999 +else +# Count commits since last version tag +PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_VERSION)..$(PKG_SOURCE_VERSION)") +# .9999 is appended to not collide with possible existing package versions in repository +PKG_VERSION:=$(PKG_VERSION:v%=%).9999 +endif + +include $(TOPDIR)/feeds/personal/autopkg-tail.mk diff --git a/autopkg-head.mk b/autopkg-head.mk new file mode 100644 index 0000000..115e1ae --- /dev/null +++ b/autopkg-head.mk @@ -0,0 +1,21 @@ +ifndef AUTOPKG_VARIANT + $(error "Don't include autopkg-head.mk directly!") +endif + +ifndef PKG_NAME +$(error You have to define PKG_NAME before pkgauto.mk include) +endif +ifndef PKG_SOURCE_URL +$(error You have to define PKG_SOURCE_URL before pkgauto.mk include) +endif + +TMP_REPO_PATH=$(DL_DIR)/autopkg/$(PKG_NAME) +GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare + +# Clone/update git history to bare repository +$(shell \ + if [ ! -d "$(TMP_REPO_PATH)" ]; then \ + git clone --mirror "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ + else \ + git $(GIT_ARGS) remote update origin; \ + fi) diff --git a/autopkg-tag.mk b/autopkg-tag.mk new file mode 100644 index 0000000..1524e2c --- /dev/null +++ b/autopkg-tag.mk @@ -0,0 +1,8 @@ +# Autopkg tracking latest version tag +AUTOPKG_VARIANT:=tag +include $(TOPDIR)/feeds/personal/autopkg-head.mk + +PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) tag | grep '^v' | sort | tail -1) +PKG_VERSION:=$(subst v%,%,$(PKG_SOURCE_VERSION)) + +include $(TOPDIR)/feeds/personal/autopkg-tail.mk diff --git a/autopkg-tail.mk b/autopkg-tail.mk new file mode 100644 index 0000000..3b6d104 --- /dev/null +++ b/autopkg-tail.mk @@ -0,0 +1,13 @@ +ifndef AUTOPKG_VARIANT + $(error "Don't include autopkg-tail.mk directly!") +endif + +PKG_SOURCE_PROTO:=git +PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=$(PKG_NAME) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME) + +undefine TMP_REPO_PATH +undefine GIT_ARGS +undefine AUTOPKG_TAIL diff --git a/personal-pkgs-repo/files/autopkg-branch.mk b/personal-pkgs-repo/files/autopkg-branch.mk deleted file mode 100644 index c8791cc..0000000 --- a/personal-pkgs-repo/files/autopkg-branch.mk +++ /dev/null @@ -1,24 +0,0 @@ -# Autopkg tracking given branch -AUTOPKG_VARIANT:=branch -$(call include_mk, autopkg-head.mk) - -ifndef PKG_SOURCE_BRANCH -$(error You have to define PKG_SOURCE_BRANCH before pkgauto.mk include) -endif - -PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) rev-parse "$(PKG_SOURCE_BRANCH)") -PKG_VERSION:=$(shell git $(GIT_ARGS) describe --abbrev=0 --tags "$(PKG_SOURCE_BRANCH)") - -ifeq ($(PKG_VERSION),) -# Count commits since initial commit. -PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_SOURCE_VERSION)") -# No previous version found (no tag) so we use 9999 instead -PKG_VERSION:=9999 -else -# Count commits since last version tag -PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_VERSION)..$(PKG_SOURCE_VERSION)") -# .9999 is appended to not collide with possible existing package versions in repository -PKG_VERSION:=$(PKG_VERSION:v%=%).9999 -endif - -$(call include_mk, autopkg-tail.mk) diff --git a/personal-pkgs-repo/files/autopkg-head.mk b/personal-pkgs-repo/files/autopkg-head.mk deleted file mode 100644 index 115e1ae..0000000 --- a/personal-pkgs-repo/files/autopkg-head.mk +++ /dev/null @@ -1,21 +0,0 @@ -ifndef AUTOPKG_VARIANT - $(error "Don't include autopkg-head.mk directly!") -endif - -ifndef PKG_NAME -$(error You have to define PKG_NAME before pkgauto.mk include) -endif -ifndef PKG_SOURCE_URL -$(error You have to define PKG_SOURCE_URL before pkgauto.mk include) -endif - -TMP_REPO_PATH=$(DL_DIR)/autopkg/$(PKG_NAME) -GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare - -# Clone/update git history to bare repository -$(shell \ - if [ ! -d "$(TMP_REPO_PATH)" ]; then \ - git clone --mirror "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ - else \ - git $(GIT_ARGS) remote update origin; \ - fi) diff --git a/personal-pkgs-repo/files/autopkg-tag.mk b/personal-pkgs-repo/files/autopkg-tag.mk deleted file mode 100644 index 077c7ad..0000000 --- a/personal-pkgs-repo/files/autopkg-tag.mk +++ /dev/null @@ -1,8 +0,0 @@ -# Autopkg tracking latest version tag -AUTOPKG_VARIANT:=tag -$(call include_mk, autopkg-head.mk) - -PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) tag | grep '^v' | sort | tail -1) -PKG_VERSION:=$(subst v%,%,$(PKG_SOURCE_VERSION)) - -$(call include_mk, autopkg-tail.mk) diff --git a/personal-pkgs-repo/files/autopkg-tail.mk b/personal-pkgs-repo/files/autopkg-tail.mk deleted file mode 100644 index 3b6d104..0000000 --- a/personal-pkgs-repo/files/autopkg-tail.mk +++ /dev/null @@ -1,13 +0,0 @@ -ifndef AUTOPKG_VARIANT - $(error "Don't include autopkg-tail.mk directly!") -endif - -PKG_SOURCE_PROTO:=git -PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz -PKG_SOURCE_SUBDIR:=$(PKG_NAME) -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) -HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME) - -undefine TMP_REPO_PATH -undefine GIT_ARGS -undefine AUTOPKG_TAIL diff --git a/shellrc/Makefile b/shellrc/Makefile index 618343e..1c6c5fd 100644 --- a/shellrc/Makefile +++ b/shellrc/Makefile @@ -12,7 +12,7 @@ PKG_RELEASE:=1 PKG_SOURCE_URL:=https://git.cynerd.cz/shellrc PKG_MAINTAINER:=Karel Kočí -$(call include_mk, autopkg-tag.mk) +include $(TOPDIR)/feeds/personal/autopkg-tag.mk include $(INCLUDE_DIR)/package.mk define Package/$(PKG_NAME) diff --git a/updater-ng/Makefile b/updater-ng/Makefile index 5fba9a6..17b8020 100644 --- a/updater-ng/Makefile +++ b/updater-ng/Makefile @@ -14,7 +14,7 @@ PKG_MAINTAINER:=CZ.NIC HOST_BUILD_DEPENDS:=curl/host libevent2/host lua/host PKG_BUILD_DEPENDS:=busybox -$(call include_mk, autopkg-branch.mk) +include $(TOPDIR)/feeds/personal/autopkg-branch.mk include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk include $(TOPDIR)/feeds/packages/lang/python/python-package.mk -- cgit v1.2.3