From 37a5cf94b2722bc39f14d49e030961056f49f4cc Mon Sep 17 00:00:00 2001 From: samuel Date: Thu, 25 Jun 2026 14:23:14 +0200 Subject: [PATCH] fix: some bugs in rpm spec --- netoik-cloud.spec | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/netoik-cloud.spec b/netoik-cloud.spec index 4aabb4f..adf2c6d 100644 --- a/netoik-cloud.spec +++ b/netoik-cloud.spec @@ -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