]> git.sur5r.net Git - bacula/bacula/commitdiff
Collapse Solaris install-autostart targets
authorBen Walton <bdwalton@gmail.com>
Fri, 15 Apr 2011 18:17:43 +0000 (14:17 -0400)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:44:34 +0000 (14:44 +0200)
Use a patterened rule to install and uninstall the various init
scripts for solaris.  They're all the same, so reduce the redundancy.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
bacula/platforms/solaris/Makefile.in

index df431013e40c1c9759421320d2faa9b41d8b202d..0b391eb659b42cfa9dd959badfb437abc5c4034a 100644 (file)
@@ -19,62 +19,25 @@ install: install-autostart
 
 install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir
 
-       
-install-autostart-fd:
-       @rm -f /etc/rc0.d/K20bacula-fd
-       @rm -f /etc/rc1.d/S99bacula-fd
-       @rm -f /etc/rc2.d/S99bacula-fd
-       @$(INSTALL_PROGRAM) -m 744 bacula-fd /etc/init.d/bacula-fd
+install-autostart-%:
+       @rm -f /etc/rc0.d/K20bacula-$*
+       @rm -f /etc/rc1.d/S99bacula-$*
+       @rm -f /etc/rc2.d/S99bacula-$*
+       @$(INSTALL_PROGRAM) -m 744 bacula-$* /etc/init.d/bacula-$*
        # set symlinks for script at startup and shutdown
-       @ln -f -s /etc/init.d/bacula-fd /etc/rc0.d/K20bacula-fd
-       @ln -f -s /etc/init.d/bacula-fd /etc/rc1.d/S99bacula-fd
-       @ln -f -s /etc/init.d/bacula-fd /etc/rc2.d/S99bacula-fd
-
-
-install-autostart-sd:
-       @rm -f /etc/rc0.d/K20bacula-sd
-       @rm -f /etc/rc1.d/S99bacula-sd
-       @rm -f /etc/rc2.d/S99bacula-sd
-       @$(INSTALL_PROGRAM) -m 744 bacula-sd /etc/init.d/bacula-sd
-       # set symlinks for script at startup and shutdown
-       @ln -f -s /etc/init.d/bacula-sd /etc/rc0.d/K20bacula-sd
-       @ln -f -s /etc/init.d/bacula-sd /etc/rc1.d/S99bacula-sd
-       @ln -f -s /etc/init.d/bacula-sd /etc/rc2.d/S99bacula-sd
-
-
-install-autostart-dir:
-       @rm -f /etc/rc0.d/K20bacula-dir
-       @rm -f /etc/rc1.d/S99bacula-dir
-       @rm -f /etc/rc2.d/S99bacula-dir
-       @$(INSTALL_PROGRAM) -m 744 bacula-dir /etc/init.d/bacula-dir
-       # set symlinks for script at startup and shutdown
-       @ln -f -s /etc/init.d/bacula-dir /etc/rc0.d/K20bacula-dir
-       @ln -f -s /etc/init.d/bacula-dir /etc/rc1.d/S99bacula-dir
-       @ln -f -s /etc/init.d/bacula-dir /etc/rc2.d/S99bacula-dir
-
+       @ln -f -s /etc/init.d/bacula-$* /etc/rc0.d/K20bacula-$*
+       @ln -f -s /etc/init.d/bacula-$* /etc/rc1.d/S99bacula-$*
+       @ln -f -s /etc/init.d/bacula-$* /etc/rc2.d/S99bacula-$*
 
 uninstall: uninstall-autostart
 
 uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir
 
-uninstall-autostart-fd:
-       @rm -f /etc/rc0.d/K20bacula-fd
-       @rm -f /etc/rc1.d/S99bacula-fd
-       @rm -f /etc/rc2.d/S99bacula-fd
-       @rm -f /etc/init.d/bacula-fd
-
-
-uninstall-autostart-sd:
-       @rm -f /etc/rc0.d/K20bacula-sd
-       @rm -f /etc/rc1.d/S99bacula-sd
-       @rm -f /etc/rc2.d/S99bacula-sd
-       @rm -f /etc/init.d/bacula-sd
-
-uninstall-autostart-dir:
-       @rm -f /etc/rc0.d/K20bacula-dir
-       @rm -f /etc/rc1.d/S99bacula-dir
-       @rm -f /etc/rc2.d/S99bacula-dir
-       @rm -f /etc/init.d/bacula-dir
+uninstall-autostart-%:
+       @rm -f /etc/rc0.d/K20bacula-$*
+       @rm -f /etc/rc1.d/S99bacula-$*
+       @rm -f /etc/rc2.d/S99bacula-$*
+       @rm -f /etc/init.d/bacula-$*
 
 clean:
        @rm -f 1 2 3