3 # This script takes the compiled tarball, makes an RPM package and
4 # a patch against the latest released version, then uploads
5 # everything over ssh and removes old snapshots.
6 # Run this script in the directory where mc was built.
9 # build tarball, select level of testing
10 # (dist, distcheck, warning checks)
13 # $1 - file to upload, $2 - shell mask to erase
15 echo "Uploading $1 to $SITE"
17 scp
"$1" "$SITE:$DIR/.in.$name"
18 ssh $SITE "rm -f $DIR/$2; mv $DIR/.in.$name $DIR/$name"
23 # Version to make patches against.
24 # The source tree should be available in uncompressed form
27 # Version of the snapshot
28 MCVERSION
=`date "+%Y-%m-%d-%H" --utc`
31 MC_BASE_DIR
="$HOME/src/mc-$BASE_VERSION"
32 MC_CVS_DIR
="$HOME/src/mc"
33 MC_BUILD_DIR
="$HOME/src/mc.snap"
34 RPM_SRC_DIR
="$MC_BUILD_DIR/rpm"
36 # Location of the snapshot directory
37 SITE
="login.ibiblio.org"
38 DIR
="/public/ftp/pub/Linux/utils/file/managers/mc/snapshots"
39 # DIR="/public/html/mc/snapshots"
41 # Command for building RPM
46 test -d "$MC_BUILD_DIR" && chmod -R u
+rwx
"$MC_BUILD_DIR"
47 rm -rf "$MC_BUILD_DIR"
48 cp -a "$MC_CVS_DIR" "$MC_BUILD_DIR"
52 if ! test -f .
/autogen.sh ||
! test -f src
/screen.c
; then
53 echo "Not in the MC CVS working directory"
57 # Remove old tarballs and build the new one
59 cp -f configure.ac configure.ac.cvs
60 sed "s/AM_INIT_AUTOMAKE([^)]*)/AM_INIT_AUTOMAKE(mc, $MCVERSION)/" \
61 configure.ac.cvs
>configure.ac
66 # Make sure that the new tarball exists
67 MCTARBALL
="mc-$MCVERSION.tar.gz"
68 if test ! -f "$MCTARBALL"; then
69 echo "No tarball found!!!"
76 mkdir
"$RPM_SRC_DIR/BUILD"
77 mkdir
"$RPM_SRC_DIR/RPMS"
78 mkdir
"$RPM_SRC_DIR/RPMS/i386"
79 mkdir
"$RPM_SRC_DIR/SPECS"
80 $RPMBUILD -tb --define="_topdir $RPM_SRC_DIR" \
82 MC_RPM_VERSION
=`echo $MCVERSION | sed s/-//g`
83 MC_RPM
=$RPM_SRC_DIR/RPMS
/i386
/mc-
$MC_RPM_VERSION-1.i386.rpm
84 if test ! -f $MC_RPM; then
85 echo "Failed to compile package!!!"
89 # Make a patch against the latest released version
90 MC_PATCH
="mc-$BASE_VERSION-$MCVERSION.diff"
91 MC_PATCH_BZ2
="$MC_PATCH.bz2"
92 if test ! -d $MC_BASE_DIR; then
93 echo "Cannot find unpacked base version!!!"
96 rm -f $MC_PATCH $MC_PATCH_BZ2
98 gzip -cd $MCTARBALL |
tar xf
-
100 # GNU diff should return 0 or 1. 2 means failure or incomplete diff.
101 diff -urN -x '*.gmo' -x pc
$MC_BASE_DIR mc-
$MCVERSION/ >$MC_PATCH ||
test $?
= 1
104 upload
"$MCTARBALL" "mc*.tar.gz"
105 upload
"$MC_RPM" "mc*.i386.rpm"
106 upload
"$MC_PATCH_BZ2" "mc*.diff.bz2"