Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Improve RPM directory handling to facilitate upgrades an package reinstallation #329

Merged
merged 6 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packaging/buildrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ mkdir -p target/rpm/SOURCES/${PACKAGE_NAME}-VERSION/opt/stackable/${PACKAGE_NAME
# Create config directory and copy config file template over
mkdir -p target/rpm/SOURCES/${PACKAGE_NAME}-VERSION/etc/stackable/${PACKAGE_NAME}
cp packaging/config/agent.conf target/rpm/SOURCES/${PACKAGE_NAME}-VERSION/etc/stackable/${PACKAGE_NAME}
mkdir target/rpm/SOURCES/${PACKAGE_NAME}-VERSION/etc/stackable/${PACKAGE_NAME}/secret
mkdir -p target/rpm/SOURCES/${PACKAGE_NAME}-VERSION/var/lib/stackable/${PACKAGE_NAME}
mkdir -p target/rpm/SOURCES/${PACKAGE_NAME}-VERSION/var/log/stackable/servicelogs
mkdir -p target/rpm/SOURCES/${PACKAGE_NAME}-VERSION/opt/stackable/packages

# The packaging source directory does not contain the version yet, as this will need to be replaced for every
# execution. Instead the directory name contains the marker "VERSION" which we now replace with the actual version.
Expand Down
13 changes: 7 additions & 6 deletions packaging/rpm/SPECS/stackable-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ cp -a * %{buildroot}

%post
systemctl daemon-reload
mkdir -p /opt/stackable/packages
mkdir -p %{_vardir}
mkdir -p /var/log/stackable/servicelogs
mkdir -p %{_confdir}
mkdir -m 700 %{_confdir}/secret

%preun
if [ $1 == 0 ]; then #uninstall
Expand All @@ -57,6 +52,12 @@ rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_bindir}
%{_bindir}/*
%{_servicedir}/%{name}.service
%{_confdir}/agent.conf
%dir %{_confdir}
%config %{_confdir}/agent.conf
%dir %attr(700, root, root) %{_confdir}/secret
%dir %{_vardir}
%dir /var/log/stackable/servicelogs
%dir /opt/stackable/packages