home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xmcd-1.4 / misc.d / makerel.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1995-05-10  |  3.7 KB  |  141 lines

  1. #!/bin/sh
  2. #
  3. # @(#)makerel.sh    5.3 94/12/28
  4. #
  5. # Make software binary release
  6. #
  7. #    xmcd  - Motif(tm) CD Audio Player
  8. #    cda   - Command-line CD Audio Player
  9. #
  10. #    Copyright (C) 1995  Ti Kan
  11. #    E-mail: ti@amb.org
  12. #
  13. #    This program is free software; you can redistribute it and/or modify
  14. #    it under the terms of the GNU General Public License as published by
  15. #    the Free Software Foundation; either version 2 of the License, or
  16. #    (at your option) any later version.
  17. #
  18. #    This program is distributed in the hope that it will be useful,
  19. #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21. #    GNU General Public License for more details.
  22. #
  23. #    You should have received a copy of the GNU General Public License
  24. #    along with this program; if not, write to the Free Software
  25. #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26. #
  27.  
  28. # The file containing a list of binary release files
  29. BINLIST=misc.d/BINLIST
  30. VERS=`grep "VERSION=" $BINLIST | sed 's/^.*VERSION=//'`
  31. TMPDIR=/tmp/_makerel.d
  32. ZFILE=xmcdbin.tar.gz
  33. UUEFILE=xmcdbin.uue
  34. COMPRESS=gzip
  35. UNCOMPRESS=gunzip
  36. ENCODE=uuencode
  37. DECODE=uudecode
  38.  
  39. # Use Sysv echo if possible
  40. if [ -x /usr/5bin/echo ]                # SunOS SysV echo
  41. then
  42.     ECHO=/usr/5bin/echo
  43. elif [ -z "`(echo -e a) 2>/dev/null | fgrep e`" ]    # GNU bash, etc.
  44. then
  45.     ECHO="echo -e"
  46. else                            # generic SysV
  47.     ECHO=echo
  48. fi
  49.  
  50. CURDIR=`pwd`
  51. if [ `basename "$CURDIR"` = misc.d ]
  52. then
  53.     cd ..
  54. elif [ ! -f install.sh ]
  55. then
  56.     $ECHO "You must run the makerel.sh script while in the xmcd"
  57.     $ECHO "source code distribution top-level directory or in the"
  58.     $ECHO "misc.d subdirectory."
  59.     exit 1
  60. fi
  61.  
  62. if [ ! -r $BINLIST ]
  63. then
  64.     $ECHO "Error: Cannot open $BINLIST"
  65.     exit 2
  66. fi
  67.  
  68. $ECHO "Creating xmcd/cda version $VERS binary release...\n"
  69.  
  70. trap "rm -rf $TMPDIR $ZFILE $UUEFILE" 1 2 3 5 15
  71.  
  72. # Make temp directory and copy release files to it
  73. rm -rf $TMPDIR
  74. mkdir -p $TMPDIR
  75. for i in `awk '!/^#/ { print $1 }' $BINLIST`
  76. do
  77.     $ECHO "\t$i"
  78.     DEST=`dirname $TMPDIR/$i`
  79.     mkdir -p $DEST >/dev/null 2>&1
  80.     cp $i $DEST
  81. done
  82.  
  83. # Strip the binary symbol tables
  84. strip $TMPDIR/xmcd.d/xmcd >/dev/null 2>&1
  85. strip $TMPDIR/cda.d/cda >/dev/null 2>&1
  86. strip $TMPDIR/wm2xmcd.d/wm2xmcd >/dev/null 2>&1
  87.  
  88. # Remove comment section of binaries if possible
  89. (mcs -da "@(#)xmcd $VERS (C) Ti Kan 1995" $TMPDIR/xmcd.d/xmcd) >/dev/null 2>&1
  90. (mcs -da "@(#)cda $VERS (C) Ti Kan 1995" $TMPDIR/cda.d/cda) >/dev/null 2>&1
  91. (mcs -da "@(#)wm2xmcd $VERS (C) Ti Kan 1995" $TMPDIR/wm2xmcd.d/wm2xmcd) \
  92.     >/dev/null 2>&1
  93.  
  94. $ECHO "\nFixing permissions..."
  95. (cd $TMPDIR; find * -type f -print | xargs chmod 444)
  96.  
  97. $ECHO "\nCreating \"$COMPRESS\"ed tar archive..."
  98. # Create tar archive and compress it
  99. (cd $TMPDIR; tar cf - *) | $COMPRESS >$ZFILE
  100.  
  101. $ECHO "\n\"$ENCODE\"ing..."
  102.  
  103. $ECHO '
  104. Instructions to unpack xmcd v_VERS_ binary and other info
  105. ------------------------------------------------------
  106.  
  107. At the end of this message is a "_COMPRESS_"ed and "_ENCODE_"ed
  108. tar file containing the xmcd, cda and wm2xmcd utility binaries
  109. as well as their supporting files.  To extract, save this
  110. message in a file "_UUEFILE_" and do the following while
  111. logged in as root:
  112.  
  113.     _DECODE_ _UUEFILE_
  114.     _UNCOMPRESS_ < _ZFILE_ | tar xvf -
  115.     sh ./install.sh
  116.  
  117. Be sure to run the "install.sh" script to install and configure
  118. the software.  Otherwise, it will not work properly.
  119.  
  120. See the README file for further information.
  121.  
  122. ' | sed    -e "s/_VERS_/$VERS/g" \
  123.     -e "s/_UUEFILE_/$UUEFILE/g" \
  124.     -e "s/_ZFILE_/$ZFILE/g" \
  125.     -e "s/_COMPRESS_/$COMPRESS/g" \
  126.     -e "s/_UNCOMPRESS_/$UNCOMPRESS/g" \
  127.     -e "s/_ENCODE_/$ENCODE/g" \
  128.     -e "s/_DECODE_/$DECODE/g" >$UUEFILE
  129.  
  130. # Uuencode
  131. $ENCODE $ZFILE $ZFILE >>$UUEFILE
  132. $ECHO "\n\n\n" >>$UUEFILE
  133.  
  134. rm -rf $TMPDIR
  135.  
  136. $ECHO ""
  137. ls -l $ZFILE $UUEFILE
  138.  
  139. exit 0
  140.  
  141.