summaryrefslogtreecommitdiffstats
path: root/cmakemodules/makedist.sh.in
blob: 6df00a56f08ed64ae20b560d9611ec315713d691 (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
37
#!/bin/sh
VERSION=@VERSION@
SRCROOT=@CMAKE_SOURCE_DIR@
BUILDDIR=@CMAKE_BINARY_DIR@
PROJECT=@PROJECT_NAME@
KDESVN_VERSION=@KDESVN_VERSION@

EXCLUDE="@DIST_EXCLUDE@"
EXPORT_DIR="${PROJECT}-${VERSION}"

if [ ! -d ${SRCROOT}/.svn ]; then
    echo "This script must run for a svn dir!"
    exit 1
fi

echo "Exporting source tree"
svn export "${SRCROOT}" ${EXPORT_DIR}

echo "Copy required files to export"
cp ${BUILDDIR}/${PROJECT}.spec ${EXPORT_DIR}
cp ${SRCROOT}/doc/*.cache.bz2 ${EXPORT_DIR}/doc

echo "Removing not needed stuff"
for i in $EXCLUDE ; do
    echo "  $i"
    rm -rf $EXPORT_DIR/$i
done

echo "Generating archive"
tar cjf ${BUILDDIR}/${PROJECT}-${VERSION}.tar.bz2 ${EXPORT_DIR}

echo "Cleaning up"
rm -rf ${EXPORT_DIR}

if [ "x$1" = "xrpm" ]; then
    KDESVN_VERSION=${KDESVN_VERSION} rpmbuild -tb ${BUILDDIR}/${PROJECT}-${VERSION}.tar.bz2
fi