summaryrefslogtreecommitdiff
path: root/debian/tarball.sh
blob: 0f1d51356aa04af00a9406854d2464916d51cf14 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
#
# $Id$
#
# Copyright (C) 2004, 2005 Guillem Jover <guillem@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#

PKG=inetutils
export CVSROOT=":pserver:anonymous@cvs.sv.gnu.org:/sources/$PKG"

set -e

SRCDIR="$PKG-snapshot"

case "$1" in
  snapshot)
    echo "-> getting new snapshot."
#    cvs login
    cvs -z3 co -d $SRCDIR $PKG
    ;;
  update)
    echo "-> updating snapshot."
    cvs -z3 up -dP $SRCDIR
    ;;
esac

if ! [ -e $SRCDIR/libinetutils ]
then
  echo "error: no $PKG source dir available."
  exit 1
fi

echo "-> creating new directory tree."
VERSION=$(grep ^AC_INIT $SRCDIR/configure.ac | \
  sed -e 's/.*, *\[\([^,]*\)\] *,.*/\1/')
SNAPSHOTVERSION="$VERSION+$(date +%Y%m%d)"
TARBALLDIR="$PKG-$SNAPSHOTVERSION"
cp -al $SRCDIR $TARBALLDIR

echo "-> cleaning snapshot."
# Clean non-free stuff
:

# Clean cvs stuff
find $TARBALLDIR -name 'CVS' -o -name '.cvsignore' | xargs rm -rf

echo "-> creating new tarball."
tar czf ${PKG}_$SNAPSHOTVERSION.orig.tar.gz $TARBALLDIR

echo "-> cleaning directory tree."
rm -rf $TARBALLDIR