Accepting request 172844 from home:namtrac:branches:Base:System

- Use correct directory for udev rules

OBS-URL: https://build.opensuse.org/request/show/172844
OBS-URL: https://build.opensuse.org/package/show/Base:System/biosdevname?expand=0&rev=15
This commit is contained in:
Dirk Mueller 2013-04-22 14:11:36 +00:00 committed by Git OBS Bridge
parent 790566a59e
commit ce7e3eeb79
3 changed files with 49 additions and 6 deletions

View File

@ -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

View File

@ -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

32
udev-rule-path.patch Normal file
View File

@ -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