dfsg-splitter 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. set -e
  3. set -x
  4. # Usage: put the relevant guile .tar.gz file into the current
  5. # directory and run the script. The resulting two orig.tar.gz files
  6. # will be placed into a new ./split-tmp directory.
  7. src_name="guile"
  8. src_ver="1.8.7"
  9. src_dir="${src_name}-${src_ver}"
  10. src_archive="${src_name}-${src_ver}.tar.gz"
  11. deb_pkg_name="guile-1.8"
  12. deb_src_rev="1"
  13. non_main_dir="${src_dir}-non-dfsg"
  14. function copy_to_non_main_dir()
  15. {
  16. pushd "${src_dir}"
  17. cp -a --parents "$1" "../${non_main_dir}/"
  18. popd
  19. }
  20. # assumes someone has already copied file to non-main dir
  21. function copy_to_main_dir()
  22. {
  23. pushd "${non_main_dir}"
  24. cp -a --parents "$1" "../${src_dir}/"
  25. popd
  26. }
  27. if ! test root = "`whoami`"
  28. then
  29. echo Use fakeroot.
  30. exit 1
  31. fi
  32. if test -e split-tmp
  33. then
  34. echo "./split-tmp already exists - aborting"
  35. exit 1
  36. fi
  37. mkdir ./split-tmp
  38. pushd split-tmp
  39. umask 002
  40. tar xzf "../${src_archive}"
  41. mkdir "${non_main_dir}"
  42. # remove trash
  43. rm "${src_dir}"/srfi/srfi-1.x
  44. rm "${src_dir}"/srfi/srfi-13.x
  45. rm "${src_dir}"/srfi/srfi-14.x
  46. rm "${src_dir}"/srfi/srfi-4.x
  47. rm "${src_dir}"/srfi/srfi-60.x
  48. rm "${src_dir}"/test-suite/standalone/test-asmobs-lib.x
  49. rm "${src_dir}"/test-suite/standalone/test-fast-slot-ref
  50. rm "${src_dir}"/test-suite/standalone/test-use-srfi
  51. # So both sides will have a copy
  52. copy_to_non_main_dir "COPYING.LESSER"
  53. copy_to_non_main_dir "GUILE-VERSION"
  54. copy_to_non_main_dir "LICENSE"
  55. copy_to_non_main_dir "am"
  56. copy_to_non_main_dir "doc/ChangeLog-2008"
  57. copy_to_non_main_dir "doc/Makefile.am"
  58. copy_to_non_main_dir "doc/NEWS"
  59. copy_to_non_main_dir "doc/README"
  60. copy_to_non_main_dir "doc/THANKS"
  61. copy_to_non_main_dir "guile-config/guile.m4"
  62. # verbatim dist only
  63. copy_to_non_main_dir "doc/goops"
  64. rm -r "${src_dir}/doc/goops"
  65. # Files which are not DFSG compliant because they're licensed under
  66. # the GFDL with invariant sections (front and back cover texts are
  67. # also invariant), and files associated with those files.
  68. copy_to_non_main_dir "doc/example-smob"
  69. copy_to_non_main_dir "doc/ref"
  70. rm -r "${src_dir}/doc/example-smob"
  71. rm -r "${src_dir}/doc/ref"
  72. GZIP=-9v tar czpSf \
  73. "${deb_pkg_name}_${src_ver}+${deb_src_rev}.orig.tar.gz" \
  74. "${src_dir}"
  75. GZIP=-9v tar czpSf \
  76. "${deb_pkg_name}-non-dfsg_${src_ver}+${deb_src_rev}.orig.tar.gz" \
  77. "${non_main_dir}"
  78. exit 0