Removing defunct keepalive script and cleaning out dead entries from
[profile/ivi/hfdialer.git] / makedist
1 #!/bin/bash
2
3 # Determine project name based on current directory
4 #PROJECT=$(basename $PWD)
5 PROJECT="tizen-handset-dialer"
6
7 # NOTE: Don't like this?  Then uncomment one of the following as appropriate
8 #
9 # Just set it explictly to whatever you like:
10 # PROJECT=libseaside
11 #
12 # Parse it from any Qt *.pro or *.pri files in CWD:
13 # PROJECT=$(grep -E "TARGET ?= ?" *.pr[io]|cut -d' ' -f3)
14
15 # Grab most recent tag from git
16 TAG=$(git describe --tags --abbrev=0)
17
18 # If arg1 is provided, use it as commit/tag/tree-ish id to start
19 # the archive creation from...
20 [ "${1}z" != "z" ] && {
21         TAG=${1}
22         echo "Creating release starting from: ${TAG}"
23 }
24
25 VERSION=$(git describe --tags ${1})
26 VERSION=${VERSION//version-/}
27 VERSION=${VERSION//-g/+}
28 VERSION=${VERSION//-/+git}
29
30 # Set name of toplevel directory for the archive
31 BASE_PREFIX="${PROJECT}-${VERSION}/"
32 BRANDING_PREFIX="${PROJECT}-branding-tizen-${VERSION}/"
33
34 # Set name of resulting release archive file
35 BASE_ARCHIVE=${PROJECT}-${VERSION}.tar.bz2
36 BRANDING_ARCHIVE=${PROJECT}-branding-tizen-${VERSION}.tar.bz2
37
38 # Clean up any existing base package for this version
39 [ -e ${BASE_ARCHIVE} ] && rm -rf ${BASE_ARCHIVE} &&
40         echo "Removed: ${BASE_ARCHIVE}"
41
42 # Generate the base package release tar ball
43 # NOTE: Becuase I used a git attribute that ignores the tizen theme dir
44 #       this archive will not include it... that's intentional!
45 git archive --prefix=${BASE_PREFIX} ${TAG} | bzip2 -c -- > ${BASE_ARCHIVE} && {
46         echo "Created: ${BASE_ARCHIVE}"
47 } || {
48         echo "Creation of release archive ${BASE_ARCHIVE} failed.  Reason unknown."
49 }
50
51 # Clean up any existing branding package for this version
52 [ -e ${BRANDING_ARCHIVE} ] && rm -rf ${BRANDING_ARCHIVE} &&
53         echo "Removed: ${BRANDING_ARCHIVE}"
54 # Generate the branding package release tar ball
55 pushd themes > /dev/null
56 git archive --prefix=${BRANDING_PREFIX} ${TAG} tizen/ themes.pro | bzip2 -c -- > ../${BRANDING_ARCHIVE} && {
57         echo "Created: ${BRANDING_ARCHIVE}"
58 } || {
59         echo "Creation of release archive ${BRANDING_ARCHIVE} failed.  Reason unknown."
60 }
61 popd > /dev/null