chiark / gitweb /
[PATCH] automatically install correct initscript
authorrml@ximian.com <rml@ximian.com>
Wed, 3 Mar 2004 04:27:53 +0000 (20:27 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:35:07 +0000 (21:35 -0700)
On Mon, 2004-03-01 at 20:08, Robert Love wrote:

> Ack, I did not even see that!  Thanks.
>
> Let's rip that out, and always use the new built-in logic to determine
> what initscript to install.

Hm, looks like we do not need the %{lsb} and USE_LSB logic at all,
anymore.

Here is the patch, updated, removing both completely.

Makefile
TODO
udev.spec

index e2c7e4298829ab4dae7c11e82892ffdcc43d870c..c3b33a7be10c20cc25e4440de84847050432c6cb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -347,6 +347,15 @@ uninstall-dbus-policy:
        -
 endif
 
        -
 endif
 
+install-initscript: etc/init.d/udev etc/init.d/udev.debian etc/init.d/udev.init.LSB
+       @if [ -f /etc/redhat-release ]; then \
+               $(INSTALL_DATA) etc/init.d/udev $(etcdir)/init.d/udev; \
+       elif [ -f /etc/SuSE-release ]; then \
+               $(INSTALL_DATA) etc/init.d/udev.init.LSB $(etcdir)/init.d/udev; \
+       elif [ -f /etc/debian_version ]; then \
+               $(INSTALL_DATA) etc/init.d/udev.debian $(etcdir)/init.d/udev; \
+       fi
+
 install-config: $(GEN_CONFIGS)
        $(INSTALL) -d $(DESTDIR)$(configdir)
        @if [ ! -r $(DESTDIR)$(configdir)udev.conf ]; then \
 install-config: $(GEN_CONFIGS)
        $(INSTALL) -d $(DESTDIR)$(configdir)
        @if [ ! -r $(DESTDIR)$(configdir)udev.conf ]; then \
@@ -362,7 +371,7 @@ install-config: $(GEN_CONFIGS)
                $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.permissions $(DESTDIR)$(configdir); \
        fi
 
                $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.permissions $(DESTDIR)$(configdir); \
        fi
 
-install: install-config install-dbus-policy all
+install: install-initscript install-config install-dbus-policy all
        $(INSTALL) -d $(DESTDIR)$(udevdir)
        $(INSTALL) -d $(DESTDIR)$(hotplugdir)
        $(INSTALL_PROGRAM) -D $(ROOT) $(DESTDIR)$(sbindir)/$(ROOT)
        $(INSTALL) -d $(DESTDIR)$(udevdir)
        $(INSTALL) -d $(DESTDIR)$(hotplugdir)
        $(INSTALL_PROGRAM) -D $(ROOT) $(DESTDIR)$(sbindir)/$(ROOT)
@@ -370,12 +379,6 @@ install: install-config install-dbus-policy all
        $(INSTALL_PROGRAM) -D $(SENDER) $(DESTDIR)$(sbindir)/$(SENDER)
        $(INSTALL_PROGRAM) -D $(HELPER) $(DESTDIR)$(sbindir)/$(HELPER)
        $(INSTALL_PROGRAM) -D $(TESTER) $(DESTDIR)$(sbindir)/$(TESTER)
        $(INSTALL_PROGRAM) -D $(SENDER) $(DESTDIR)$(sbindir)/$(SENDER)
        $(INSTALL_PROGRAM) -D $(HELPER) $(DESTDIR)$(sbindir)/$(HELPER)
        $(INSTALL_PROGRAM) -D $(TESTER) $(DESTDIR)$(sbindir)/$(TESTER)
-       @if [ "x$(USE_LSB)" = "xtrue" ]; then \
-               $(INSTALL_PROGRAM) -D etc/init.d/udev.init.LSB $(DESTDIR)$(initdir)/udev; \
-               ln -s $(DESTDIR)$(initdir)/udev $(sbindir)/rcudev; \
-       else \
-               $(INSTALL_PROGRAM) -D etc/init.d/udev $(DESTDIR)$(initdir)/udev; \
-       fi
        $(INSTALL_DATA) -D udev.8 $(DESTDIR)$(mandir)/man8/udev.8
        $(INSTALL_DATA) -D udevinfo.8 $(DESTDIR)$(mandir)/man8/udevinfo.8
        $(INSTALL_DATA) -D udevd.8 $(DESTDIR)$(mandir)/man8/udevd.8
        $(INSTALL_DATA) -D udev.8 $(DESTDIR)$(mandir)/man8/udev.8
        $(INSTALL_DATA) -D udevinfo.8 $(DESTDIR)$(mandir)/man8/udevinfo.8
        $(INSTALL_DATA) -D udevd.8 $(DESTDIR)$(mandir)/man8/udevd.8
diff --git a/TODO b/TODO
index 2239d7b0246e4343d18118d9af305ff16329d96f..49a134effd9d434ccbc750b2265f61a176f91348 100644 (file)
--- a/TODO
+++ b/TODO
@@ -7,7 +7,6 @@ greg@kroah.com
 
 
 - more documentation (can never have too much.)
 
 
 - more documentation (can never have too much.)
-- install the proper init.d script based on the distro we are running on.
 - persuade the distro packagers to submit their changes (or just steal them
   if we can find them...)
 - create kernel name to devfs name config file so that all of the devfs users
 - persuade the distro packagers to submit their changes (or just steal them
   if we can find them...)
 - create kernel name to devfs name config file so that all of the devfs users
index ae802ca8e563facdc39ea87c2da396c6f22de300..b9cf5b140e4e805b0f25b64ebd23f99116fbb892 100644 (file)
--- a/udev.spec
+++ b/udev.spec
 # 1 - debugging enabled
 %define debug 0
 
 # 1 - debugging enabled
 %define debug 0
 
-# if we want to use the LSB version of the init script or the Redhat one
-# 0 - use Redhat: etc/init.d/udev
-# 1 - use LSB: etc/init.d/udev.init.LSB
-%define lsb 0
-
 # if we want to build the scsi_id "extra" package or not
 # 0 - do not build the package
 # 1 - build it
 # if we want to build the scsi_id "extra" package or not
 # 0 - do not build the package
 # 1 - build it
@@ -99,11 +94,6 @@ make DESTDIR=$RPM_BUILD_ROOT install \
        USE_SELINUX=true        \
 %else
        USE_SELINUX=false       \
        USE_SELINUX=true        \
 %else
        USE_SELINUX=false       \
-%endif
-%if %{lsb}
-       USE_LSB=true            \
-%else
-       USE_LSB=false           \
 %endif
        EXTRAS="        \
 %if %{scsi_id}
 %endif
        EXTRAS="        \
 %if %{scsi_id}