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 # Make sure to have it unpacked in /usr/src
25 BASE_VERSION
="4.6.0-pre1"
28 MC_BASE_DIR
="/usr/src/mc-$BASE_VERSION"
29 MC_CVS_DIR
="/usr/src/mc"
30 MC_BUILD_DIR
="/usr/src/mc.snap"
31 RPM_SRC_DIR
="/usr/src/redhat"
33 # Location of the snapshot directory
34 SITE
="login.ibiblio.org"
35 DIR
="/public/ftp/pub/Linux/utils/file/managers/mc/snapshots"
39 rm -rf "$MC_BUILD_DIR"
40 cp -a "$MC_CVS_DIR" "$MC_BUILD_DIR"
44 if ! test -f .
/autogen.sh ||
! test -f src
/screen.c
; then
45 echo "Not in the MC CVS working directory"
49 # Remove old tarballs and build the new one
51 MCVERSION
=`date "+%Y-%m-%d-%H" --utc`
52 cp -f configure.
in configure.
in.cvs
53 sed "s/AM_INIT_AUTOMAKE([^)]*)/AM_INIT_AUTOMAKE(mc, $MCVERSION)/" \
54 configure.
in.cvs
>configure.
in
59 # Make sure that the new tarball exists
60 MCTARBALL
="mc-$MCVERSION.tar.gz"
61 if test ! -f "$MCTARBALL"; then
62 echo "No tarball found!!!"
67 rm -f $RPM_SRC_DIR/RPMS
/i386
/mc-
*.i386.rpm
68 rm -rf $RPM_SRC_DIR/BUILD
/mc-
*/
69 rpmbuild
-tb "$MCTARBALL"
70 MC_RPM
=`echo $RPM_SRC_DIR/RPMS/i386/mc-*.i386.rpm`
71 if test ! -f $MC_RPM; then
72 echo "Failed to compile package!!!"
76 # Make a patch against the latest released version
77 MC_PATCH
="mc-$BASE_VERSION-$MCVERSION.diff"
78 MC_PATCH_BZ2
="$MC_PATCH.bz2"
79 if test ! -d $MC_BASE_DIR; then
80 echo "Cannot find unpacked base version!!!"
83 rm -f $MC_PATCH $MC_PATCH_BZ2
85 # Don't merge PO-files, we are skipping them in the patch
86 make distdir MSGMERGE
=false
88 # Sometimes GNU diff returns 1 for unclear reasons
89 diff -urN -x po
$MC_BASE_DIR mc-
*/ >$MC_PATCH ||
:
92 upload
"$MCTARBALL" "mc*.tar.gz"
93 upload
"$MC_RPM" "mc*.i386.rpm"
94 upload
"$MC_PATCH_BZ2" "mc*.diff.bz2"