[packages/suspend-utils/DEVEL] use git checkout, adds KMS (Kernel Mode Switch) support
glen
glen at pld-linux.org
Sun Mar 3 01:43:17 CET 2013
commit 84626a40570fd8d30c47288c6da7b50fdf6fbcb5
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sun Mar 3 02:39:48 2013 +0200
use git checkout, adds KMS (Kernel Mode Switch) support
get-source.sh | 23 ++++++++++++++++
suspend-diet.patch | 29 ++++++++++----------
suspend-utils.spec | 37 +++++++++++++++----------
wlcsv2c.pl | 79 ------------------------------------------------------
4 files changed, 60 insertions(+), 108 deletions(-)
---
diff --git a/suspend-utils.spec b/suspend-utils.spec
index 827cf3a..c601a1c 100644
--- a/suspend-utils.spec
+++ b/suspend-utils.spec
@@ -9,19 +9,20 @@
%undefine with_dietlibc
%endif
+%define rel 0.1
+%define subver g668c5f7
Summary: Suspend to RAM/Disk/Both
Summary(de.UTF-8): Einfrieren in den Systemspeicher
Summary(pl.UTF-8): Zamrażanie w RAM/na dysku/jedno i drugie
Name: suspend-utils
Version: 1.0
-Release: 1
+Release: 1.%{subver}.%{rel}
License: GPL v2
Group: Applications/System
-# git clone git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-utils.git
-# Source0: %{name}-%{snap}.tar.bz2
-Source0: http://dl.sourceforge.net/project/suspend/suspend/suspend-1.0/suspend-utils-1.0.tar.bz2
-# Source0-md5: 02f7d4b679bad1bb294a0efe48ce5934
-Source1: wlcsv2c.pl
+#Source0: http://dl.sourceforge.net/project/suspend/suspend/suspend-1.0/suspend-utils-1.0.tar.bz2
+Source0: %{name}-%{version}.%{subver}.tar.gz
+# Source0-md5: 02ef3a7af0524de300f333879831c782
+Source1: get-source.sh
Patch0: suspend-sys-file-range-write.patch
Patch1: suspend-fadvise.patch
Patch2: suspend-diet.patch
@@ -84,20 +85,18 @@ Suspend to RAM/Disk/Both resume program for initrd.
Zamrażanie w RAM/Dysku/Jedno i drugie - program resume dla initrd.
%prep
-%setup -q
+%setup -q -n %{name}-%{version}.%{subver}
%patch0 -p1
%patch1 -p2
%patch2 -p1
-install %{SOURCE1} .
-
-cat >syscalltest.c <<EOF
+cat > syscalltest.c <<EOF
#include <stdio.h>
#include <sys/syscall.h>
int main() { printf("%d", SYS_reboot); return 0; }
EOF
%{__cc} syscalltest.c -o syscalltest
-SYS_REBOOT_NR=`./syscalltest`
+SYS_REBOOT_NR=$(./syscalltest)
sed -i -e "s/SYS_REBOOT_NR/$SYS_REBOOT_NR/" swsusp.h
@@ -146,6 +145,7 @@ mv resume resume-initrd
%install
rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_sysconfdir}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
@@ -161,11 +161,20 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc HOWTO README* AUTHORS ReleaseNotes
-%attr(755,root,root) %{_sbindir}/*
+%doc HOWTO README* AUTHORS
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/suspend.conf
+%attr(755,root,root) %{_sbindir}/s2both
+%attr(755,root,root) %{_sbindir}/s2disk
+%attr(755,root,root) %{_sbindir}/s2ram
+%attr(755,root,root) %{_sbindir}/suspend-keygen
+%attr(755,root,root) %{_sbindir}/swap-offset
+%{_mandir}/man5/suspend.conf.5*
+%{_mandir}/man8/s2disk.8*
+%{_mandir}/man8/s2ram.8*
+%{_mandir}/man8/suspend-keygen.8*
+%{_mandir}/man8/swap-offset.8*
%dir %{_libdir}/suspend
%attr(755,root,root) %{_libdir}/suspend/resume
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/suspend.conf
%if %{with initrd}
%files initrd
diff --git a/get-source.sh b/get-source.sh
new file mode 100755
index 0000000..6e328fc
--- /dev/null
+++ b/get-source.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+PACKAGE=suspend-utils
+
+set -e
+set -x
+
+if [ ! -d $PACKAGE/ ]; then
+ git clone git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-utils.git $PACKAGE/
+else
+ cd $PACKAGE
+ git pull --rebase
+ cd ..
+fi
+
+export GIT_DIR=$PACKAGE/.git
+VERSION=1.0.g$(git rev-parse --short master)
+ARCHIVE=$PACKAGE-$VERSION.tar.gz
+
+if [ -e $ARCHIVE ]; then
+ echo >&2 "$ARCHIVE already exists"
+ exit 0
+fi
+git archive master --prefix=$PACKAGE-$VERSION/ -o $ARCHIVE
diff --git a/suspend-diet.patch b/suspend-diet.patch
index 6646508..731015e 100644
--- a/suspend-diet.patch
+++ b/suspend-diet.patch
@@ -24,21 +24,20 @@ diff -ur suspend/s2ram-x86.c suspend-diet/s2ram-x86.c
#include <pci/pci.h>
#include "vbetool/vbetool.h"
-diff -ur suspend/suspend_ioctls.h suspend-diet/suspend_ioctls.h
---- suspend/suspend_ioctls.h 2008-05-06 14:01:06.000000000 +0200
-+++ suspend-diet/suspend_ioctls.h 2009-04-06 15:03:00.000000000 +0200
-@@ -8,7 +8,11 @@
- */
- struct resume_swap_area {
- loff_t offset;
-+#ifdef __dietlibc__
-+ uint32_t dev;
-+#else
- u_int32_t dev;
-+#endif
- } __attribute__((packed));
-
- #define SNAPSHOT_IOC_MAGIC '3'
+#--- suspend/suspend_ioctls.h 2008-05-06 14:01:06.000000000 +0200
+#+++ suspend-diet/suspend_ioctls.h 2009-04-06 15:03:00.000000000 +0200
+#@@ -8,7 +8,11 @@
+# */
+# struct resume_swap_area {
+# loff_t offset;
+#+#ifdef __dietlibc__
+#+ uint32_t dev;
+#+#else
+# u_int32_t dev;
+#+#endif
+# } __attribute__((packed));
+#
+# #define SNAPSHOT_IOC_MAGIC '3'
diff -ur suspend/swsusp.h suspend-diet/swsusp.h
--- suspend/swsusp.h 2009-04-06 15:11:06.000000000 +0200
+++ suspend-diet/swsusp.h 2009-04-06 15:03:27.000000000 +0200
diff --git a/wlcsv2c.pl b/wlcsv2c.pl
deleted file mode 100644
index 8575371..0000000
--- a/wlcsv2c.pl
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/perl
-# Rodolfo Garcia kix_at_kix.es
-# suspend database management v1.0
-
-use Switch;
-
-switch ($#ARGV) {
- case 0 {
- my $fin = $ARGV[0];
- open(INF, "<$fin") or die "Could not open input file\n";
- open(OUF, ">&STDOUT") or die "Could not open output file\n";
- }
- case 1 {
- my $fin = $ARGV[0];
- my $fout = $ARGV[1];
- open(INF, "<$fin") or die "Could not open input file\n";
- open(OUF, ">$fout") or die "Could not open output file\n";
- }
- else {
- my $msg = $0 . " <input-file> [output-file]";
- die $msg;
- }
-}
-
-&print_c_header;
-
-my $sys_vendor = "";
-my $sys_product = "";
-my $sys_version = "";
-my $bios_version = "";
-my $flags = "";
-my $comments = "";
-
-while(<INF>) {
- if (/"([^"]*)",\s*"([^"]*)",\s*"([^"]*)",\s*"([^"]*)",\s*([^,]*),\s*(.*)/) {
- $sys_vendor = $1;
- $sys_product = $2;
- $sys_version = $3;
- $bios_version = $4;
- $flags = $5;
- $comments = $6;
-
- printf OUF "\t$comments\n";
- printf OUF "\t{ \"" . $sys_vendor . "\",\t\"" . $sys_product . "\",\t\"" . $sys_version . "\",\t\"" . $bios_version . "\",\t" . $flags . " },\n";
- }
-}
-
-&print_c_footer;
-
-close(INF);
-close(OUF);
-
-sub print_c_header
-{
- ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
-
- printf OUF "/* whitelist.c\n";
- printf OUF " * whitelist of machines that are known to work somehow\n";
- printf OUF " * and all the workarounds\n";
- printf OUF " * Script generated file, please do not edit by hand\n";
- printf OUF " */\n";
- printf OUF "\n";
- printf OUF "\#include \"config.h\"\n";
- printf OUF "\#include \<stdlib.h\>\n";
- printf OUF "\#include \"whitelist.h\"\n";
- printf OUF "\n";
-
- printf OUF "char *whitelist_version = \"\$Id: whitelist.c ver. ";
- printf OUF "%4d%02d%02d %02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec;
- printf OUF " automatic generation - kix - Exp \$\";\n";
- printf OUF "\n";
- printf OUF "struct machine_entry whitelist[] = {\n";
-}
-
-sub print_c_footer
-{
- print OUF "\t{ NULL, NULL, NULL, NULL, 0 }\n";
- print OUF "};\n";
-}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/suspend-utils.git/commitdiff/84626a40570fd8d30c47288c6da7b50fdf6fbcb5
More information about the pld-cvs-commit
mailing list