From 3d3755762d9f51d9f72a89c2db3ee8982ca793b0f81ffaead46debe2577f5392 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 21 Jul 2016 11:27:03 +0000 Subject: [PATCH] strip unnecessary trailing semicolons; rework softlink creation OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=112 --- kmod.spec | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/kmod.spec b/kmod.spec index 80d24d3..6ced167 100644 --- a/kmod.spec +++ b/kmod.spec @@ -119,40 +119,39 @@ export LDFLAGS="-Wl,-z,relro,-z,now" make %{?_smp_mflags} V=1 %install -b="%buildroot"; -make install DESTDIR="$b"; +b="%buildroot" +%make_install rm -f "$b/%_libdir"/*.la -mkdir -p "$b/%_libexecdir/kmod" "$b/%_sbindir" "$b/sbin"; +mkdir -p "$b/%_libexecdir/kmod" "$b/%_sbindir" "$b/sbin" for i in depmod insmod lsmod modinfo modprobe rmmod; do # # kmod-compat and kmod-compat(usrmerge) # - ln -s "%_bindir/kmod" "$b/%_sbindir/$i"; - ln -s "%_bindir/kmod" "$b/sbin/$i"; + ln -s "%_bindir/kmod" "$b/%_sbindir/$i" + ln -s "%_bindir/kmod" "$b/sbin/$i" # # Make symlinks also available in normal fashion, # so one can actually run it. # - ln -s "%_bindir/kmod" "$b/%_libexecdir/kmod/$i"; -done; -mkdir -p "$b/%_bindir" "$b/bin"; + ln -s "%_bindir/kmod" "$b/%_libexecdir/kmod/$i" +done +mkdir -p "$b/%_bindir" "$b/bin" for i in lsmod; do - ln -s "%_bindir/kmod" "$b/%_bindir/$i"; - ln -s "%_bindir/kmod" "$b/bin/$i"; -done; + ln -s "%_bindir/kmod" "$b/%_bindir/$i" + ln -s "%_bindir/kmod" "$b/bin/$i" +done # -# make mkinitrd happy -# (last time checked it does not look into /usr) +# make (all ancient versions of) mkinitrd happy which did not look in /usr # -mkdir -p "$b"/{bin,sbin,%_lib}; -ln -s "%_bindir/kmod" "$b/bin/"; +mkdir -p "$b"/{bin,sbin,%_lib} +ln -s "%_bindir/kmod" "$b/bin/" ls -l "$b/%_libdir/" %if "%_libdir" != "/%_lib" -ln -s "%_libdir/libkmod.so.2" "$b/%_lib/"; -ln -s "%_libdir/libkmod.so.2.2.7" "$b/%_lib/"; +ln -s "%_libdir/libkmod.so.2.3.1" "$b/%_lib/" +cp -a "%_libdir/libkmod.so.2" "$b/%_lib/" %endif %post @@ -161,8 +160,7 @@ ln -s "%_libdir/libkmod.so.2.2.7" "$b/%_lib/"; %posttrans %{?regenerate_initrd_posttrans} -%post -n %lname -p /sbin/ldconfig - +%post -n %lname -p /sbin/ldconfig %postun -n %lname -p /sbin/ldconfig %files