OpenSDE Framework (without history before r20070)
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.

65 lines
1.6 KiB

  1. #!/bin/bash
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: scripts/Create-SrcTar
  6. # Copyright (C) 2006 - 2008 The OpenSDE Project
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. # Copyright (C) 1998 - 2003 Clifford Wolf
  9. #
  10. # More information can be found in the files COPYING and README.
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; version 2 of the License. A copy of the
  15. # GNU General Public License can be found in the file COPYING.
  16. # --- SDE-COPYRIGHT-NOTE-END ---
  17. sderootdirs="scripts bin etc lib doc src package architecture target"
  18. sderootfiles="README COPYING"
  19. eval "$( egrep '^sdever=' lib/libsde.in )"
  20. echo -n 'Creating source tar ... '
  21. # Create temp source base dir
  22. #
  23. tmp="`mktemp -d -p $PWD src.srctar.XXXXXXXXXX`"
  24. srctar=opensde-$sdever
  25. [ -d ".svn/" ] && srctar="$srctar-r$( svn info --xml | sed -n -e 's, *revision="\([0-9]*\)".*,\1,p' | head -n 1 )"
  26. rm -rf "$tmp/$srctar"
  27. mkdir -p "$tmp/$srctar"
  28. # Create tar file
  29. #
  30. (
  31. cd "$tmp"
  32. # Directories
  33. #
  34. y=
  35. for x in $sderootdirs; do
  36. ln -s ../../$x "$srctar/$x"
  37. y="$y $srctar/$x/*"
  38. done
  39. #Files
  40. #
  41. for x in $sderootfiles; do
  42. cp ../$x "$tmp/$srctar/$x"
  43. y="$y $srctar/$x"
  44. done
  45. tar --owner root --group root \
  46. --exclude .svn --exclude CVS \
  47. --exclude .git -cO $y
  48. ) | bzip2 -c - > ${1:-$srctar.tar.bz2}.$$
  49. # Done.
  50. #
  51. rm -rf $tmp/
  52. mv ${1:-$srctar.tar.bz2}.$$ ${1:-$srctar.tar.bz2}
  53. du -sh ${1:-$srctar.tar.bz2} | tr '\t' ' '