summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@verizonmedia.com>2019-03-29 13:50:02 +0100
committerHåkon Hallingstad <hakon@verizonmedia.com>2019-03-29 13:50:02 +0100
commitb358fbe27f1a1c10da84ca8ec05ccaf46c0237a6 (patch)
treef31e5c485ed9d8e31bf35fbe5dcf441a6d91f3a2
parent399a5dc9b483ca40690b940ecebb6fea96cdbc7d (diff)
Support building RPM when "make install" has already been executed
-rw-r--r--dist/vespa.spec9
1 files changed, 8 insertions, 1 deletions
diff --git a/dist/vespa.spec b/dist/vespa.spec
index c902809f60a..4a64e10feca 100644
--- a/dist/vespa.spec
+++ b/dist/vespa.spec
@@ -166,6 +166,7 @@ Vespa - The open big data serving engine
%setup -q
%build
+%if ! 0%{?installdir:1}
%if 0%{?_devtoolset_enable:1}
source %{_devtoolset_enable} || true
%endif
@@ -189,10 +190,16 @@ cmake3 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
.
make %{_smp_mflags}
+%endif
%install
-rm -rf $RPM_BUILD_ROOT
+rm -rf %{buildroot}
+
+%if 0%{?installdir:1}
+cp -r %{installdir} %{buildroot}
+%else
make install DESTDIR=%{buildroot}
+%endif
mkdir -p %{buildroot}/usr/lib/systemd/system
cp %{buildroot}/%{_prefix}/etc/systemd/system/vespa.service %{buildroot}/usr/lib/systemd/system