6 echo "Usage: build [fossil configure options]"
7 echo " e.g.: ./build CPPFLAGS=-DFOSSIL_OMIT_DELTA_CKSUM_TEST --with-openssl=/usr/local"
11 mydir
="$(cd "$
(dirname "$0")" && pwd)"
14 CURLOPT
="--fail --location --connect-timeout 15 --speed-limit 10240"
15 CURLOPT0
="$CURLOPT -H 'User-Agent:'"
19 openssl dgst
-md5 < "$1" 2>/dev
/null |
sed -e 's/^[^ ][^ ]* //'
24 openssl dgst
-sha1 < "$1" 2>/dev
/null |
sed -e 's/^[^ ][^ ]* //'
27 FS210
='https://fossil-scm.org/index.html/uv/fossil-src-2.1.tar.gz'
28 FS210_O
='fossil-src-2.1.tar.gz'
30 FS210_MD5
='9f32b23cecb092d42cdf11bf003ebf8d'
31 FS210_SHA1
='7c7387efb4c0016de6e836dba6f7842246825678'
33 GEX
='https://repo.or.cz/git-export-filter.git'
34 GEX_D
='git-export-filter.git'
36 for util
in curl openssl
sed tar patch make git
; do
37 if ! command -v $util > /dev
/null
; then
38 echo Missing
$util >&2
44 checkmd5
="$(getmd5 "$1")"
45 checksha1
="$(getsha1 "$1")"
47 if [ "$FS210_MD5" != "$checkmd5" ]; then
49 echo "Wrong md5 checksum $checkmd5 (expected $FS210_MD5) for $1" >&2
51 if [ "$FS210_SHA1" != "$checksha1" ]; then
53 echo "Wrong sha1 checksum $checksha1 (expected $FS210_SHA1) for $1" >&2
55 if [ -n "$bad" ]; then
56 echo "Checksum verifcation failed for $1" >&2
62 if [ -r "archives/$FS210_O" ] && check_hashes
"archives/$FS210_O"; then
63 FS210_O
="archives/$FS210_O"
65 if ! [ -r "$FS210_O" ]; then
66 echo "Downloading $FS210 to $FS210_O" >&2
67 eval "curl $CURLOPT0 -o '$FS210_O' '$FS210'"
69 check_hashes
"$FS210_O" ||
exit 1
72 if ! [ -r "$FS210_D/Makefile" ]; then
73 echo "Extracting $FS210_O" >&2
77 if ! [ -r "$FS210_D/Makefile.in" ]; then
78 echo "Failed to extract $FS210_O" >&2
81 if ! [ -r "$FS210_D/.patched" ]; then
82 echo "Patching $FS210_D" >&2
83 (cd "$FS210_D" && patch -p1 < ..
/patches
/export_c_patch_diff.txt
)
85 # NOTE: The topo patch makes the result GPL'd
86 (cd "$FS210_D" && patch -p1 < ..
/patches
/export_topo_patch_diff.txt
)
88 patch -f "$FS210_D/VERSION" < patches
/VERSION_patch_diff.txt
89 touch "$FS210_D/.patched"
91 if ! [ -x "$FS210_D/fossil" ]; then
92 echo "Building $FS210_D/fossil" >&2
98 if ! [ -x "$FS210_D/fossil" ]; then
99 echo "Failed to build $FS210_D/fossil" >&2
103 if ! [ -r "$GEX_D/Makefile" ]; then
104 echo "Cloning $GEX" >&2
106 git clone
"$GEX" "$GEX_D"
108 if ! [ -r "$GEX_D/.git/HEAD" ]; then
109 echo "Failed to clone $GEX" >&2
112 if ! [ -x "$GEX_D/git-export-filter" ]; then
113 echo "Building $GEX_D/git-export-filter" >&2
118 if ! [ -x "$GEX_D/git-export-filter" ]; then
119 echo "Failed to build $GEX_D/git-export-filter" >&2
123 if ! [ -x "./fossil" ]; then
125 ln -s "$FS210_D/fossil" .
/fossil
127 if ! [ -x "./git-export-filter" ]; then
128 rm -f .
/git-export-filter
129 ln -s "$GEX_D/git-export-filter" .
/git-export-filter
134 .
/git-export-filter
--version
137 echo "Ready to run import script" >&2