Harald Hoyer 4413d3
From 1d4b3375431d2d19d511aa5784f2c1ed1e6bbb9e Mon Sep 17 00:00:00 2001
Harald Hoyer 4413d3
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 4413d3
Date: Wed, 20 Mar 2013 07:16:43 +0100
Harald Hoyer 4413d3
Subject: [PATCH] dracut.spec: use configure
Harald Hoyer 4413d3
Harald Hoyer 4413d3
---
Harald Hoyer 4413d3
 configure   | 31 ++++++++++++++++++++++++++++---
Harald Hoyer 4413d3
 dracut.spec | 15 ++++++---------
Harald Hoyer 4413d3
 2 files changed, 34 insertions(+), 12 deletions(-)
Harald Hoyer 4413d3
Harald Hoyer 4413d3
diff --git a/configure b/configure
Harald Hoyer 4413d3
index 409256b..19b5e1f 100755
Harald Hoyer 4413d3
--- a/configure
Harald Hoyer 4413d3
+++ b/configure
Harald Hoyer 4413d3
@@ -25,6 +25,7 @@ read_arg() {
Harald Hoyer 4413d3
         # return 1 to indicate they should do it instead.
Harald Hoyer 4413d3
         return 1
Harald Hoyer 4413d3
     fi
Harald Hoyer 4413d3
+    return 0
Harald Hoyer 4413d3
 }
Harald Hoyer 4413d3
 
Harald Hoyer 4413d3
 while (($# > 0)); do
Harald Hoyer 4413d3
@@ -36,18 +37,42 @@ while (($# > 0)); do
Harald Hoyer 4413d3
         --sbindir) read_arg sbindir "$@" || shift;;
Harald Hoyer 4413d3
         --mandir) read_arg mandir "$@" || shift;;
Harald Hoyer 4413d3
         --disable-documentation) enable_documentation=no;;
Harald Hoyer 4413d3
+        --program-prefix) read_arg programprefix "$@" || shift;;
Harald Hoyer 4413d3
+        --exec-prefix) read_arg execprefix "$@" || shift;;
Harald Hoyer 4413d3
+        --bindir) read_arg bindir "$@" || shift;;
Harald Hoyer 4413d3
+        --includedir) read_arg includedir "$@" || shift;;
Harald Hoyer 4413d3
+        --libexecdir) read_arg libexecdir "$@" || shift;;
Harald Hoyer 4413d3
+        --localstatedir) read_arg localstatedir "$@" || shift;;
Harald Hoyer 4413d3
+        --sharedstatedir) read_arg sharedstatedir "$@" || shift;;
Harald Hoyer 4413d3
+        --infodir) read_arg infodir "$@" || shift;;
Harald Hoyer 4413d3
+        --systemdsystemunitdir) read_arg systemdsystemunitdir "$@" || shift;;
Harald Hoyer 4413d3
+        --bashcompletiondir) read_arg bashcompletiondir "$@" || shift;;
Harald Hoyer 4413d3
         *) echo "Ignoring unknown option '$1'";;
Harald Hoyer 4413d3
     esac
Harald Hoyer 4413d3
     shift
Harald Hoyer 4413d3
 done
Harald Hoyer 4413d3
 
Harald Hoyer 4413d3
-cat > Makefile.inc.tmp <
Harald Hoyer 4413d3
+cat > Makefile.inc.$$ <
Harald Hoyer 4413d3
 prefix ?= ${prefix}
Harald Hoyer 4413d3
 libdir ?= ${libdir:-${prefix}/lib}
Harald Hoyer 4413d3
 datadir ?= ${datadir:-${prefix}/share}
Harald Hoyer 4413d3
 sysconfdir ?= ${sysconfdir:-${prefix}/etc}
Harald Hoyer 4413d3
 sbindir ?= ${sbindir:-${prefix}/sbin}
Harald Hoyer 4413d3
 mandir ?= ${mandir:-${prefix}/share/man}
