source: xplra/mkccclientdist.sh@ 97:28052c8e62c9

Last change on this file since 97:28052c8e62c9 was 79:e35e539c5c9c, checked in by István Váradi <ivaradi@…>, 12 years ago

Added script to create all distributable files

  • Property exe set to *
File size: 2.5 KB
Line 
1#!/bin/bash
2
3set -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
10scriptdir=`dirname $0`
11scriptdir=`cd "${scriptdir}" && pwd`
12
13if test $# -lt 2; then
14 echo "Usage: mkccclientdist.sh <build directory> <target suffix> [<destination directory>]"
15 exit 1
16fi
17
18builddir="${1}"
19installdir="${builddir}/install"
20targetsuffix="${2}"
21destdir="${3:-}"
22if test -z "${destdir}"; then
23 destdir=`pwd`
24fi
25
26tmpdir=`mktemp -d`
27trap "rm -rf $tmpdir" EXIT
28
29# mkdist <dll prefix> <includedir> <libprefix> <pcfile> <m4file>
30mkdist()
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
87echo "Packing VSCPL"
88mkdist vscpl libvscpl hu/varadiistvan/scpl libvscpl vscpl vscpl
89
90echo "Packing XPLCOMMON"
91mkdist xplcommon libxplcommon hu/varadiistvan/xplcommon libxplcommon libxplcommon ""
92
93echo "Packing XPLRA"
94mkdist xplra libxplra hu/varadiistvan/xplra libxplra "" ""
95
96echo "Done."
Note: See TracBrowser for help on using the repository browser.