[virt-tools-list] [libosinfo] Better udev rule installation

Daniel P. Berrange berrange at redhat.com
Fri Sep 23 08:07:16 UTC 2011


On Fri, Sep 23, 2011 at 02:57:09AM +0300, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
> 
> Provide a configure option to set the udev rule directory. If this
> option is not set, udev directory defaults to '$prefix/lib/udev/rules.d'
> unless $prefix is '/usr' in which case it defaults to '/lib/udev/rules.d'.
> ---
>  configure.ac     |   14 ++++++++++++++
>  data/Makefile.am |    6 ++----
>  2 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 390e053..76598a9 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -98,6 +98,20 @@ AC_ARG_ENABLE([udev],
>          [], [enable_udev=no])
>  AM_CONDITIONAL([WITH_UDEV], [test "x$enable_udev" = "xyes"])
>  
> +AC_ARG_WITH([udev-rulesdir],
> +             [AS_HELP_STRING([--with-udev-rulesdir],[UDev rules directory])],
> +             [], [])
> +
> +if test "x$with_udev_rulesdir" = "x"; then
> +        if test "x$prefix" = "x/usr" ; then
> +                with_udev_rulesdir=/lib/udev/rules.d
> +        else
> +                with_udev_rulesdir=$prefix/lib/udev/rules.d
> +        fi
> +fi
> +
> +AC_SUBST(with_udev_rulesdir)

It is normal convention to set makefile vars in all uppercase
and drop the 'with_' prefix. So before pushing to the repo,
can you change that to

  UDEV_RULESDIR=$with_udev_rulesdir
  AC_SUBST(UDEV_RULESDIR)

> +
>  AC_ARG_ENABLE([coverage],
>          AS_HELP_STRING([--enable-coverage], [enable GCC code coverage]),
>          [], [enable_coverage=no])
> diff --git a/data/Makefile.am b/data/Makefile.am
> index ca93b62..3ef365b 100644
> --- a/data/Makefile.am
> +++ b/data/Makefile.am
> @@ -12,11 +12,9 @@ BUILT_SOURCES = 95-osinfo.rules
>  95-osinfo.rules: 95-osinfo.rules.in
>  	sed 's,\@bindir\@,$(exec_prefix)/bin,' $< > $@
>  
> -# Now copy the rules file to where it needs to be but don't worry if it fails
> -# since it can easily fail (e.g if `make install` is run unprivileged) and its
> -# not a big deal if it does.
>  install-data-hook: 95-osinfo.rules
> -	-cp 95-osinfo.rules $(DESTDIR)/lib/udev/rules.d/
> +	mkdir -p $(DESTDIR)$(with_udev_rulesdir)
> +	$(INSTALL) -m 0644 95-osinfo.rules $(DESTDIR)$(with_udev_rulesdir)

s/with_udev_rulesdir/UDEV_RULESDIR/


ACK, no need to repost - just commit with those two changes.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the virt-tools-list mailing list