summaryrefslogtreecommitdiff
path: root/autopkg-common.mk
blob: c539e1ad278e1c509ead679333fe07b8f99f5a19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
ifndef AUTOPKG_VARIANT
	$(error "Don't include autopkg-common.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)


define AUTOPKG_TAIL

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

endef