iw: don't use git on the buildd

Closes: #557167 (Debian BTS, http://bugs.debian.org/557167)
On Fri, 20 Nov 2009 Christoph Biedl wrote:
> during the build, upstream's Makefile calls the shipped version.sh,
> one of the commands there is
> 
> | if head=`git rev-parse --verify HEAD 2>/dev/null`; then
> 
> This is probably a remainder of a upstream's build concept which is
> not included in Debian, as there is also no git repository here, and
> git-core is not in the list of build dependencies.
> 
> If git is not installed, the error is caught and dealt in a sane way.
> However, if git _is_ installed and there's a git repository (read:
> .git directory) anywhere in a parent directory, that one is used.
> Then either the check
> | [ "${descr%%-*}" = "v$VERSION" ] || exit 2
> will very likely fail, thus aborting the build process.  Or, as in my
> case, that repository is owned by a different user, this caused an odd
> error message
> | fatal: unable to create '.git/index.lock': Permission denied
> with the same outcome.
> 
> I suggest to drop that test entirely.

Even though a build conflicts with git/ git-core would be easier by not
requiring a patch to the upstream buildsystem, doing so would be painful
for ongoing maintenance. Therefore remove the bogus for Debian test, as
suggested by Christoph Biedl; unfortunately this patch is not upstreamable.

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>

--- a/version.sh
+++ b/version.sh
@@ -3,21 +3,7 @@
 VERSION="3.1"
 OUT="$1"
 
-if head=`git rev-parse --verify HEAD 2>/dev/null`; then
-	git update-index --refresh --unmerged > /dev/null
-	descr=$(git describe)
-
-	# on git builds check that the version number above
-	# is correct...
-	[ "${descr%%-*}" = "v$VERSION" ] || exit 2
-
-	v="${descr#v}"
-	if git diff-index --name-only HEAD | read dummy ; then
-		v="$v"-dirty
-	fi
-else
-	v="$VERSION"
-fi
+v="$VERSION"
 
 echo '#include "iw.h"' > "$OUT"
 echo "const char iw_version[] = \"$v\";" >> "$OUT"
