]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - radvd/radvd.nm
Remove fastd and libuecc
[ipfire-3.x.git] / radvd / radvd.nm
index bf4b6507e937a39fe398fdd364761d4bd175f7b1..686dadbf6b115836f37c31af38fa69fc73ffc4b7 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = radvd
-version    = 1.8.3
+version    = 1.9.1
 release    = 1
 
 groups     = System/Daemons
@@ -25,22 +25,72 @@ source_dl  = http://www.litech.org/radvd/dist/
 
 build
        requires
+               bison
                flex
                flex-devel
-               bison
+               libdaemon-devel
+               shadow-utils
        end
 
        configure_options += \
-               --mandir=/usr/share/man \
                --with-pidfile=/run/radvd/radvd.pid
 
        prepare_cmds
+               %{create_user}
+
                sed -e "s/-lfl/-lfl_pic/g" -i Makefile.*
        end
+
+       install_cmds
+               mkdir -pv -m 750 %{BUILDROOT}/run/radvd
+               chown -v radvd.radvd %{BUILDROOT}/run/radvd
+       end
+end
+
+create_user
+       getent group radvd >/dev/null || groupadd -r radvd
+
+       # The radvd user also needs to be in the wheel group to get access to
+       # /proc.
+       getent passwd radvd >/dev/null || \
+               useradd -r -g radvd -G wheel -d / -s /sbin/nologin \
+                       -c "User for the Router Advertisement daemon." radvd
 end
 
 packages
        package %{name}
-               reuires = /lib/network/network-radvd-config
+               requires
+                       network
+               end
+
+               script prein
+                       %{create_user}
+               end
+
+               # Just search for new unit files that were just installed.
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               # Disable the service that is to be removed and stop it if it is still running.
+               script preun
+                       /bin/systemctl --no-reload disable radvd.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop radvd.service >/dev/null 2>&1 || :
+               end
+
+               # Just tell systemd that unitfiles have been removed.
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               # Try to restart the service if it is running.
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart radvd.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end