build: implement make dist using git-archive
Instead of jumping through hoops to get the ignore list right just use git-archive to get a clean source tarball.
This commit is contained in:
parent
02fdfcc01e
commit
388dbb01c1
|
@ -285,6 +285,14 @@ if(LUADOC_EXECUTABLE)
|
|||
endif()
|
||||
# }}}
|
||||
|
||||
# {{{ dist tarball
|
||||
if(BUILD_FROM_GIT)
|
||||
add_custom_target(dist
|
||||
COMMAND ${SOURCE_DIR}/build-utils/dist.sh ${VERSION}
|
||||
WORKING_DIRECTORY ${SOURCE_DIR})
|
||||
endif()
|
||||
# }}}
|
||||
|
||||
# {{{ Installation.
|
||||
install(TARGETS ${PROJECT_AWE_NAME} ${PROJECT_AWECLIENT_NAME} RUNTIME DESTINATION bin)
|
||||
install(FILES ${AWE_LUA_FILES} DESTINATION ${AWESOME_REL_LUA_LIB_PATH})
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
set(PROJECT_AWE_NAME awesome)
|
||||
set(PROJECT_AWECLIENT_NAME awesome-client)
|
||||
|
||||
set(VERSION 3)
|
||||
# If ${SOURCE_DIR} is a git repository VERSION is set to
|
||||
# `git-describe` later.
|
||||
set(VERSION 3-devel)
|
||||
|
||||
set(VERSION_MAJOR ${VERSION})
|
||||
set(VERSION_MINOR 0)
|
||||
set(VERSION_PATCH 0)
|
||||
|
@ -63,10 +66,8 @@ if(GENERATE_MANPAGES)
|
|||
endif()
|
||||
# }}}
|
||||
|
||||
# {{{ git version stamp
|
||||
# If this is a git repository...
|
||||
if(EXISTS ${SOURCE_DIR}/.git/HEAD)
|
||||
if(GIT_EXECUTABLE)
|
||||
# {{{ version stamp
|
||||
if(EXISTS ${SOURCE_DIR}/.git/HEAD AND GIT_EXECUTABLE)
|
||||
# get current version
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe
|
||||
|
@ -78,7 +79,9 @@ if(EXISTS ${SOURCE_DIR}/.git/HEAD)
|
|||
file(WRITE ${VERSION_STAMP_FILE} ${VERSION})
|
||||
# create a version_stamp target later
|
||||
set(BUILD_FROM_GIT TRUE)
|
||||
endif()
|
||||
else()
|
||||
# get version from version stamp
|
||||
file(READ ${SOURCE_DIR}/.version_stamp VERSION LIMIT 128)
|
||||
endif()
|
||||
# }}}
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# $1 version to package
|
||||
|
||||
set -e
|
||||
|
||||
VERSION=$1
|
||||
git-archive --prefix=dist/awesome-$VERSION/ $VERSION | tar -xf -
|
||||
cd dist
|
||||
echo -n $VERSION > awesome-$VERSION/.version_stamp
|
||||
tar czf awesome-$VERSION.tar.gz awesome-$VERSION
|
Loading…
Reference in New Issue