File 0003-hdajackretask-Use-autotools.patch of Package alsa-tools

From d06008f39767d6377997c51a3c8eebb2100941f7 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Fri, 13 Apr 2012 11:49:21 +0200
Subject: [PATCH 3/3] hdajackretask: Use autotools

Start to use autotools as build system, just like the other programs
in the alsa-tools suite.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
 hdajackretask/AUTHORS      |    1 +
 hdajackretask/ChangeLog    |    1 +
 hdajackretask/Makefile     |   18 ------------------
 hdajackretask/Makefile.am  |   20 ++++++++++++++++++++
 hdajackretask/NEWS         |    1 +
 hdajackretask/configure.in |   10 ++++++++++
 hdajackretask/gitcompile   |   31 +++++++++++++++++++++++++++++--
 7 files changed, 62 insertions(+), 20 deletions(-)
 create mode 100644 hdajackretask/AUTHORS
 create mode 100644 hdajackretask/ChangeLog
 delete mode 100644 hdajackretask/Makefile
 create mode 100644 hdajackretask/Makefile.am
 create mode 100644 hdajackretask/NEWS
 create mode 100644 hdajackretask/configure.in

diff --git a/hdajackretask/AUTHORS b/hdajackretask/AUTHORS
new file mode 100644
index 0000000..9f136d8
--- /dev/null
+++ b/hdajackretask/AUTHORS
@@ -0,0 +1 @@
+David Henningsson <david.henningsson@canonical.com>
diff --git a/hdajackretask/ChangeLog b/hdajackretask/ChangeLog
new file mode 100644
index 0000000..70c7475
--- /dev/null
+++ b/hdajackretask/ChangeLog
@@ -0,0 +1 @@
+For news and changelog, refer to git repository history. This file is only present because autotools requires it.
diff --git a/hdajackretask/Makefile b/hdajackretask/Makefile
deleted file mode 100644
index c9c4043..0000000
--- a/hdajackretask/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-SOURCES = main-gtk.c sysfs-pin-configs.c apply-changes.c
-
-build:
-	$(shell sed 's/\\/\\\\/g;s/"/\\"/g;s/^/"/;s/$$/\\n"/;' < README > README.generated.h)
-	gcc -g -O0 -Wall -o hda-jack-retask $(SOURCES) $(shell pkg-config --cflags --libs gtk+-3.0) 
-
-clean:
-	-rm hda-jack-retask
-	-rm README.generated.h
-
-install:
-	install -Dm755 hda-jack-retask $(DESTDIR)/usr/bin/hda-jack-retask
-	install -Dm644 README $(DESTDIR)/usr/share/doc/hda-jack-retask/README
-
-uninstall:
-	-rm $(DESTDIR)/usr/bin/hda-jack-retask
-
-.PHONY: build install uninstall
diff --git a/hdajackretask/Makefile.am b/hdajackretask/Makefile.am
new file mode 100644
index 0000000..e0204bc
--- /dev/null
+++ b/hdajackretask/Makefile.am
@@ -0,0 +1,20 @@
+EXTRA_DIST = gitcompile README
+AM_CFLAGS = @GTK3_CFLAGS@
+bin_PROGRAMS = hdajackretask
+man_MANS =
+hdajackretask_SOURCES = main-gtk.c sysfs-pin-configs.c apply-changes.c 
+hdajackretask_LDADD = @GTK3_LIBS@
+
+BUILT_SOURCES = README.generated.h
+nodist_hdajackretask_SOURCES = README.generated.h
+CLEANFILES = README.generated.h
+
+README.generated.h:
+	sed 's/\\/\\\\/g;s/"/\\"/g;s/^/"/;s/$$/\\n"/;' README >$@
+
+alsa-dist: distdir
+	@rm -rf ../distdir/hdajackretask
+	@mkdir -p ../distdir/hdajackretask
+	@cp -RLpv $(distdir)/* ../distdir/hdajackretask
+	@rm -rf $(distdir)
+
diff --git a/hdajackretask/NEWS b/hdajackretask/NEWS
new file mode 100644
index 0000000..70c7475
--- /dev/null
+++ b/hdajackretask/NEWS
@@ -0,0 +1 @@
+For news and changelog, refer to git repository history. This file is only present because autotools requires it.
diff --git a/hdajackretask/configure.in b/hdajackretask/configure.in
new file mode 100644
index 0000000..f839af3
--- /dev/null
+++ b/hdajackretask/configure.in
@@ -0,0 +1,10 @@
+AC_INIT([hdajackretask], [0.20120413])
+AC_CONFIG_SRCDIR([main-gtk.c])
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_HEADER_STDC
+
+PKG_CHECK_MODULES(GTK3, gtk+-3.0)
+
+AC_OUTPUT(Makefile)
diff --git a/hdajackretask/gitcompile b/hdajackretask/gitcompile
index acc8825..10e057c 100755
--- a/hdajackretask/gitcompile
+++ b/hdajackretask/gitcompile
@@ -1,3 +1,30 @@
-#!/bin/sh
+#!/bin/bash
 
-make GITCOMPILE_ARGS="$*"
+if test -z "$AUTOMAKE_DIR"; then
+  if test -d /usr/local/share/automake; then
+    AUTOMAKE_DIR=/usr/local/share/automake
+  fi
+  if test -d /usr/share/automake; then
+    AUTOMAKE_DIR="/usr/share/automake"
+  fi
+  if test -z "$AUTOMAKE_DIR"; then
+    AUTOMAKE_DIR=/usr/share/`ls /usr/share | grep automake | tail -n 1`
+  fi
+fi
+
+for f in install-sh mkinstalldirs missing; do
+  cp -av $AUTOMAKE_DIR/$f . || exit 1
+done
+
+aclocal $ACLOCAL_FLAGS || exit 1
+automake --add-missing --copy || exit 1
+touch depcomp || exit 1
+autoconf || exit 1
+export CFLAGS='-O2 -Wall -pipe -g'
+echo "CFLAGS=$CFLAGS"
+echo "./configure $@"
+./configure $@ || exit 1
+unset CFLAGS
+if [ -z "$GITCOMPILE_NO_MAKE" ]; then
+  make || exit 1
+fi
-- 
1.7.9.2

openSUSE Build Service is sponsored by