dist/redhat: group sub-package preambles together

group sections like `%build` and `%install` together, to improve
the readability of the spec recipe.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
This commit is contained in:
Kefu Chai
2023-11-20 11:56:04 +08:00
parent 3f108629b9
commit 71f352896d

View File

@@ -57,6 +57,17 @@ This package installs all required packages for ScyllaDB, including
%prep
%setup -q -n scylla
%build
%install
%if 0%{housekeeping}
install_arg="--housekeeping"
%endif
./install.sh --packaging --root "$RPM_BUILD_ROOT" $install_arg
%clean
rm -rf $RPM_BUILD_ROOT
%package server
Group: Applications/Databases
Summary: The Scylla database server
@@ -67,14 +78,6 @@ AutoReqProv: no
%description server
This package contains ScyllaDB server.
%build
%install
%if 0%{housekeeping}
install_arg="--housekeeping"
%endif
./install.sh --packaging --root "$RPM_BUILD_ROOT" $install_arg
%pre server
getent group scylla || /usr/sbin/groupadd scylla 2> /dev/null || :
getent passwd scylla || /usr/sbin/useradd -g scylla -s /sbin/nologin -r -d %{_sharedstatedir}/scylla scylla 2> /dev/null || :
@@ -102,9 +105,6 @@ if [ -d /tmp/%{name}-%{version}-%{release} ]; then
fi
ln -sfT /etc/scylla /var/lib/scylla/conf
%clean
rm -rf $RPM_BUILD_ROOT
%files server
%defattr(-,root,root)