diff --git a/biosdevname.changes b/biosdevname.changes index aa2fc53..4ed5eeb 100644 --- a/biosdevname.changes +++ b/biosdevname.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Apr 22 12:08:57 UTC 2013 - idonmez@suse.com + +- Use correct directory for udev rules + ------------------------------------------------------------------- Mon Dec 3 13:51:01 UTC 2012 - p.drouand@gmail.com diff --git a/biosdevname.spec b/biosdevname.spec index cc66be9..6a8afa7 100644 --- a/biosdevname.spec +++ b/biosdevname.spec @@ -1,7 +1,7 @@ # # spec file for package biosdevname # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -32,16 +32,20 @@ Source0: http://linux.dell.com/files/%{name}/%{name}-%{version}/%{name}-% Source1: setup-biosdevname.sh Patch2: ignore-broken-BIOSes Patch3: whitelist-dell +Patch4: udev-rule-path.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: pciutils-devel +BuildRequires: pkgconfig BuildRequires: zlib-devel -# to figure out how to name the rules file -BuildRequires: udev +# to figure out how to name/location of the rules file +BuildRequires: libudev-devel # because of mkinitrd_setup in %post and %postun PreReq: mkinitrd # for ownership of /lib/udev/rules.d Requires: udev +%define _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d + %description biosdevname in its simplest form takes an kernel name name as an argument, and returns the BIOS-given name it "should" be. This is @@ -56,10 +60,11 @@ You can enable/disable usage of biosdevname with boot option %setup -q %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build # this is a udev rule, so it needs to live in / rather than /usr -%configure --disable-rpath --libdir=/%{_lib} --prefix=/ --bindir=/bin --sbindir=/sbin +%configure --disable-rpath --prefix=/ --bindir=/bin --sbindir=/sbin make %{?_smp_mflags} cp %{S:1} . @@ -69,15 +74,16 @@ rm %{buildroot}/sbin/%{name}S || : mkdir -p $RPM_BUILD_ROOT/lib/mkinitrd/scripts install -m 0755 setup-biosdevname.sh \ $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-biosdevname.sh + # remain disabled by default perl -pi -e 's,^# GOTO,GOTO,g;' \ - $RPM_BUILD_ROOT/lib/udev/rules.d/*-biosdevname.rules + $RPM_BUILD_ROOT/%{_udevrulesdir}/*-biosdevname.rules %files %defattr(-,root,root,-) %doc COPYING README /sbin/%{name} -%config(noreplace) /lib/udev/rules.d/*%{name}.rules +%config(noreplace) %{_udevrulesdir}/*%{name}.rules %{_mandir}/man1/* /lib/mkinitrd/scripts/setup-biosdevname.sh diff --git a/udev-rule-path.patch b/udev-rule-path.patch new file mode 100644 index 0000000..bb11fec --- /dev/null +++ b/udev-rule-path.patch @@ -0,0 +1,32 @@ +Index: biosdevname-0.4.1/configure.ac +=================================================================== +--- biosdevname-0.4.1.orig/configure.ac ++++ biosdevname-0.4.1/configure.ac +@@ -70,7 +70,10 @@ AC_CHECK_FUNCS([dup2 gettimeofday memset + # handles default udev rules as of udev 114 or thereabouts + RULEDEST=/lib/udev/rules.d/71-biosdevname.rules + +-if [[ -e /etc/udev/rules.d/60-net.rules ]]; then ++if [[ -e /usr/lib/udev/rules.d/99-systemd.rules ]]; then ++ # openSUSE 12.3+ ++ RULESDEST=/usr/lib/udev/rules.d/71-biosdevname.rules ++elif [[ -e /etc/udev/rules.d/60-net.rules ]]; then + # RHEL 5 / Fedora + RULEDEST=/etc/udev/rules.d/60-biosdevname.rules + elif [[ -e /etc/udev/rules.d/31-network.rules ]]; then +Index: biosdevname-0.4.1/configure +=================================================================== +--- biosdevname-0.4.1.orig/configure ++++ biosdevname-0.4.1/configure +@@ -10473,7 +10473,10 @@ done + # handles default udev rules as of udev 114 or thereabouts + RULEDEST=/lib/udev/rules.d/71-biosdevname.rules + +-if [ -e /etc/udev/rules.d/60-net.rules ]; then ++if [ -e /usr/lib/udev ]; then ++ # openSUSE 12.3+ ++ RULEDEST=/usr/lib/udev/rules.d/71-biosdevname.rules ++elif [ -e /etc/udev/rules.d/60-net.rules ]; then + # RHEL 5 / Fedora + RULEDEST=/etc/udev/rules.d/60-biosdevname.rules + elif [ -e /etc/udev/rules.d/31-network.rules ]; then