summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-laptop/lphdisk/ChangeLog11
-rw-r--r--app-laptop/lphdisk/Manifest4
-rw-r--r--app-laptop/lphdisk/files/lphdisk-0.9.1-gentoo.patch252
-rw-r--r--app-laptop/lphdisk/lphdisk-0.9.1-r2.ebuild36
4 files changed, 300 insertions, 3 deletions
diff --git a/app-laptop/lphdisk/ChangeLog b/app-laptop/lphdisk/ChangeLog
index 347543ff075b..84150bde4761 100644
--- a/app-laptop/lphdisk/ChangeLog
+++ b/app-laptop/lphdisk/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-laptop/lphdisk
-# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-laptop/lphdisk/ChangeLog,v 1.6 2007/02/21 22:16:39 peper Exp $
+# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/lphdisk/ChangeLog,v 1.7 2008/12/08 10:33:10 ssuominen Exp $
+
+*lphdisk-0.9.1-r2 (08 Dec 2008)
+
+ 08 Dec 2008; <ssuominen@gentoo.org> +files/lphdisk-0.9.1-gentoo.patch,
+ +lphdisk-0.9.1-r2.ebuild:
+ Use system lrmi library to fix building with GLIBC 2.8, incorporated with
+ GCC 3.x and linux-headers patchset. Untested version. Closes bug #240018.
21 Feb 2007; Piotr Jaroszyński <peper@gentoo.org> ChangeLog:
Transition to Manifest2.
diff --git a/app-laptop/lphdisk/Manifest b/app-laptop/lphdisk/Manifest
index 2c1bb8224613..4ad4eba1508f 100644
--- a/app-laptop/lphdisk/Manifest
+++ b/app-laptop/lphdisk/Manifest
@@ -1,5 +1,7 @@
AUX lphdisk-0.9.1-gcc3.patch 1564 RMD160 82b6b236e0fea36898f950091e7e456e4bb71c74 SHA1 6d59574165159aa71aec8dd77698062aed553bde SHA256 36350654aa8def5b7642b2b4c33dad849ed41cd2ee479b02eb55828431ca083a
+AUX lphdisk-0.9.1-gentoo.patch 8018 RMD160 873936e4f1955d5db419133bd6bacd88d3d5e722 SHA1 0d7f376968bcdfab4dc3d4b5333f6df2d58b70f3 SHA256 009fbfa9e70998c5f97df0d436be8d8a12a77454d2faad08d4ae127920ee1ba1
DIST lphdisk-0.9.1.tar.bz2 26343 RMD160 bfcdb27006d84298aca00b1b596bb0d48457d317 SHA1 6cbc8d52e2342e27a1228725c65643235a68dd81 SHA256 42a6df491db3bd581fad5bfd2af09008cd604d7767a7f3984c1a77f69d571249
EBUILD lphdisk-0.9.1-r1.ebuild 937 RMD160 57d0411da771308355f22f192023cc702feaceb9 SHA1 19f503ef0e77951bf02913778655444dd5688f05 SHA256 180cd492c919a53bece380f5f03c979a6b1779d45a2f65ea86ed87887d38126f
-MISC ChangeLog 1547 RMD160 ddc229b000a84351a9d06e51dc5c98429c436a26 SHA1 e725cc75218fc035baa62857221196f9cc0bca01 SHA256 3a45f7bec34fea937aa944b042c36c33c1d5646b5c5418f700dceb2e1bafb419
+EBUILD lphdisk-0.9.1-r2.ebuild 925 RMD160 b9fc65f9ff9ab99e53f1bfc9ba0631a154fc741e SHA1 67bed38111c0ff927a0d6f9a19f4b345ae319600 SHA256 d259491e6e5570f2608f1f85b44978d001db49dfd73a1ce510d5fda9f0c27bf1
+MISC ChangeLog 1838 RMD160 22e605444fd79c3397f4638197f19792821fbf45 SHA1 6e2503ae5a68360aabe75d9a7ac30a5243b2b5fd SHA256 11bd5409b244dbbc27cb16f204b84a7b3afde826f5373bf164b3f00e60ac289d
MISC metadata.xml 314 RMD160 25181cde297628576a9545bea3a76601485bfaf3 SHA1 ac16b621acf5a22b64859e3323d466fb556fc4c8 SHA256 736baab77aea9c4da199c01e3cd6877c271bd02357ff9b41b537a2232c6e96d7
diff --git a/app-laptop/lphdisk/files/lphdisk-0.9.1-gentoo.patch b/app-laptop/lphdisk/files/lphdisk-0.9.1-gentoo.patch
new file mode 100644
index 000000000000..07e6423acc73
--- /dev/null
+++ b/app-laptop/lphdisk/files/lphdisk-0.9.1-gentoo.patch
@@ -0,0 +1,252 @@
+diff -ur lphdisk-0.9.1.orig/lphdisk.c lphdisk-0.9.1/lphdisk.c
+--- lphdisk-0.9.1.orig/lphdisk.c 2002-02-12 13:04:27.000000000 +0200
++++ lphdisk-0.9.1/lphdisk.c 2008-12-08 12:21:29.000000000 +0200
+@@ -19,8 +19,10 @@
+ Be careful!
+ */
+
++#define _LARGEFILE64_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <sys/types.h>
+ #include <unistd.h>
+ #include <string.h>
+ #include <stdarg.h>
+@@ -29,8 +31,8 @@
+ #include <fcntl.h>
+ #include <sys/stat.h>
+ #include <sys/io.h>
+-#include "lrmi.h"
+-#include "vbe.h"
++#include <lrmi.h>
++#include <vbe.h>
+
+ /* General Program Defines: */
+
+@@ -100,58 +102,6 @@
+ /* General Purpose Utility Routines */
+ /*****************************************************************************/
+
+-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+-/* The following is a hack to take advantage of the ext2 "_llseek" system */
+-/* call to do seeks to "long long" offsets under linux (this is needed to */
+-/* seek to sectors beyond 4194303 (2GB)). This isn't directly supported by */
+-/* glibc, so we need to make our own interface function for it. We should */
+-/* be able to get the _NR__llseek define from linux/unistd.h. From this we */
+-/* can construct a wrapper to perform the right system call. */
+-
+-#include <linux/unistd.h> /* for __NR__llseek */
+-
+-typedef long long lloff_t;
+-
+-#ifdef __NR__llseek
+-
+-static _syscall5(int,_llseek, unsigned int,fd, unsigned long,offset_high,
+- unsigned long,offset_low, lloff_t *,result,
+- unsigned int,origin)
+-
+-lloff_t llseek (unsigned int fd, lloff_t offset, unsigned int origin) {
+- lloff_t result;
+- int retval;
+-
+- retval = _llseek (fd, ((unsigned long long) offset) >> 32,
+- ((unsigned long long) offset) & 0xffffffff,
+- &result, origin);
+- return (retval == -1 ? (lloff_t) retval : result);
+-}
+-
+-#else /* __NR__llseek */
+-
+-/* Somehow, __NR__llseek wasn't in linux/unistd.h. This shouldn't ever */
+-/* happen, but better safe than sorry.. The best we can do is emulate it */
+-/* with lseek, and hope we don't get an offset that's too large (throw an */
+-/* error if we do) */
+-
+-lloff_t llseek (unsigned int fd, lloff_t offset, unsigned int origin) {
+- off_t offt_offset = (off_t) offset;
+-
+- if ((lloff_t)offt_offset != offset) {
+- /* converting to off_t and back yields different result, indicating an */
+- /* overflow.. */
+- errno = EINVAL;
+- return -1;
+- } else {
+- return lseek(fd, offt_offset, origin);
+- }
+-}
+-
+-#endif /* __NR__llseek */
+-
+-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+-
+ #define get16(p) get_int_le(p,2)
+ #define get32(p) get_int_le(p,4)
+
+@@ -189,9 +139,9 @@
+ /* success, nonzero on error. */
+
+ int seek_sector (int fd, size_t secno) {
+- lloff_t offset = (lloff_t) secno * SECTOR_SIZE;
++ off64_t offset = (off64_t) secno * SECTOR_SIZE;
+
+- if (llseek(fd, offset, SEEK_SET) == (lloff_t) -1)
++ if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1)
+ return -1;
+
+ return 0;
+@@ -556,25 +506,29 @@
+
+ int meminfo_physmem(void) {
+ FILE *f;
+- unsigned int size;
++ unsigned int size = 0;
+ int ramsize;
++ char s[128];
+
+ if (!(f = fopen(meminfo_filename, "r"))) {
+ debug("Unable to open %s: %s\n", meminfo_filename, strerror(errno));
+ return 0;
+ }
+- fscanf(f, "%*[^\n]\n"); /* Read the header line and discard it */
+
+- if (fscanf(f, "Mem: %u", &size) != 1) {
++ while (fgets(s, sizeof(s), f)) {
++ if (sscanf(s, "MemTotal: %u", &size) == 1) {
++ break;
++ }
++ }
++ if (size == 0) {
+ debug("Parse of %s failed.\n", meminfo_filename);
+ return 0;
+ }
+ fclose(f);
+
+- /* convert to KB and then round up to the next power of 2 (since RAM */
++ /* size is in KB and then round up to the next power of 2 (since RAM */
+ /* sizes don't come in anything else, so this should correct for the */
+ /* kernel size, etc) */
+- size >>= 10;
+ debug("%s reports memory size of %d KB", meminfo_filename, size);
+ for (ramsize = 1; size; size >>= 1) ramsize <<= 1;
+
+@@ -718,22 +672,22 @@
+ {"force", 0, 0, 'f'},
+ {0,0,0,0}};
+
+-const char usage_string[] = "\
+-Usage: %1$s [options] [device]
+-Prepare a hibernation partition for APM suspend-to-disk.
+-
+-options:
+- -h, --help Display brief usage and option information (this screen)
+- -p, --probeonly Only calculate and display required size, do not format
+- -q, --quiet Turn off informational messages, useful for scripts
+- -d, --debug Turn on (verbose) debugging messages
+- -n, --nowrite Do not actually write to the disk
+- -f, --force **DANGEROUS** Format without regard to potential problems
+-
+-'device' should be a raw disk device (not a partition). The default device
+-is /dev/hda.
+-
+-(%2$s)\n\n";
++const char usage_string[] = ""
++"Usage: %1$s [options] [device]\n"
++"Prepare a hibernation partition for APM suspend-to-disk.\n"
++"\n"
++"options:\n"
++" -h, --help Display brief usage and option information (this screen)\n"
++" -p, --probeonly Only calculate and display required size, do not format\n"
++" -q, --quiet Turn off informational messages, useful for scripts\n"
++" -d, --debug Turn on (verbose) debugging messages\n"
++" -n, --nowrite Do not actually write to the disk\n"
++" -f, --force **DANGEROUS** Format without regard to potential problems\n"
++"\n"
++"'device' should be a raw disk device (not a partition). The default device\n"
++"is /dev/hda.\n"
++"\n"
++"(%2$s)\n\n";
+
+ void print_usage (void) {
+ char *progname = rindex(argv0, '/');
+@@ -750,7 +704,7 @@
+ dev_t dev;
+ int partition;
+ int ramsize, vramsize, required_size;
+- size_t required_sectors;
++ size_t required_sectors = 0;
+
+ argv0 = argv[0];
+
+@@ -821,9 +775,9 @@
+ }
+
+ if (!required_size) {
+- if (!quiet_flag) printf("Reccomended partition size is unknown.\n");
++ if (!quiet_flag) printf("Recommended partition size is unknown.\n");
+ } else {
+- if (!quiet_flag) printf("Reccomended partition size is %d MB"
++ if (!quiet_flag) printf("Recommended partition size is %d MB"
+ " (%d sectors)\n", ((required_size+1023) >> 10),
+ required_sectors);
+ }
+@@ -923,7 +877,7 @@
+
+ if ((pi[partition-1].size < required_sectors) && !quiet_flag) {
+ fprintf(stderr, "Warning: hibernate partition size (%d) is smaller than"
+- " reccomended size (%d).\n", pi[partition-1].size,
++ " recommended size (%d).\n", pi[partition-1].size,
+ required_sectors);
+ }
+
+diff -ur lphdisk-0.9.1.orig/Makefile lphdisk-0.9.1/Makefile
+--- lphdisk-0.9.1.orig/Makefile 2002-02-12 11:06:46.000000000 +0200
++++ lphdisk-0.9.1/Makefile 2008-12-08 12:26:49.000000000 +0200
+@@ -4,37 +4,28 @@
+ # lphdisk 0.9.1
+ #
+
+-INSTALL_PREFIX = /usr/local
++INSTALL_PREFIX = /usr
+
+-CFLAGS = -g -Wall
+-LIBS =
+-
+-LRMIDIR = lrmi-0.6m
++CFLAGS += -Wall
++LIBS = -llrmi
+
+ all: lphdisk
+
+-lphdisk: lphdisk.o lrmi.o
+- $(CC) $(CFLAGS) -o lphdisk lphdisk.o lrmi.o $(LIBS)
+-
+-lphdisk.o: lphdisk.c lrmi.h vbe.h
+-
+-lrmi.o:
+- cd $(LRMIDIR) && $(MAKE) $@
+- cp $(LRMIDIR)/lrmi.o .
++lphdisk: lphdisk.o
++ $(CC) $(CFLAGS) -o lphdisk lphdisk.o $(LIBS)
+
+-%.h: $(LRMIDIR)/%.h
+- cp $^ $@
++lphdisk.o: lphdisk.c
+
+ install: all
+- install -m 755 lphdisk $(INSTALL_PREFIX)/sbin
+- install -m 644 lphdisk.8 $(INSTALL_PREFIX)/man/man8
++ mkdir -p $(DESTDIR)$(INSTALL_PREFIX)/sbin
++ install -m 755 lphdisk $(DESTDIR)$(INSTALL_PREFIX)/sbin
++ mkdir -p $(DESTDIR)$(INSTALL_PREFIX)/share/man/man8
++ install -m 644 lphdisk.8 $(DESTDIR)$(INSTALL_PREFIX)/share/man/man8
+
+ clean:
+- cd $(LRMIDIR) && $(MAKE) $@
+- rm -f *.o lrmi.h vbe.h
++ rm -f *.o
+
+ distclean: clean
+- cd $(LRMIDIR) && $(MAKE) $@
+ rm -f lphdisk
+
+ .PHONY: all install clean distclean
diff --git a/app-laptop/lphdisk/lphdisk-0.9.1-r2.ebuild b/app-laptop/lphdisk/lphdisk-0.9.1-r2.ebuild
new file mode 100644
index 000000000000..342efb7a8f05
--- /dev/null
+++ b/app-laptop/lphdisk/lphdisk-0.9.1-r2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/lphdisk/lphdisk-0.9.1-r2.ebuild,v 1.1 2008/12/08 10:33:10 ssuominen Exp $
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="utility for preparing a hibernation partition for APM Suspend-To-Disk"
+HOMEPAGE="http://www.procyon.com/~pda/lphdisk/"
+SRC_URI="http://www.procyon.com/~pda/lphdisk/${P}.tar.bz2"
+
+LICENSE="Artistic"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+DEPEND="sys-libs/lrmi"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+}
+
+src_compile() {
+ tc-export CC
+ emake || die "emake failed."
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed."
+}
+
+pkg_postinst() {
+ ewarn "This package is now using external lrmi library instead of shipped"
+ ewarn "copy it came with. This package is untested, use at your own risk."
+}