summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@gmail.com>2019-03-31 21:28:55 +0200
committerGitHub <noreply@github.com>2019-03-31 21:28:55 +0200
commitb012478bd6aed5cf4d2f62854b6d800b8c020b0e (patch)
treea8f33a993924277e4cd64ee83edf4842d9f772ff
parent292ac5dd7395113897f660fd99e1268b58d1d69a (diff)
parent04e9657cd28f4e4e385f998a3849247cacf67a74 (diff)
Merge pull request #8960 from vespa-engine/hakonhall/support-building-rpm-when-make-install-has-already-been-executed
Support building RPM when "make install" has already been executed
-rw-r--r--dist/vespa.spec13
1 files changed, 12 insertions, 1 deletions
diff --git a/dist/vespa.spec b/dist/vespa.spec
index c902809f60a..fd1db572031 100644
--- a/dist/vespa.spec
+++ b/dist/vespa.spec
@@ -163,9 +163,14 @@ Provides: libc.so.6(GLIBC_PRIVATE)(64bit)
Vespa - The open big data serving engine
%prep
+%if 0%{?installdir:1}
+%setup -D -T
+%else
%setup -q
+%endif
%build
+%if ! 0%{?installdir:1}
%if 0%{?_devtoolset_enable:1}
source %{_devtoolset_enable} || true
%endif
@@ -189,10 +194,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