blob: e385d0b7367171628cc5b1bf1aeaaea63366a578 (
plain) (
blame)
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
|
# Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
# Force special prefix for Vespa
%define _prefix /opt/vespa
Name: vespa-base
Version: %version
Release: 1%{?dist}
BuildArch: x86_64
Summary: Vespa common files
Group: Applications/Databases
License: Commercial
URL: http://vespa.ai
Requires: bash
Conflicts: vespa
%description
Common files for Vespa RPMs
%install
lev_dir=%?buildroot%_prefix/libexec/vespa
mkdir -p "$lev_dir"
cp vespabase/src/common-env.sh "${lev_dir}"
chmod 444 "${lev_dir}/common-env.sh"
%clean
rm -rf %buildroot
%pre
getent group vespa >/dev/null || groupadd -r vespa
getent passwd vespa >/dev/null || \
useradd -r -g vespa -d %{_prefix} -s /sbin/nologin \
-c "Create owner of all Vespa data files" vespa
echo "pathmunge %{_prefix}/bin" > /etc/profile.d/vespa.sh
echo "export VESPA_HOME=%{_prefix}" >> /etc/profile.d/vespa.sh
chmod +x /etc/profile.d/vespa.sh
exit 0
%postun
if [ $1 -eq 0 ]; then # this is an uninstallation
rm -f /etc/profile.d/vespa.sh
! getent passwd vespa >/dev/null || userdel vespa
! getent group vespa >/dev/null || groupdel vespa
fi
%files
%defattr(-,vespa,vespa,-)
%_prefix/*
|