Harald Hoyer 4413d3
-enable_documentation ?= ${enable_documentation}
Harald Hoyer 4413d3
+enable_documentation ?= ${enable_documentation:-yes}
Harald Hoyer 4413d3
+bindir ?= ${bindir:-${prefix}/bin}
Harald Hoyer 4413d3
 EOF
Harald Hoyer 4413d3
-mv Makefile.inc.tmp Makefile.inc
Harald Hoyer 4413d3
+
Harald Hoyer 4413d3
+{
Harald Hoyer 4413d3
+    [[ $programprefix ]] && echo "programprefix ?= ${programprefix}"
Harald Hoyer 4413d3
+    [[ $execprefix ]] && echo "execprefix ?= ${execprefix}"
Harald Hoyer 4413d3
+    [[ $includedir ]] && echo "includedir ?= ${includedir}"
Harald Hoyer 4413d3
+    [[ $libexecdir ]] && echo "libexecdir ?= ${libexecdir}"
Harald Hoyer 4413d3
+    [[ $localstatedir ]] && echo "localstatedir ?= ${localstatedir}"
Harald Hoyer 4413d3
+    [[ $sharedstatedir ]] && echo "sharedstatedir ?= ${sharedstatedir}"
Harald Hoyer 4413d3
+    [[ $infodir ]] && echo "infodir ?= ${infodir}"
Harald Hoyer 4413d3
+    [[ $systemdsystemunitdir ]] && echo "systemdsystemunitdir ?= ${systemdsystemunitdir}"
Harald Hoyer 4413d3
+    [[ $bashcompletiondir ]] && echo "bashcompletiondir ?= ${bashcompletiondir}"
Harald Hoyer 4413d3
+} >> Makefile.inc.$$
Harald Hoyer 4413d3
+
Harald Hoyer 4413d3
+mv Makefile.inc.$$ Makefile.inc
Harald Hoyer 4413d3
diff --git a/dracut.spec b/dracut.spec
Harald Hoyer 4413d3
index cd61770..93d497e 100644
Harald Hoyer 4413d3
--- a/dracut.spec
Harald Hoyer 4413d3
+++ b/dracut.spec
Harald Hoyer 4413d3
@@ -194,20 +194,17 @@ git am -p1 %{patches}
Harald Hoyer 4413d3
 %endif
Harald Hoyer 4413d3
 
Harald Hoyer 4413d3
 %build
Harald Hoyer 4413d3
-make all
Harald Hoyer 4413d3
+%configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib
Harald Hoyer 4413d3
+
Harald Hoyer 4413d3
+make %{?_smp_mflags}
Harald Hoyer 4413d3
 
Harald Hoyer 4413d3
 %install
Harald Hoyer 4413d3
 %if 0%{?fedora} || 0%{?rhel}
Harald Hoyer 4413d3
 rm -rf $RPM_BUILD_ROOT
Harald Hoyer 4413d3
 %endif
Harald Hoyer 4413d3
-make install DESTDIR=$RPM_BUILD_ROOT \
Harald Hoyer 4413d3
-     libdir=%{_prefix}/lib \
Harald Hoyer 4413d3
-     bindir=%{_bindir} \
Harald Hoyer 4413d3
-%if %{defined _unitdir}
Harald Hoyer 4413d3
-     systemdsystemunitdir=%{_unitdir} \
Harald Hoyer 4413d3
-%endif
Harald Hoyer 4413d3
-     sysconfdir=/etc mandir=%{_mandir} \
Harald Hoyer 4413d3
-     bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion)
Harald Hoyer 4413d3
+make %{?_smp_mflags} install \
Harald Hoyer 4413d3
+     DESTDIR=$RPM_BUILD_ROOT \
Harald Hoyer 4413d3
+     libdir=%{_prefix}/lib
Harald Hoyer 4413d3
 
Harald Hoyer 4413d3
 echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh
Harald Hoyer 4413d3