Blame SOURCES/get-upstream-tarball.sh

c88ac0
#!/bin/sh
c88ac0
#
c88ac0
# Mailx's upstream provides only the CVS method of downloading source code.
c88ac0
# This script can be used for downloading the CVS repository and creating
c88ac0
# the tarball.
c88ac0
#
c88ac0
# Usage:  ./get-upstream-tarball.sh
c88ac0
#
c88ac0
# This code is in the public domain; do with it what you wish.
c88ac0
#
c88ac0
# Copyright (C) 2012 Peter Schiffer <pschiffe@redhat.com>
c88ac0
#
c88ac0
c88ac0
newdir=new-upstream-tarball
c88ac0
c88ac0
mkdir $newdir
c88ac0
cd $newdir
c88ac0
c88ac0
# checkout cvs
c88ac0
echo "== Just press Enter =="
c88ac0
cvs -d:pserver:anonymous@nail.cvs.sourceforge.net:/cvsroot/nail login
c88ac0
cvs -d:pserver:anonymous@nail.cvs.sourceforge.net:/cvsroot/nail co nail
c88ac0
c88ac0
# remove CVS folders
c88ac0
rm -rf nail/CVS nail/catd/CVS
c88ac0
c88ac0
# find version in nail/version.c file defined as: #define V "xxx"
c88ac0
ver=$(sed -rn 's/#define\s+V\s+\"([0-9.]+)\"/\1/p' nail/version.c)
c88ac0
c88ac0
mv nail mailx-$ver
c88ac0
tar cJf mailx-$ver.tar.xz mailx-$ver
c88ac0
c88ac0
rm -rf mailx-$ver
c88ac0