diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-03-08 12:30:53 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2018-03-09 10:51:21 +0000 |
commit | c392384a5cf335afee3b0061066b6d1722af7375 (patch) | |
tree | 88ff19c9205ccfe1a630de1dd90253fab832bf4a /vespabase | |
parent | 561eec383e0171270f7ccdeba8c09735535af7b5 (diff) |
fix spec files
Diffstat (limited to 'vespabase')
-rw-r--r-- | vespabase/vespa-base.spec | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/vespabase/vespa-base.spec b/vespabase/vespa-base.spec new file mode 100644 index 00000000000..7299974d1b0 --- /dev/null +++ b/vespabase/vespa-base.spec @@ -0,0 +1,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: noarch +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/* |