From aae87d3d9c005742509506c7d92d2c12ccf4819c Mon Sep 17 00:00:00 2001 From: Jeremy Date: Feb 24 2016 19:50:40 +0000 Subject: Fixing rpmlint errors --- diff --git a/tlp-libdir.patch b/tlp-libdir.patch new file mode 100644 index 0000000..4e41a7b --- /dev/null +++ b/tlp-libdir.patch @@ -0,0 +1,196 @@ +--- a/Makefile ++++ b/Makefile +@@ -5,11 +5,10 @@ + # definitions and absolute paths in scripts too! + + # Evaluate parameters +-TLP_LIBDIR ?= /usr/lib + TLP_SBIN ?= /usr/sbin + TLP_BIN ?= /usr/bin +-TLP_TLIB = $(TLP_LIBDIR)/tlp-pm +-TLP_PLIB = $(TLP_LIBDIR)/pm-utils ++TLP_TLIB ?= /usr/share/tlp-pm ++TLP_PLIB ?= /usr/lib/pm-utils + TLP_ULIB ?= /lib/udev + TLP_ACPI ?= /etc/acpi + TLP_NMDSP ?= /etc/NetworkManager/dispatcher.d +--- a/tlp ++++ b/tlp +@@ -5,22 +5,21 @@ + # This software is licensed under the GPL v2 or later. + + # --- Constants +-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm" ++readonly LIBDIRS="/usr/share/tlp-pm" + readonly LIBS="tlp-functions tlp-rf-func" + + # --- Locate and source libraries +-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done +-if [ ! -d $libdir ]; then ++if [ ! -d $LIBDIR ]; then + echo "Error: missing library directory ($LIBDIRS)." 1>&2 + exit 1 + fi + + for lib in $LIBS; do +- if [ ! -f $libdir/$lib ]; then +- echo "Error: missing function library \'$libdir/$lib\'." 1>&2 ++ if [ ! -f $LIBDIR/$lib ]; then ++ echo "Error: missing function library \'$LIBDIR/$lib\'." 1>&2 + exit 1 + fi +- . $libdir/$lib ++ . $LIBDIR/$lib + done + + # --- Subroutines +--- a/tlp-functions ++++ b/tlp-functions +@@ -33,7 +33,7 @@ readonly SYSTEMD=systemd + readonly SYSTEMCTL=systemctl + readonly INITCTL=initctl + +-readonly TPACPIBAT=$libdir/tpacpi-bat # libdir is initialized by main program ++readonly TPACPIBAT=$LIBDIR/tpacpi-bat # LIBDIR is initialized by main program + + readonly TPACPIDIR=/sys/devices/platform/thinkpad_acpi + readonly SMAPIDIR=/sys/devices/platform/smapi +--- a/tlp-rdw-nm ++++ b/tlp-rdw-nm +@@ -6,19 +6,18 @@ + # This software is licensed under the GPL v2 or later. + + # --- Constants +-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm" ++readonly LIBDIRS="/usr/share/tlp-pm" + readonly LIBS="tlp-functions tlp-rf-func" + + readonly RDW_NM_LOCK="rdw_nm" + readonly RDW_NM_LOCKTIME=2 + + # --- Locate and source libraries +-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done +-[ -d $libdir ] || exit 0 ++[ -d $LIBDIR ] || exit 0 + + for lib in $LIBS; do +- [ -f $libdir/$lib ] || exit 0 +- . $libdir/$lib ++ [ -f $LIBDIR/$lib ] || exit 0 ++ . $LIBDIR/$lib + done + + # --- MAIN +--- a/tlp-rdw-udev ++++ b/tlp-rdw-udev +@@ -5,19 +5,18 @@ + # This software is licensed under the GPL v2 or later. + + # --- Constants +-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm" ++readonly LIBDIRS="/usr/share/tlp-pm" + readonly LIBS="tlp-functions tlp-rf-func" + + readonly RDW_DOCK_LOCK="rdw_dock_lock" + readonly RDW_DOCK_LOCKTIME=2 + + # --- Locate and source libraries +-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done +-[ -d $libdir ] || exit 0 ++[ -d $LIBDIR ] || exit 0 + + for lib in $LIBS; do +- [ -f $libdir/$lib ] || exit 0 +- . $libdir/$lib ++ [ -f $LIBDIR/$lib ] || exit 0 ++ . $LIBDIR/$lib + done + + # --- MAIN +--- a/tlp-rf ++++ b/tlp-rf +@@ -5,16 +5,15 @@ + # This software is licensed under the GPL v2 or later. + + # --- Constants +-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm" ++readonly LIBDIRS="/usr/share/tlp-pm" + readonly LIBS="tlp-functions tlp-rf-func" + + # --- Locate and source libraries +-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done +-[ -d $libdir ] || exit 0 ++[ -d $LIBDIR ] || exit 0 + + for lib in $LIBS; do +- [ -f $libdir/$lib ] || exit 0 +- . $libdir/$lib ++ [ -f $LIBDIR/$lib ] || exit 0 ++ . $LIBDIR/$lib + done + + # --- MAIN +--- a/tlp-run-on ++++ b/tlp-run-on +@@ -5,22 +5,21 @@ + # This software is licensed under the GPL v2 or later. + + # --- Constants +-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm" ++readonly LIBDIRS="/usr/share/tlp-pm" + readonly LIBS="tlp-functions" + + # --- Locate and source libraries +-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done +-if [ ! -d $libdir ]; then ++if [ ! -d $LIBDIR ]; then + echo "Error: missing library directory ($LIBDIRS)." 1>&2 + exit 1 + fi + + for lib in $LIBS; do +- if [ ! -f $libdir/$lib ]; then +- echo "Error: missing function library \'$libdir/$lib\'." 1>&2 ++ if [ ! -f $LIBDIR/$lib ]; then ++ echo "Error: missing function library \'$LIBDIR/$lib\'." 1>&2 + exit 1 + fi +- . $libdir/$lib ++ . $LIBDIR/$lib + done + + # --- MAIN +--- a/tlp-stat ++++ b/tlp-stat +@@ -6,7 +6,7 @@ + + # --- Constants + +-readonly LIBDIRS="/usr/lib/tlp-pm /usr/lib64/tlp-pm" ++readonly LIBDIRS="/usr/share/tlp-pm" + readonly LIBS="tlp-functions tlp-rf-func" + + readonly TLPUSB=tlp-usblist +@@ -330,18 +330,17 @@ read_args () { # read command line argum + + # --- Locate and source libraries + +-for libdir in $LIBDIRS; do [ -d $libdir ] && break; done +-if [ ! -d $libdir ]; then ++if [ ! -d $LIBDIR ]; then + echo "Error: missing library directory ($LIBDIRS)." 1>&2 + exit 1 + fi + + for lib in $LIBS; do +- if [ ! -f $libdir/$lib ]; then +- echo "Error: missing function library \'$libdir/$lib\'." 1>&2 ++ if [ ! -f $LIBDIR/$lib ]; then ++ echo "Error: missing function library \'$LIBDIR/$lib\'." 1>&2 + exit 1 + fi +- . $libdir/$lib ++ . $LIBDIR/$lib + done + + # --- MAIN diff --git a/tlp.spec b/tlp.spec index a86ffd2..02bd915 100644 --- a/tlp.spec +++ b/tlp.spec @@ -1,12 +1,14 @@ Name: tlp Version: 0.8 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Advanced power management tool for Linux License: GPLv2+ URL: http://linrunner.de/tlp Source0: https://github.com/linrunner/TLP/archive/%{version}.tar.gz #Provided by Andreas Roederer : Source1: 50-tlp.preset +#Moves lib to share, backported from upstream development: +Patch0: tlp-libdir.patch BuildRequires: systemd #The following requires are not detected: Requires: ethtool @@ -19,8 +21,8 @@ Requires: udev Requires: usbutils Requires: pciutils Requires: kernel-tools -#Conflicts with laptop-mode-tools, note that an official -#package/package name doesn't exist, so this works for now: +#Note: Conflicts with laptop-mode-tools +#Makes sure laptop_mode isn't being used: Conflicts: %{_sbindir}/laptop_mode BuildArch: noarch @@ -43,6 +45,7 @@ based on dock events and the Network Manager connection status. %prep %setup -q -n TLP-%{version} +%patch0 -p1 #This isn't necessary for fc18+, but it makes things more consistent: sed -i 's|/lib/udev|/usr/lib/udev|g' tlp*rules Makefile @@ -62,8 +65,8 @@ install -Dpm 0644 %{SOURCE1} %{buildroot}/%{_presetdir}/50-tlp.preset install -D -m 644 tlp.service %{buildroot}%{_unitdir}/tlp.service install -D -m 644 tlp-sleep.service %{buildroot}%{_unitdir}/tlp-sleep.service #THIS IS A WORKAROUND FOR RFKILL! -ln -sf /dev/null systemd-rfkill@.service -install -D systemd-rfkill@.service %{buildroot}%{_sysconfdir}/systemd/system/systemd-rfkill@.service +echo '#' > systemd-rfkill@.service +install -D -m 644 systemd-rfkill@.service %{buildroot}%{_sysconfdir}/systemd/system/systemd-rfkill@.service %files %config(noreplace) %{_sysconfdir}/default/tlp @@ -71,20 +74,18 @@ install -D systemd-rfkill@.service %{buildroot}%{_sysconfdir}/systemd/system/sys %{_bindir}/* %{_sbindir}/* %{_mandir}/man*/* -#Explicit use of lib is required, see "Libexecdir"/"Multilib Exempt Locations": -#https://fedoraproject.org/wiki/Packaging:Guidelines#Filesystem_Layout -%{_prefix}/lib/tlp-pm +%{_datadir}/tlp-pm %{_udevrulesdir}/85-tlp.rules %{_udevrulesdir}/../tlp-usb-udev %{_datadir}/bash-completion/completions/tlp %{_presetdir}/50-tlp.preset %{_unitdir}/*.service #THIS IS A WORKAROUND FOR RFKILL! -%config %{_sysconfdir}/systemd/system/systemd-rfkill@.service +%config(noreplace) %{_sysconfdir}/systemd/system/systemd-rfkill@.service #The following is not supported by fedora's kernel: %exclude %{_sysconfdir}/acpi/events/thinkpad-radiosw %exclude %{_sysconfdir}/acpi/thinkpad-radiosw.sh - + %files rdw %doc COPYING LICENSE README %{_sysconfdir}/NetworkManager/dispatcher.d/99tlp-rdw-nm @@ -107,6 +108,9 @@ install -D systemd-rfkill@.service %{buildroot}%{_sysconfdir}/systemd/system/sys /bin/systemctl enable NetworkManager-dispatcher.service >/dev/null 2>&1 || : %changelog +* Wed Feb 24 2016 Jeremy Newton - 0.8-3 +- Fix rpmlint warnings/errors + * Fri Feb 05 2016 Fedora Release Engineering - 0.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild