mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.9 KiB

  1. #!/bin/bash
  2. #
  3. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  4. #
  5. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  6. # Please add additional copyright information _after_ the line containing
  7. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  8. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  9. #
  10. # ROCK Linux: rock-src/scripts/Create-SrcTar
  11. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  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. A copy of the GNU General Public
  17. # License can be found at Documentation/COPYING.
  18. #
  19. # Many people helped and are helping developing ROCK Linux. Please
  20. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  21. # file for details.
  22. #
  23. # --- ROCK-COPYRIGHT-NOTE-END ---
  24. if [ "$1" == -help ] ; then
  25. echo
  26. echo "Usage: ./scripts/Create-SrcTar [tar-bz2-filename]"
  27. echo
  28. echo " Create a .tar.bz2 file containing the ROCK Linux sources. This script is"
  29. echo " used by the ROCK Linux core developers when releasing snapshots or releases."
  30. echo ; exit
  31. fi
  32. eval "`grep -A 10 '\[BEGIN\]' scripts/parse-config | grep -B 10 '\[END\]'`"
  33. base=${base:-${PWD}}
  34. filename="$base/rock-src-$rockver.tar.bz2"
  35. [ -z "$1" ] || filename="$1"
  36. topld=$( basename $filename )
  37. topld=${topld%.tar.bz2}
  38. echo -n 'Creating source tar ... '
  39. # Create temp source base dir
  40. #
  41. src="`mktemp -d -p $PWD src.srctar.XXXXXXXXXX`"
  42. rm -rf $src/$topld
  43. mkdir -p $src/$topld
  44. #
  45. for x in scripts target misc package architecture Documentation
  46. do
  47. ln -s ../../$x $src/$topld/$x
  48. done
  49. # Create tar file
  50. #
  51. cd $src
  52. tar --use-compress-program=bzip2 --owner root --group root \
  53. --exclude .svn --exclude CVS -cf $filename $topld/*/*
  54. # Done.
  55. #
  56. cd $base
  57. rm -rf $src/
  58. du -sh $filename | tr '\t' ' '