summaryrefslogtreecommitdiffstats
path: root/0069-dracut.spec-use-configure.patch
blob: 2d17cca5686e2a708bc2efd364dca42ca45fd0f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
From 1d4b3375431d2d19d511aa5784f2c1ed1e6bbb9e Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Mar 2013 07:16:43 +0100
Subject: [PATCH] dracut.spec: use configure

---
 configure   | 31 ++++++++++++++++++++++++++++---
 dracut.spec | 15 ++++++---------
 2 files changed, 34 insertions(+), 12 deletions(-)

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