diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 77f17f7e1..2e4c64535 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -1600,6 +1600,7 @@ isa = PBXNativeTarget; buildConfigurationList = BE11834C0CE160A80002D0F3 /* Build configuration list for PBXNativeTarget "miniupnp" */; buildPhases = ( + A2305097100C0293003FDB0C /* ShellScript */, BE1183440CE160960002D0F3 /* Headers */, BE1183450CE160960002D0F3 /* Sources */, BE1183460CE160960002D0F3 /* Frameworks */, @@ -1826,6 +1827,19 @@ shellPath = /bin/sh; shellScript = "sh update-version-h.sh"; }; + A2305097100C0293003FDB0C /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd ./third-party/miniupnp/\nsh updateminiupnpcstrings.sh"; + }; BE75C3510C729EE100DBEFE0 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/third-party/miniupnp/Makefile.am b/third-party/miniupnp/Makefile.am index cd5e8c7b8..f86497694 100644 --- a/third-party/miniupnp/Makefile.am +++ b/third-party/miniupnp/Makefile.am @@ -20,7 +20,6 @@ noinst_HEADERS = \ minisoap.h \ minissdpc.h \ miniupnpc.h \ - miniupnpcstrings.h \ miniwget.h \ minixml.h \ upnpcommands.h \ diff --git a/third-party/miniupnp/miniupnpcstrings.h b/third-party/miniupnp/miniupnpcstrings.h index 4018b3b22..4c38dd449 100644 --- a/third-party/miniupnp/miniupnpcstrings.h +++ b/third-party/miniupnp/miniupnpcstrings.h @@ -8,7 +8,7 @@ #ifndef __MINIUPNPCSTRINGS_H__ #define __MINIUPNPCSTRINGS_H__ -#define OS_STRING "RedHatEnterpriseClient/5.3" +#define OS_STRING "Darwin/9.7.0" #define MINIUPNPC_VERSION_STRING "1.3" #endif diff --git a/third-party/miniupnp/miniupnpcstrings.h.in b/third-party/miniupnp/miniupnpcstrings.h.in new file mode 100644 index 000000000..be060cc88 --- /dev/null +++ b/third-party/miniupnp/miniupnpcstrings.h.in @@ -0,0 +1,15 @@ +/* $Id: miniupnpcstrings.h.in,v 1.1 2009/07/09 16:13:31 nanard Exp $ */ +/* Project: miniupnp + * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ + * Author: Thomas Bernard + * Copyright (c) 2005-2009 Thomas Bernard + * This software is subjects to the conditions detailed + * in the LICENCE file provided within this distribution */ +#ifndef __MINIUPNPCSTRINGS_H__ +#define __MINIUPNPCSTRINGS_H__ + +#define OS_STRING "OS/version" +#define MINIUPNPC_VERSION_STRING "1.3" + +#endif + diff --git a/third-party/miniupnp/updateminiupnpcstrings.sh b/third-party/miniupnp/updateminiupnpcstrings.sh new file mode 100755 index 000000000..7f05310ac --- /dev/null +++ b/third-party/miniupnp/updateminiupnpcstrings.sh @@ -0,0 +1,37 @@ +#! /bin/sh +# $Id: updateminiupnpcstrings.sh,v 1.3 2009/07/09 16:13:31 nanard Exp $ + +FILE=miniupnpcstrings.h + +# detecting the OS name and version +OS_NAME=`uname -s` +OS_VERSION=`uname -r` +if [ -f /etc/debian_version ]; then + OS_NAME=Debian + OS_VERSION=`cat /etc/debian_version` +fi +# use lsb_release (Linux Standard Base) when available +LSB_RELEASE=`which lsb_release` +if [ 0 -eq $? ]; then + OS_NAME=`${LSB_RELEASE} -i -s` + OS_VERSION=`${LSB_RELEASE} -r -s` + case $OS_NAME in + Debian) + #OS_VERSION=`${LSB_RELEASE} -c -s` + ;; + Ubuntu) + #OS_VERSION=`${LSB_RELEASE} -c -s` + ;; + esac +fi + +echo "Detected OS [$OS_NAME] version [$OS_VERSION]" + +EXPR="s/OS_STRING \".*\"/OS_STRING \"${OS_NAME}\/${OS_VERSION}\"/" +#echo $EXPR +#echo "Backuping $FILE to $FILE.bak." +#cp $FILE $FILE.bak +test -f ${FILE}.in +echo "setting OS_STRING macro value to ${OS_NAME}/${OS_VERSION} in $FILE." +cat ${FILE}.in | sed -e "$EXPR" > $FILE +