fix: some bugs in rpm spec

This commit is contained in:
2026-06-25 14:23:14 +02:00
parent d2f9e531ab
commit 37a5cf94b2

View File

@@ -66,8 +66,7 @@ fi
chown --recursive nextcloud:nextcloud /var/www/nextcloud
chmod 755 /var/www/nextcloud
# Create symbolic links to data and config
runuser --user=nextcloud -- ln --symbolic --force %{_sharedstatedir}/nextcloud/data /var/www/nextcloud/data
# Create symbolic link to config
runuser --user=nextcloud -- ln --symbolic --force %{_sysconfdir}/nextcloud/config.php /var/www/nextcloud/config/config.php
# Restart services
@@ -79,12 +78,9 @@ systemctl restart nginx.service php-fpm.service
# Display commands and exit on error
set -xe
# Stop service
systemctl stop php-fpm
# If uninstalling, then delete user and db
if [ $1 == 0 ]; then
if id nextcloud; then
if id nextcloud >/dev/null 2>&1; then
userdel --force --remove nextcloud
fi
if runuser --user=postgres -- psql --quiet --tuples-only --command='\l' | grep --quiet nextcloud; then
@@ -93,18 +89,16 @@ if [ $1 == 0 ]; then
if runuser --user=postgres -- psql --quiet --tuples-only --command='\du' | grep --quiet nextcloud; then
runuser --user=postgres -- dropuser nextcloud
fi
rm --recursive --force /var/www/nextcloud
fi
%files
%dir %attr(755, root, root) %{_sysconfdir}/nextcloud
%attr(644, root, root) %{_sysconfdir}/nextcloud/config.php.tpl
%attr(640, root, -) %{_sysconfdir}/nextcloud/config.php
%attr(644, root, root) %{_sysconfdir}/nginx/conf.d/cloud.netoik.io.conf
%attr(644, root, root) %{_sysconfdir}/php-fpm.d/nextcloud.conf
%dir %attr(700, -, -) /var/www/nextcloud
%changelog
%autochangelog