Debian Codegraph @

debian/dfsg-splitter

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