2002-09-07 05:00:52 +04:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# This script takes the compiled tarball, makes an RPM package and
|
|
|
|
# a patch against the latest released version, then uploads
|
|
|
|
# everything over ssh and removes old snapshots.
|
|
|
|
# Run this script in the directory where mc was built.
|
|
|
|
|
|
|
|
# TODO:
|
|
|
|
# build tarball, select level of testing
|
|
|
|
# (dist, distcheck, warning checks)
|
|
|
|
|
|
|
|
|
2002-10-02 03:00:43 +04:00
|
|
|
# $1 - file to upload, $2 - shell mask to erase
|
2003-11-21 01:07:06 +03:00
|
|
|
upload() {
|
2002-10-02 03:00:43 +04:00
|
|
|
echo "Uploading $1 to $SITE"
|
|
|
|
name="`basename $1`"
|
|
|
|
scp "$1" "$SITE:$DIR/.in.$name"
|
|
|
|
ssh $SITE "rm -f $DIR/$2; mv $DIR/.in.$name $DIR/$name"
|
|
|
|
}
|
|
|
|
|
2002-09-07 05:00:52 +04:00
|
|
|
set -e
|
|
|
|
|
|
|
|
# Version to make patches against.
|
|
|
|
# Make sure to have it unpacked in /usr/src
|
2003-02-05 22:42:14 +03:00
|
|
|
BASE_VERSION="4.6.0"
|
2002-09-07 05:00:52 +04:00
|
|
|
|
2002-09-22 05:41:18 +04:00
|
|
|
# Local directories
|
|
|
|
MC_BASE_DIR="/usr/src/mc-$BASE_VERSION"
|
2002-12-12 19:49:16 +03:00
|
|
|
MC_CVS_DIR="/usr/src/mc"
|
|
|
|
MC_BUILD_DIR="/usr/src/mc.snap"
|
2003-07-23 20:24:57 +04:00
|
|
|
RPM_SRC_DIR="$MC_BUILD_DIR/rpm"
|
2002-09-22 05:41:18 +04:00
|
|
|
|
2002-09-07 05:00:52 +04:00
|
|
|
# Location of the snapshot directory
|
|
|
|
SITE="login.ibiblio.org"
|
2003-06-05 19:57:09 +04:00
|
|
|
DIR="/public/ftp/pub/Linux/utils/file/managers/mc/snapshots"
|
|
|
|
# DIR="/public/html/mc/snapshots"
|
2002-09-07 05:00:52 +04:00
|
|
|
|
2002-12-12 19:49:16 +03:00
|
|
|
cd "$MC_CVS_DIR"
|
|
|
|
cvs up -dPA
|
2002-12-25 03:58:34 +03:00
|
|
|
test -d "$MC_BUILD_DIR" && chmod -R u+rwx "$MC_BUILD_DIR"
|
2002-12-12 19:49:16 +03:00
|
|
|
rm -rf "$MC_BUILD_DIR"
|
|
|
|
cp -a "$MC_CVS_DIR" "$MC_BUILD_DIR"
|
|
|
|
cd "$MC_BUILD_DIR"
|
|
|
|
|
2002-10-09 00:36:00 +04:00
|
|
|
# Sanity check
|
|
|
|
if ! test -f ./autogen.sh || ! test -f src/screen.c; then
|
|
|
|
echo "Not in the MC CVS working directory"
|
|
|
|
exit 1
|
|
|
|
fi
|
2002-09-07 05:00:52 +04:00
|
|
|
|
2002-10-09 00:36:00 +04:00
|
|
|
# Remove old tarballs and build the new one
|
|
|
|
rm -f "mc*.tar.gz"
|
|
|
|
MCVERSION=`date "+%Y-%m-%d-%H" --utc`
|
2004-01-22 09:35:03 +03:00
|
|
|
cp -f configure.ac configure.ac.cvs
|
2002-10-09 00:36:00 +04:00
|
|
|
sed "s/AM_INIT_AUTOMAKE([^)]*)/AM_INIT_AUTOMAKE(mc, $MCVERSION)/" \
|
2004-01-22 09:35:03 +03:00
|
|
|
configure.ac.cvs >configure.ac
|
2002-10-09 00:36:00 +04:00
|
|
|
./autogen.sh
|
|
|
|
make all
|
|
|
|
make distcheck
|
|
|
|
|
|
|
|
# Make sure that the new tarball exists
|
|
|
|
MCTARBALL="mc-$MCVERSION.tar.gz"
|
|
|
|
if test ! -f "$MCTARBALL"; then
|
2002-09-07 05:00:52 +04:00
|
|
|
echo "No tarball found!!!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2002-10-09 00:36:00 +04:00
|
|
|
# Make an RPM package
|
2003-07-23 20:24:57 +04:00
|
|
|
rm -rf $RPM_SRC_DIR
|
|
|
|
mkdir "$RPM_SRC_DIR"
|
|
|
|
mkdir "$RPM_SRC_DIR/BUILD"
|
|
|
|
mkdir "$RPM_SRC_DIR/RPMS"
|
|
|
|
mkdir "$RPM_SRC_DIR/RPMS/i386"
|
|
|
|
mkdir "$RPM_SRC_DIR/SPECS"
|
|
|
|
rpmbuild -tb --define="_topdir $RPM_SRC_DIR" "$MCTARBALL"
|
2003-06-18 09:59:17 +04:00
|
|
|
MC_RPM_VERSION=`echo $MCVERSION | sed s/-//g`
|
|
|
|
MC_RPM=$RPM_SRC_DIR/RPMS/i386/mc-$MC_RPM_VERSION-1.i386.rpm
|
2002-09-07 05:00:52 +04:00
|
|
|
if test ! -f $MC_RPM; then
|
|
|
|
echo "Failed to compile package!!!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Make a patch against the latest released version
|
2002-10-09 00:36:00 +04:00
|
|
|
MC_PATCH="mc-$BASE_VERSION-$MCVERSION.diff"
|
|
|
|
MC_PATCH_BZ2="$MC_PATCH.bz2"
|
2002-09-22 05:41:18 +04:00
|
|
|
if test ! -d $MC_BASE_DIR; then
|
2002-09-07 05:00:52 +04:00
|
|
|
echo "Cannot find unpacked base version!!!"
|
|
|
|
exit 1
|
|
|
|
fi
|
2002-10-09 00:36:00 +04:00
|
|
|
rm -f $MC_PATCH $MC_PATCH_BZ2
|
2002-09-07 05:00:52 +04:00
|
|
|
|
2002-10-02 03:00:43 +04:00
|
|
|
# Don't merge PO-files, we are skipping them in the patch
|
2002-10-24 10:35:26 +04:00
|
|
|
make distdir MSGMERGE=false
|
2002-09-07 05:00:52 +04:00
|
|
|
|
|
|
|
# Sometimes GNU diff returns 1 for unclear reasons
|
2003-02-21 06:00:28 +03:00
|
|
|
diff -urN -x '*.po' -x '*.gmo' $MC_BASE_DIR mc-*/ >$MC_PATCH || :
|
2002-10-09 00:36:00 +04:00
|
|
|
bzip2 $MC_PATCH
|
2002-09-07 05:00:52 +04:00
|
|
|
|
2002-10-02 03:00:43 +04:00
|
|
|
upload "$MCTARBALL" "mc*.tar.gz"
|
|
|
|
upload "$MC_RPM" "mc*.i386.rpm"
|
2002-10-09 00:36:00 +04:00
|
|
|
upload "$MC_PATCH_BZ2" "mc*.diff.bz2"
|
2002-09-07 05:00:52 +04:00
|
|
|
|
|
|
|
echo "Done"
|