forked from veskuh/qmldialer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makedist
executable file
·61 lines (51 loc) · 2 KB
/
makedist
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Determine project name based on current directory
#PROJECT=$(basename $PWD)
PROJECT="meego-handset-dialer"
# NOTE: Don't like this? Then uncomment one of the following as appropriate
#
# Just set it explictly to whatever you like:
# PROJECT=libseaside
#
# Parse it from any Qt *.pro or *.pri files in CWD:
# PROJECT=$(grep -E "TARGET ?= ?" *.pr[io]|cut -d' ' -f3)
# Grab most recent tag from git
TAG=$(git describe --tags --abbrev=0)
# If arg1 is provided, use it as commit/tag/tree-ish id to start
# the archive creation from...
[ "${1}z" != "z" ] && {
TAG=${1}
echo "Creating release starting from: ${TAG}"
}
VERSION=$(git describe --tags ${1})
VERSION=${VERSION//version-/}
VERSION=${VERSION//-g/+}
VERSION=${VERSION//-/+git}
# Set name of toplevel directory for the archive
BASE_PREFIX="${PROJECT}-${VERSION}/"
BRANDING_PREFIX="${PROJECT}-branding-meego-${VERSION}/"
# Set name of resulting release archive file
BASE_ARCHIVE=${PROJECT}-${VERSION}.tar.bz2
BRANDING_ARCHIVE=${PROJECT}-branding-meego-${VERSION}.tar.bz2
# Clean up any existing base package for this version
[ -e ${BASE_ARCHIVE} ] && rm -rf ${BASE_ARCHIVE} &&
echo "Removed: ${BASE_ARCHIVE}"
# Generate the base package release tar ball
# NOTE: Becuase I used a git attribute that ignores the meego theme dir
# this archive will not include it... that's intentional!
git archive --prefix=${BASE_PREFIX} ${TAG} | bzip2 -c -- > ${BASE_ARCHIVE} && {
echo "Created: ${BASE_ARCHIVE}"
} || {
echo "Creation of release archive ${BASE_ARCHIVE} failed. Reason unknown."
}
# Clean up any existing branding package for this version
[ -e ${BRANDING_ARCHIVE} ] && rm -rf ${BRANDING_ARCHIVE} &&
echo "Removed: ${BRANDING_ARCHIVE}"
# Generate the branding package release tar ball
pushd themes > /dev/null
git archive --prefix=${BRANDING_PREFIX} ${TAG} meego/ themes.pro | bzip2 -c -- > ../${BRANDING_ARCHIVE} && {
echo "Created: ${BRANDING_ARCHIVE}"
} || {
echo "Creation of release archive ${BRANDING_ARCHIVE} failed. Reason unknown."
}
popd > /dev/null