File: mkunxarc.sh

package info (click to toggle)
putty 0.63-10
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 9,456 kB
  • sloc: ansic: 81,879; objc: 3,115; perl: 2,448; sh: 1,169; python: 913; makefile: 148
file content (77 lines) | stat: -rwxr-xr-x 2,291 bytes parent folder | download | duplicates (2)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash 

# Build a Unix source distribution from the PuTTY CVS area.
#
# Pass an argument of the form `2004-02-08' to have the archive
# tagged as a development snapshot; of the form `0.54' to have it
# tagged as a release; of the form `r1234' to have it tagged as a
# custom build. Otherwise it'll be tagged as unidentified.

case "$1" in
  ????-??-??)
    case "$1" in *[!-0-9]*) echo "Malformed snapshot ID '$1'" >&2;exit 1;;esac
    autoconfver="`cat LATEST.VER`-$1"
    arcsuffix="-$autoconfver"
    ver="-DSNAPSHOT=$1"
    docver=
    ;;
  r*)
    autoconfver="$1"
    arcsuffix="-$autoconfver"
    ver="-DSVN_REV=${1#r}"
    docver=
    ;;
  '')
    autoconfver="X.XX" # got to put something in here!
    arcsuffix=
    ver=
    docver=
    ;;
  *pre)
    set -- "${1%pre}" "$2"
    case "$1" in *[!.0-9a-z~]*) echo "Malformed prerelease ID '$1'">&2;exit 1;;esac
    case "$2" in *[!.0-9a-z~]*) echo "Malformed prerelease revision '$1'">&2;exit 1;;esac
    autoconfver="$1~pre$2"
    arcsuffix="-$autoconfver"
    ver="-DPRERELEASE=$1 -DSVN_REV=$2"
    docver="VERSION=\"PuTTY prerelease $1:r$2\""
    ;;
  *)
    case "$1" in *[!.0-9a-z~]*) echo "Malformed release ID '$1'">&2;exit 1;;esac
    autoconfver="$1"
    arcsuffix="-$autoconfver"
    ver="-DRELEASE=$1"
    docver="VERSION=\"PuTTY release $1\""
    ;;
esac

perl mkfiles.pl
(cd doc && make -s ${docver:+"$docver"})

relver=`cat LATEST.VER`
arcname="putty$arcsuffix"
mkdir uxarc
mkdir uxarc/$arcname
find . -name uxarc -prune -o \
       -name CVS -prune -o \
       -name .svn -prune -o \
       -name . -o \
       -type d -exec mkdir uxarc/$arcname/{} \;
find . -name uxarc -prune -o \
       -name CVS -prune -o \
       -name .cvsignore -prune -o \
       -name .svn -prune -o \
       -name configure.ac -prune -o \
       -name '*.zip' -prune -o \
       -name '*.tar.gz' -prune -o \
       -type f -exec ln -s $PWD/{} uxarc/$arcname/{} \;
if test "x$ver" != "x"; then
  (cd uxarc/$arcname;
   md5sum `find . -name '*.[ch]' -print` > manifest;
   echo "$ver" > version.def)
fi
sed "s/^AC_INIT(putty,.*/AC_INIT(putty, $autoconfver)/" configure.ac > uxarc/$arcname/configure.ac
(cd uxarc/$arcname && sh mkauto.sh) 2>errors || { cat errors >&2; exit 1; }

tar -C uxarc -chzof $arcname.tar.gz $arcname
rm -rf uxarc