1 | #!/bin/bash
|
---|
2 |
|
---|
3 | set -e -u
|
---|
4 |
|
---|
5 | # Script to create the binary distributions from a build directory produced
|
---|
6 | # by buildall.sh
|
---|
7 | #
|
---|
8 | # Usage: mkccclientdist.sh <build directory> <target suffix> [<destination directory>]
|
---|
9 |
|
---|
10 | scriptdir=`dirname $0`
|
---|
11 | scriptdir=`cd "${scriptdir}" && pwd`
|
---|
12 |
|
---|
13 | if test $# -lt 2; then
|
---|
14 | echo "Usage: mkccclientdist.sh <build directory> <target suffix>"
|
---|
15 | exit 1
|
---|
16 | fi
|
---|
17 |
|
---|
18 | builddir="${1}"
|
---|
19 | installdir="${builddir}/install"
|
---|
20 | targetsuffix="${2}"
|
---|
21 | destdir="${3:-}"
|
---|
22 | if test -z "${destdir}"; then
|
---|
23 | destdir=`pwd`
|
---|
24 | fi
|
---|
25 |
|
---|
26 | tmpdir=`mktemp -d`
|
---|
27 | trap "rm -rf $tmpdir" EXIT
|
---|
28 |
|
---|
29 | # mkdist <dll prefix> <includedir> <libprefix> <pcfile> <m4file>
|
---|
30 | mkdist()
|
---|
31 | {
|
---|
32 | local buildsubdir="${1}"
|
---|
33 | local dllprefix="${2}"
|
---|
34 | local includedir="${3}"
|
---|
35 | local libprefix="${4}"
|
---|
36 | local pcfile="${5:-}"
|
---|
37 | local m4file="${6:-}"
|
---|
38 |
|
---|
39 | rm -rf "${tmpdir}"
|
---|
40 |
|
---|
41 | if test -f "${installdir}/bin/${dllprefix}"*.dll; then
|
---|
42 | mkdir -p "${tmpdir}/bin"
|
---|
43 | cp -a "${installdir}/bin/${dllprefix}"*.dll "${tmpdir}/bin"
|
---|
44 | fi
|
---|
45 |
|
---|
46 | local includeparentdir=`dirname "${includedir}"`
|
---|
47 |
|
---|
48 | mkdir -p "${tmpdir}/include/${includeparentdir}"
|
---|
49 | cp -a "${installdir}/include/${includedir}" "${tmpdir}/include/${includeparentdir}"
|
---|
50 |
|
---|
51 | if test "${pcfile}"; then
|
---|
52 | mkdir -p "${tmpdir}/lib/pkgconfig"
|
---|
53 | else
|
---|
54 | mkdir -p "${tmpdir}/lib"
|
---|
55 | fi
|
---|
56 | cp -a "${installdir}/lib/${libprefix}"* "${tmpdir}/lib"
|
---|
57 | if test "${pcfile}"; then
|
---|
58 | cp -a "${installdir}/lib/pkgconfig/${pcfile}.pc" "${tmpdir}/lib/pkgconfig"
|
---|
59 | fi
|
---|
60 |
|
---|
61 | if test "${m4file}"; then
|
---|
62 | mkdir -p "${tmpdir}/share/aclocal"
|
---|
63 | cp -a "${installdir}/share/aclocal/${m4file}.m4" "${tmpdir}/share/aclocal"
|
---|
64 | fi
|
---|
65 |
|
---|
66 | local version=`cat "${builddir}/${buildsubdir}/config.status" | grep 'S\["PACKAGE_VERSION"\]=' | sed 's:S\["PACKAGE_VERSION"]="\([^"]*\)":\1:'`
|
---|
67 | local targetfile="${destdir}/${buildsubdir}-${version}-${targetsuffix}"
|
---|
68 | rm -f "${targetfile}"
|
---|
69 |
|
---|
70 | cd "${tmpdir}"
|
---|
71 |
|
---|
72 | case "${targetfile}" in
|
---|
73 | *.zip)
|
---|
74 | zip -q -r "${targetfile}" *
|
---|
75 | ;;
|
---|
76 | *.tar.gz)
|
---|
77 | tar czf "${targetfile}" *
|
---|
78 | ;;
|
---|
79 | *.tar.bz2)
|
---|
80 | tar cjf "${targetfile}" *
|
---|
81 | ;;
|
---|
82 | esac
|
---|
83 | }
|
---|
84 |
|
---|
85 | #---------------------------------------
|
---|
86 |
|
---|
87 | echo "Packing VSCPL"
|
---|
88 | mkdist vscpl libvscpl hu/varadiistvan/scpl libvscpl vscpl vscpl
|
---|
89 |
|
---|
90 | echo "Packing XPLCOMMON"
|
---|
91 | mkdist xplcommon libxplcommon hu/varadiistvan/xplcommon libxplcommon libxplcommon ""
|
---|
92 |
|
---|
93 | echo "Packing XPLRA"
|
---|
94 | mkdist xplra libxplra hu/varadiistvan/xplra libxplra "" ""
|
---|
95 |
|
---|
96 | echo "Done."
|
---|