mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
infrastructure: support make tarball for gitlab patch
This patch supports rolling a tarball for a release, as well as doing 'make tag'. Only stuff that's been committed should get incorporated into the tarball. Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
3afbfed9ee
commit
0b719e4f86
2 changed files with 11 additions and 14 deletions
22
Makefile
22
Makefile
|
@ -17,12 +17,9 @@ DIRS=libraries/libapparmor \
|
||||||
profiles \
|
profiles \
|
||||||
tests
|
tests
|
||||||
|
|
||||||
#REPO_URL?=lp:apparmor
|
# with conversion to git, we don't export from the remote
|
||||||
# --per-file-timestamps is failing over SSH, https://bugs.launchpad.net/bzr/+bug/1257078
|
REPO_URL?=git@gitlab.com:apparmor/apparmor.git
|
||||||
REPO_URL?=https://code.launchpad.net/~apparmor-dev/apparmor/master
|
REPO_BRANCH?=master
|
||||||
# alternate possibilities to export from
|
|
||||||
#REPO_URL=.
|
|
||||||
#REPO_URL="bzr+ssh://bazaar.launchpad.net/~sbeattie/+junk/apparmor-dev/"
|
|
||||||
|
|
||||||
COVERITY_DIR=cov-int
|
COVERITY_DIR=cov-int
|
||||||
RELEASE_DIR=apparmor-${VERSION}
|
RELEASE_DIR=apparmor-${VERSION}
|
||||||
|
@ -31,7 +28,9 @@ __SETUP_DIR?=.
|
||||||
# We create a separate version for tags because git can't handle tags
|
# We create a separate version for tags because git can't handle tags
|
||||||
# with embedded ~s in them. No spaces around '-' or they'll get
|
# with embedded ~s in them. No spaces around '-' or they'll get
|
||||||
# embedded in ${VERSION}
|
# embedded in ${VERSION}
|
||||||
TAG_VERSION=$(subst ~,-,${VERSION})
|
# apparmor version tag format 'vX.Y.ZZ'
|
||||||
|
# apparmor branch name format 'apparmor-X.Y'
|
||||||
|
TAG_VERSION="v$(subst ~,-,${VERSION})"
|
||||||
|
|
||||||
# Add exclusion entries arguments for tar here, of the form:
|
# Add exclusion entries arguments for tar here, of the form:
|
||||||
# --exclude dir_to_exclude --exclude other_dir
|
# --exclude dir_to_exclude --exclude other_dir
|
||||||
|
@ -47,7 +46,7 @@ tarball: clean
|
||||||
.PHONY: snapshot
|
.PHONY: snapshot
|
||||||
snapshot: clean
|
snapshot: clean
|
||||||
$(eval REPO_VERSION:=$(shell $(value REPO_VERSION_CMD)))
|
$(eval REPO_VERSION:=$(shell $(value REPO_VERSION_CMD)))
|
||||||
$(eval SNAPSHOT_NAME=apparmor-$(VERSION)~$(REPO_VERSION))
|
$(eval SNAPSHOT_NAME=apparmor-$(VERSION)~$(shell echo $(REPO_VERSION) | cut -d '-' -f 2-))
|
||||||
$(MAKE) export_dir __EXPORT_DIR=${SNAPSHOT_NAME} __REPO_VERSION=${REPO_VERSION} && \
|
$(MAKE) export_dir __EXPORT_DIR=${SNAPSHOT_NAME} __REPO_VERSION=${REPO_VERSION} && \
|
||||||
$(MAKE) setup __SETUP_DIR=${SNAPSHOT_NAME} && \
|
$(MAKE) setup __SETUP_DIR=${SNAPSHOT_NAME} && \
|
||||||
tar ${TAR_EXCLUSIONS} -cvzf ${SNAPSHOT_NAME}.tar.gz ${SNAPSHOT_NAME}
|
tar ${TAR_EXCLUSIONS} -cvzf ${SNAPSHOT_NAME}.tar.gz ${SNAPSHOT_NAME}
|
||||||
|
@ -62,8 +61,8 @@ coverity: snapshot
|
||||||
.PHONY: export_dir
|
.PHONY: export_dir
|
||||||
export_dir:
|
export_dir:
|
||||||
mkdir $(__EXPORT_DIR)
|
mkdir $(__EXPORT_DIR)
|
||||||
/usr/bin/bzr export --per-file-timestamps -r $(__REPO_VERSION) $(__EXPORT_DIR) $(REPO_URL)
|
/usr/bin/git archive --prefix=$(__EXPORT_DIR)/ --format tar $(__REPO_VERSION) | tar xv
|
||||||
echo "$(REPO_URL) $(__REPO_VERSION)" > $(__EXPORT_DIR)/common/.stamp_rev
|
echo "$(REPO_URL) $(REPO_BRANCH) $(__REPO_VERSION)" > $(__EXPORT_DIR)/common/.stamp_rev
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
@ -84,5 +83,4 @@ setup:
|
||||||
|
|
||||||
.PHONY: tag
|
.PHONY: tag
|
||||||
tag:
|
tag:
|
||||||
bzr tag apparmor_${TAG_VERSION}
|
git tag -m 'AppArmor $(VERSION)' -s $(TAG_VERSION)
|
||||||
|
|
||||||
|
|
|
@ -42,10 +42,9 @@ endif
|
||||||
|
|
||||||
define nl
|
define nl
|
||||||
|
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
REPO_VERSION_CMD=[ -x /usr/bin/bzr ] && /usr/bin/bzr version-info --custom --template="{revno}" . 2> /dev/null || awk '{ print $2 }' common/.stamp_rev
|
REPO_VERSION_CMD=[ -x /usr/bin/git ] && /usr/bin/git describe --tags --long --abbrev=16 --match 'v*' 2> /dev/null || awk '{ print $2 }' common/.stamp_rev
|
||||||
|
|
||||||
ifndef PYTHON_VERSIONS
|
ifndef PYTHON_VERSIONS
|
||||||
PYTHON_VERSIONS = $(call map, pathsearch, python2 python3)
|
PYTHON_VERSIONS = $(call map, pathsearch, python2 python3)
|
||||||
|
|
Loading…
Add table
Reference in a new issue