File: build.sh

package info (click to toggle)
efte 1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 3,800 kB
  • sloc: cpp: 43,587; ansic: 1,228; makefile: 271; objc: 92; sh: 40
file content (32 lines) | stat: -rw-r--r-- 1,242 bytes parent folder | download | duplicates (3)
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
#!/bin/bash

NAME=efte

VERSIONFILE="../../src/ftever.h"
DEFAULTVERSION="$(sed -n 's/^\#define VERSION *\"//p' $VERSIONFILE |sed 's/\".*$//')"
VERSION=${1:-$DEFAULTVERSION}        # use DEFAULT version if not specified on command line
[[ -z $VERSION ]] && exit 1          # no version, so exit if none specified and none found

BASEPACKNAME=${NAME}-${VERSION}

if [[ -d ${BASEPACKNAME} ]] ; then
  echo "Destination already exists. Previous packages with the same version number"
  echo "will be removed and existing destination will be renamed."
  echo "CTRL-C to abort, ENTER to continue..."
  read
  mv "$BASEPACKNAME"  "${BASEPACKNAME}.$(date +%s)"
  rm -f "$BASEPACKNAME.tar.gz" "$BASEPACKNAME.tar.bz2" "$BASEPACKNAME.zip"
fi

svn co http://$NAME.svn.sourceforge.net/svnroot/$NAME/tags/${BASEPACKNAME} ${BASEPACKNAME} &&
find "$BASEPACKNAME" -type d -name .svn | while read DIR ; do rm -r "$DIR" ; done

tar czf ${BASEPACKNAME}.tar.gz ${BASEPACKNAME}
tar cjf ${BASEPACKNAME}.tar.bz2 ${BASEPACKNAME}
zip -r ${BASEPACKNAME}.zip ${BASEPACKNAME}

echo ""
echo "Upload to SourceForge? CTRL-C to abort, ENTER to continue..."
read
ncftpput upload.sourceforge.net /incoming \
  ${BASEPACKNAME}.tar.bz2 ${BASEPACKNAME}.tar.gz ${BASEPACKNAME}.zip