File releases: create-release.sh

File create-release.sh, 1.7 kB (added by diederik, 12 months ago)

More automated building of the release

Line 
1#!/bin/sh
2
3set -e
4
5# check input
6if [ -z "$1" ]
7then
8  echo "usage: $0 version";
9  exit 1
10fi
11
12# check whether proc is mounted (for autopackage binreloc tests)
13if [ ! -e "/proc/mounts" ]
14then
15  echo "$0: proc not mounted!"
16  exit 1
17fi
18
19# prompt
20niceversion="$1"
21version="${niceversion/\-/}"
22echo "create release kmess-$version [yn] ?";
23read line
24if [ "$line" != "y" ]
25then
26  echo "aborted"
27  exit
28fi
29
30# get svn
31if [ ! -e "kmess-$version/" ]
32then
33  echo "$0: kmess-$version/ not found, downloading from subversion..."
34  rm -Rf kmess-$version/
35  svn checkout "http://kmess.svn.sourceforge.net/svnroot/kmess/branches/kmess/kmess-$version.x/" "kmess-$version/"
36else
37  echo ">>> NOTE: Directory kmess-$version/ already exists, using as source"
38fi
39
40# Simple check whether all files are updated
41echo
42echo ">>> Checking version..."
43for i in configure.in.in Doxyfile kmess.spec kmess.lsm autopackage/default.apspec
44do
45  if ! grep -q "$version\\|$niceversion" "kmess-$version/$i"
46  then
47    echo "warning $0: version not found in kmess-$version/$i"
48    exit;
49  fi
50done
51
52# build source package
53echo ">>> Running automake and friends..."
54make -C "kmess-$version" -f Makefile.dist
55
56echo ">>> Cleaning up to create tarball..."
57rm -Rf "kmess-$version/autom4te.cache"
58#find "kmess-$version/" -depth -name .svn -type d -exec rm -Rf {} \;
59chown -R root:root "kmess-$version"
60rm -f "kmess-$version.tar.gz"
61
62echo ">>> Creating tarball..."
63tar zcf "kmess-$version.tar.gz" --exclude=.svn "kmess-$version/"
64
65# build autopackage
66echo ">>> Building autopackage..."
67cd kmess-$version/
68makeinstaller
69make clean
70mv kmess-$version.x86.package* ..
71cd ..
72
73# build slackware package for klik://
74echo ">>> Building slackware package..."
75rpmbuild -tb "kmess-$version.tar.gz"
76