From 61cd9e0e8ce467e44cc73b124077882bb0860c17 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 19 Nov 2008 05:26:09 +0000 Subject: [PATCH] 2008-11-19 06:27 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/bin/hb-func.sh * updated OS release version checking for new OpenSuse distros * removed r from uname parameters used in get_hbplatform() function + added support for HB_MK_STATIC=yes|no envvar which allows to control default -static/-shared hbmk switch. It should be set before hb* scripts are created * harbour/harbour.spec * updated OS release version checking for new OpenSuse distros * harbour/mpkg_tgz.sh * changed installer envelope code to not use 'sed' and reenabled it in default builds. Now it should work with different *nixes. Please test. --- harbour/ChangeLog | 16 ++++++++++++++++ harbour/bin/hb-func.sh | 23 +++++++++++++++++------ harbour/harbour.spec | 3 +++ harbour/mpkg_tgz.sh | 7 ++++--- 4 files changed, 40 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f708f57073..4bb4cf661d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,22 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-11-19 06:27 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/bin/hb-func.sh + * updated OS release version checking for new OpenSuse distros + * removed r from uname parameters used in get_hbplatform() function + + added support for HB_MK_STATIC=yes|no envvar which allows to control + default -static/-shared hbmk switch. It should be set before hb* + scripts are created + + * harbour/harbour.spec + * updated OS release version checking for new OpenSuse distros + + * harbour/mpkg_tgz.sh + * changed installer envelope code to not use 'sed' and reenabled it + in default builds. Now it should work with different *nixes. + Please test. + 2008-11-18 13:55 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * make_gcc.sh * common.mak diff --git a/harbour/bin/hb-func.sh b/harbour/bin/hb-func.sh index 981dd178c1..359a44ab06 100755 --- a/harbour/bin/hb-func.sh +++ b/harbour/bin/hb-func.sh @@ -26,11 +26,12 @@ get_hbplatform() [ "${id}" = "" ] && id=`rel=$(rpm -q --queryformat='.%{VERSION}' mandrake-release 2>/dev/null) && echo "mdk$rel"|tr -d "."` [ "${id}" = "" ] && id=`rel=$(rpm -q --queryformat='.%{VERSION}' redhat-release 2>/dev/null) && echo "rh$rel"|tr -d "."` [ "${id}" = "" ] && id=`rel=$(rpm -q --queryformat='.%{VERSION}' fedora-release 2>/dev/null) && echo "fc$rel"|tr -d "."` - [ "${id}" = "" ] && id=`rel=$(rpm -q --queryformat='.%{VERSION}' suse-release 2>/dev/null) && echo "fc$rel"|tr -d "."` + [ "${id}" = "" ] && id=`rel=$(rpm -q --queryformat='.%{VERSION}' suse-release 2>/dev/null) && echo "sus$rel"|tr -d "."` + [ "${id}" = "" ] && id=`rel=$(rpm -q --queryformat='.%{VERSION}' openSUSE-release 2>/dev/null) && echo "sus$rel"|tr -d "."` [ "${id}" = "" ] && id=`rel=$(rpm -q --queryformat='.%{VERSION}' conectiva-release 2>/dev/null) && echo "cl$rel"|tr -d "."` [ "${id}" = "" ] && id=`rel=$(rpm -q --queryformat='.%{VERSION}' aurox-release 2>/dev/null) && echo "cl$rel"|tr -d "."` [ "${id}" = "" ] && id=`[ -f /etc/pld-release ] && cat /etc/pld-release|sed -e '/1/ !d' -e 's/[^0-9]//g' -e 's/^/pld/'` - [ "${id}" = "" ] && id=`uname -sr | tr '[ A-Z]' '[_a-z]'` + [ "${id}" = "" ] && id=`uname -s | tr '[ A-Z]' '[_a-z]'` case "${id}" in mingw*) id="mingw" ;; *) ;; @@ -121,14 +122,24 @@ mk_hbtools() elif [ "${HB_ARCHITECTURE}" = "w32" ]; then hb_tool="$1/${hb_pref}-build" hb_path_separator=":" - hb_static="yes" - hb_static_default=" (default)" + if [ "${HB_MK_STATIC}" != "no" ]; then + hb_static="yes" + hb_static_default=" (default)" + else + hb_static="no" + hb_shared_default=" (default)" + fi hb_exesuf=".exe" else hb_tool="$1/${hb_pref}-build" hb_path_separator=":" - hb_static="no" - hb_shared_default=" (default)" + if [ "${HB_MK_STATIC}" = "yes" ]; then + hb_static="yes" + hb_static_default=" (default)" + else + hb_static="no" + hb_shared_default=" (default)" + fi hb_exesuf="" fi hb_libs=`mk_hbgetlibs "$2"` diff --git a/harbour/harbour.spec b/harbour/harbour.spec index d983d747f3..30ccce0ce8 100644 --- a/harbour/harbour.spec +++ b/harbour/harbour.spec @@ -46,6 +46,8 @@ %if "%{platform}" == "" %define platform %(release=$(rpm -q --queryformat='%{VERSION}' suse-release 2>/dev/null) && echo "sus$release"|tr -d ".") %if "%{platform}" == "" +%define platform %(release=$(rpm -q --queryformat='%{VERSION}' openSUSE-release 2>/dev/null) && echo "sus$release"|tr -d ".") +%if "%{platform}" == "" %define platform %(release=$(rpm -q --queryformat='%{VERSION}' conectiva-release 2>/dev/null) && echo "cl$release"|tr -d ".") %if "%{platform}" == "" %define platform %(release=$(rpm -q --queryformat='%{VERSION}' aurox-release 2>/dev/null) && echo "aur$release"|tr -d ".") @@ -58,6 +60,7 @@ %endif %endif %endif +%endif %define name harbour diff --git a/harbour/mpkg_tgz.sh b/harbour/mpkg_tgz.sh index 342142b283..c287afe481 100755 --- a/harbour/mpkg_tgz.sh +++ b/harbour/mpkg_tgz.sh @@ -23,7 +23,7 @@ hb_platform=`get_hbplatform` [ "${HB_XBUILD}" = "" ] || hb_platform="-${HB_XBUILD}" hb_archfile="${name}-${hb_ver}${hb_platform}.bin.tar.gz" # disabled self extracting shell envelop -# hb_instfile="${name}-${hb_ver}${hb_platform}.inst.sh" +hb_instfile="${name}-${hb_ver}${hb_platform}.inst.sh" hb_lnkso="yes" hb_pref="hb" hb_contrib="" @@ -303,11 +303,12 @@ if [ -n "${hb_instfile}" ]; then fi # In the generated script use tar instead of $TAR because we can't be sure # if $TAR exists in the installation environment + size=`wc -c "${hb_archfile}"|(read size file; echo $size)` cat > "${hb_instfile}" < "${hb_archfile}" + tail -c $size "\$0" > "${hb_archfile}" exit fi if [ \`id -u\` != 0 ]; then @@ -319,7 +320,7 @@ read ASK if [ "\${ASK}" != "y" ] && [ "\${ASK}" != "Y" ]; then exit 1 fi -(sed -e '1,/^HB_INST_EOF\$/ d' "\$0" | gzip -cd | tar ${UNTAR_OPT} - -C /) ${DO_LDCONFIG} +(tail -c $size "\$0" | gzip -cd | (cd /;tar ${UNTAR_OPT} -)) ${DO_LDCONFIG} exit \$? HB_INST_EOF EOF