summaryrefslogtreecommitdiffstats
path: root/libreoffice/build/gensrc_lo42.sh
blob: 1f8f3299dd9c21ff504a27042b882403554e29f6 (plain)
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
#!/bin/bash

PRGNAM=libreoffice
VERSION=4.2.6
SUBVER=.3

STARTINDEX=6

III=$STARTINDEX

echo "# --- Start of section generated by $(basename $0) ---"
echo "# External sources for $PRGNAM-$VERSION$SUBVER"
echo ""

# Two temp files to store download data:
TMP_DLLST=$(mktemp -t lo_XXXXXX)
TMP_FETCH=$(mktemp -t lo_XXXXXX)

# Download necessary data files:
wget -q -O - "http://cgit.freedesktop.org/libreoffice/core/plain/download.lst?id=$(echo $PRGNAM-$VERSION$SUBVER)" > $TMP_DLLST
wget -q -O - "http://cgit.freedesktop.org/libreoffice/core/plain/Makefile.fetch?id=$(echo $PRGNAM-$VERSION$SUBVER)" > $TMP_FETCH

# Get the names of the tarballs we need:
eval $( wget -q -O - "http://cgit.freedesktop.org/libreoffice/core/plain/configure.ac?id=$(echo $PRGNAM-$VERSION$SUBVER)" | grep UNOWINREG_DLL= )
eval $( cat $TMP_DLLST | grep "^export " | grep -v MOZ_ZIP | sed -e 's/^export //' -e 's/ := /=/' )

# Find the download site for a given tarball:
find_url() {
  cat $TMP_FETCH | sed -n "/$1/,/fetch_Download_item/s/^.*fetch_Download_item[^,]*,\([^,]*\),.*$/\1/p"
}

for BALL in UNOWINREG_DLL $( cat $TMP_DLLST | grep "^export " | grep -v MOZ_ZIP | sed -e 's/^export //' -e 's/ := .*$//' ); do

  SRCURL=$(find_url $BALL)
  FILE=$(eval "echo \$$BALL")

  cat <<EOT
SOURCE[$III]="\$SRCDIR/sources42/$FILE"
SRCURL[$III]="$SRCURL/$FILE"

EOT

  III=$(($III+1))

done

echo "# --- End of section generated by $(basename $0) ---"

# Delete the temporary files:
rm -f $TMP_DLLST $TMP_FETCH