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