File: dfsg-splitter

package info (click to toggle)
guile-2.0 2.0.13+1-5.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 27,104 kB
  • sloc: ansic: 133,697; lisp: 67,499; sh: 4,762; makefile: 2,031; perl: 243; awk: 37
file content (97 lines) | stat: -rwxr-xr-x 2,279 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash

set -e
set -x

# Usage: put the relevant guile .tar.gz file into the current
# directory and run the script.  The resulting two orig.tar.gz files
# will be placed into a new ./split-tmp directory.

src_name="guile"
src_ver="1.8.7"
src_dir="${src_name}-${src_ver}"
src_archive="${src_name}-${src_ver}.tar.gz"

deb_pkg_name="guile-1.8"
deb_src_rev="1"

non_main_dir="${src_dir}-non-dfsg"

function copy_to_non_main_dir()
{
  pushd "${src_dir}"
  cp -a --parents "$1" "../${non_main_dir}/"
  popd
}

# assumes someone has already copied file to non-main dir
function copy_to_main_dir()
{
  pushd "${non_main_dir}"
  cp -a --parents "$1" "../${src_dir}/"
  popd
}

if ! test root = "`whoami`"
then
  echo Use fakeroot.
  exit 1
fi

if test -e split-tmp
then
  echo "./split-tmp already exists - aborting"
  exit 1
fi

mkdir ./split-tmp
pushd split-tmp

umask 002

tar xzf "../${src_archive}"
mkdir "${non_main_dir}"

# remove trash
rm "${src_dir}"/srfi/srfi-1.x
rm "${src_dir}"/srfi/srfi-13.x
rm "${src_dir}"/srfi/srfi-14.x
rm "${src_dir}"/srfi/srfi-4.x
rm "${src_dir}"/srfi/srfi-60.x
rm "${src_dir}"/test-suite/standalone/test-asmobs-lib.x
rm "${src_dir}"/test-suite/standalone/test-fast-slot-ref
rm "${src_dir}"/test-suite/standalone/test-use-srfi

# So both sides will have a copy
copy_to_non_main_dir "COPYING.LESSER"
copy_to_non_main_dir "GUILE-VERSION"
copy_to_non_main_dir "LICENSE"
copy_to_non_main_dir "am"
copy_to_non_main_dir "doc/ChangeLog-2008"
copy_to_non_main_dir "doc/Makefile.am"
copy_to_non_main_dir "doc/NEWS"
copy_to_non_main_dir "doc/README"
copy_to_non_main_dir "doc/THANKS"
copy_to_non_main_dir "guile-config/guile.m4"

# verbatim dist only
copy_to_non_main_dir "doc/goops"
rm -r "${src_dir}/doc/goops"

# Files which are not DFSG compliant because they're licensed under
# the GFDL with invariant sections (front and back cover texts are
# also invariant), and files associated with those files.
copy_to_non_main_dir "doc/example-smob"
copy_to_non_main_dir "doc/ref"
rm -r "${src_dir}/doc/example-smob"
rm -r "${src_dir}/doc/ref"

GZIP=-9v tar czpSf \
  "${deb_pkg_name}_${src_ver}+${deb_src_rev}.orig.tar.gz" \
  "${src_dir}"

GZIP=-9v tar czpSf \
  "${deb_pkg_name}-non-dfsg_${src_ver}+${deb_src_rev}.orig.tar.gz" \
  "${non_main_dir}"

exit 0