[laptop-mode] patch for rpm spec file to generate rpm for 1.49 on fedora 11

Nikolay Botev bono8106 at gmail.com
Thu Jul 23 11:02:56 CEST 2009


--000e0cd32cdc1bb70d046f5bc2f7
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi,

Here is a patch that updates the rpm spec file to work with 1.49 sources,
and in addition, eliminates the requirement to repackage the tar.gz
(changing the root folder from laptop-mode-tools_{version} to
laptop-mode-tools-{version} is not required by patched spec file).

Please note that this spec file requires a patch to laptop-mode-tools
install.sh to fix a bug with handling sleep.d/ rc script installation. That
patch is included here as well.

Hope this is useful.

--- laptop-mode-tools_1.45.spec    2009-07-23 01:35:56.542531370 -0700
+++ laptop-mode-tools_1.49.spec    2009-07-23 02:02:26.101273403 -0700
@@ -3,7 +3,7 @@

 Summary: Tools for power savings based on battery/AC status
 Name: laptop-mode-tools
-Version: 1.45
+Version: 1.49
 Release: 1
 License: GPL
 Group: System Environment/Base
@@ -25,7 +25,7 @@
 various other power savings.

 %prep
-%setup
+%setup -n laptop-mode-tools_%{version}

 %build

@@ -60,17 +60,24 @@
 %defattr(-, root, root, 0755)

 %doc COPYING Documentation/*.txt README
+%doc %{_mandir}/man8/laptop-mode.conf.8
+%doc %{_mandir}/man8/laptop_mode.8
+%doc %{_mandir}/man8/lm-profiler.8
+%doc %{_mandir}/man8/lm-profiler.conf.8
+%doc %{_mandir}/man8/lm-syslog-setup.8
 %docdir %{_mandir}
 %config %{_sysconfdir}/acpi/actions/lm_*.sh
 %config %{_sysconfdir}/acpi/events/lm_*
 %config(noreplace) %{_sysconfdir}/laptop-mode/
 %config %{_initrddir}/laptop-mode
+%config %{_sysconfdir}/pm/sleep.d/*

 %{_sysconfdir}/apm/event.d/*
 %{_sysconfdir}/power/scripts.d/*
 %{_sysconfdir}/power/event.d/*
 %{_usr}/sbin/*
 %{_usr}/share/laptop-mode-tools/modules/*
+%{_usr}/share/laptop-mode-tools/module-helpers/*

 %dir %{_sysconfdir}/acpi/events
 %dir %{_sysconfdir}/acpi/actions


diff -Nur laptop-mode-tools_1.49_orig/install.sh
laptop-mode-tools_1.49/install.sh
--- laptop-mode-tools_1.49_orig/install.sh    2009-06-03 07:12:52.000000000
-0700
+++ laptop-mode-tools_1.49/install.sh    2009-07-23 01:28:13.696277237 -0700
@@ -183,7 +183,7 @@
 # Install pm-utils hook only if pm-utils config dir is present, or force
the
 # install if we have a DESTDIR.
 if [ -n "$DESTDIR" -o -d "$DESTDIR/etc/pm/sleep.d" ] ; then
-    if ( ! $INSTALL -D -m 755 etc/pm/sleep.d/99laptop-mode
"$DESTDIR/etc/pm/sleep.d" ) ; then
+    if ( ! $INSTALL -D -m 755 etc/pm/sleep.d/99laptop-mode
"$DESTDIR/etc/pm/sleep.d/99laptop-mode" ) ; then
         echo "$0: Failed to install 99-laptop-mode into /etc/pm/sleep.d.
Installation failed."
         exit 36
     fi

--000e0cd32cdc1bb70d046f5bc2f7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,<br><br>Here is a patch that updates the rpm spec file to work with 1.49=
 sources, and in addition, eliminates the requirement to repackage the tar.=
gz (changing the root folder from laptop-mode-tools_{version} to laptop-mod=
e-tools-{version} is not required by patched spec file).<br>

<br>Please note that this spec file requires a patch to laptop-mode-tools i=
nstall.sh to fix a bug with handling sleep.d/ rc script installation. That =
patch is included here as well.<br><br>Hope this is useful.<br><br>--- lapt=
op-mode-tools_1.45.spec=A0=A0=A0 2009-07-23 01:35:56.542531370 -0700<br>

+++ laptop-mode-tools_1.49.spec=A0=A0=A0 2009-07-23 02:02:26.101273403 -070=
0<br>@@ -3,7 +3,7 @@<br>=A0<br>=A0Summary: Tools for power savings based on=
 battery/AC status<br>=A0Name: laptop-mode-tools<br>-Version: 1.45<br>+Vers=
ion: 1.49<br>

=A0Release: 1<br>=A0License: GPL<br>=A0Group: System Environment/Base<br>@@=
 -25,7 +25,7 @@<br>=A0various other power savings.<br>=A0<br>=A0%prep<br>-%=
setup<br>+%setup -n laptop-mode-tools_%{version}<br>=A0<br>=A0%build<br>=A0=
<br>@@ -60,17 +60,24 @@<br>

=A0%defattr(-, root, root, 0755)<br>=A0<br>=A0%doc COPYING Documentation/*.=
txt README<br>+%doc %{_mandir}/man8/laptop-mode.conf.8<br>+%doc %{_mandir}/=
man8/laptop_mode.8<br>+%doc %{_mandir}/man8/lm-profiler.8<br>+%doc %{_mandi=
r}/man8/lm-profiler.conf.8<br>

+%doc %{_mandir}/man8/lm-syslog-setup.8<br>=A0%docdir %{_mandir}<br>=A0%con=
fig %{_sysconfdir}/acpi/actions/lm_*.sh<br>=A0%config %{_sysconfdir}/acpi/e=
vents/lm_*<br>=A0%config(noreplace) %{_sysconfdir}/laptop-mode/<br>=A0%conf=
ig %{_initrddir}/laptop-mode<br>

+%config %{_sysconfdir}/pm/sleep.d/*<br>=A0<br>=A0%{_sysconfdir}/apm/event.=
d/*<br>=A0%{_sysconfdir}/power/scripts.d/*<br>=A0%{_sysconfdir}/power/event=
.d/*<br>=A0%{_usr}/sbin/*<br>=A0%{_usr}/share/laptop-mode-tools/modules/*<b=
r>+%{_usr}/share/laptop-mode-tools/module-helpers/*<br>

=A0<br>=A0%dir %{_sysconfdir}/acpi/events<br>=A0%dir %{_sysconfdir}/acpi/ac=
tions<br><br><br>diff -Nur laptop-mode-tools_1.49_orig/install.sh laptop-mo=
de-tools_1.49/install.sh<br>--- laptop-mode-tools_1.49_orig/install.sh=A0=
=A0=A0 2009-06-03 07:12:52.000000000 -0700<br>

+++ laptop-mode-tools_1.49/install.sh=A0=A0=A0 2009-07-23 01:28:13.69627723=
7 -0700<br>@@ -183,7 +183,7 @@<br>=A0# Install pm-utils hook only if pm-uti=
ls config dir is present, or force the<br>=A0# install if we have a DESTDIR=
.<br>
=A0if [ -n &quot;$DESTDIR&quot; -o -d &quot;$DESTDIR/etc/pm/sleep.d&quot; ]=
 ; then<br>
-=A0=A0=A0 if ( ! $INSTALL -D -m 755 etc/pm/sleep.d/99laptop-mode &quot;$DE=
STDIR/etc/pm/sleep.d&quot; ) ; then<br>+=A0=A0=A0 if ( ! $INSTALL -D -m 755=
 etc/pm/sleep.d/99laptop-mode &quot;$DESTDIR/etc/pm/sleep.d/99laptop-mode&q=
uot; ) ; then<br>

=A0=A0=A0=A0 =A0=A0=A0 echo &quot;$0: Failed to install 99-laptop-mode into=
 /etc/pm/sleep.d. Installation failed.&quot;<br>=A0=A0=A0=A0 =A0=A0=A0 exit=
 36<br>=A0=A0=A0=A0 fi<br><br>

--000e0cd32cdc1bb70d046f5bc2f7--


More information about the laptop-mode mailing list