summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2004-06-08 12:41:57 +0000
committerMike Frysinger <vapier@gentoo.org>2004-06-08 12:41:57 +0000
commit262e6731d9a94b26ca7c402810b969240d5ad09b (patch)
tree45becd14f6733aa964155ef1a28f3aaba136c190 /sys-fs/mac-fdisk
parentAdded to ~ppc (diff)
downloadgentoo-2-262e6731d9a94b26ca7c402810b969240d5ad09b.tar.gz
gentoo-2-262e6731d9a94b26ca7c402810b969240d5ad09b.tar.bz2
gentoo-2-262e6731d9a94b26ca7c402810b969240d5ad09b.zip
move from sys-apps
Diffstat (limited to 'sys-fs/mac-fdisk')
-rw-r--r--sys-fs/mac-fdisk/ChangeLog35
-rw-r--r--sys-fs/mac-fdisk/files/digest-mac-fdisk-0.12
-rw-r--r--sys-fs/mac-fdisk/files/digest-mac-fdisk-0.1-r22
-rw-r--r--sys-fs/mac-fdisk/files/mac-fdisk-ppc.patch121
-rw-r--r--sys-fs/mac-fdisk/files/mac-fdisk-ppc64-1.patch491
-rw-r--r--sys-fs/mac-fdisk/files/mac-fdisk-ppc64.patch121
-rw-r--r--sys-fs/mac-fdisk/mac-fdisk-0.1-r2.ebuild57
-rw-r--r--sys-fs/mac-fdisk/mac-fdisk-0.1.ebuild46
-rw-r--r--sys-fs/mac-fdisk/metadata.xml5
9 files changed, 880 insertions, 0 deletions
diff --git a/sys-fs/mac-fdisk/ChangeLog b/sys-fs/mac-fdisk/ChangeLog
new file mode 100644
index 000000000000..052775985799
--- /dev/null
+++ b/sys-fs/mac-fdisk/ChangeLog
@@ -0,0 +1,35 @@
+# ChangeLog for sys-apps/mac-fdisk
+# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Id: ChangeLog,v 1.1 2004/06/08 12:39:29 vapier Exp $
+
+*mac-fdisk-0.1-r2 (01 Jun 2004)
+
+ 01 Jun 2004; Pieter Van den Abeele <pvdabeel@gentoo.org>
+ mac-fdisk-0.1-r2.ebuild, files/mac-fdisk-ppc.patch:
+ patched macfdisk for 2.6 headers on ppc, ppc64 -r1 patches
+ is not applied by default on ppc
+
+ 28 May 2004; Tom Gall <tgall@gentoo.org> mac-fdisk-0.1-r1.ebuild:
+ fix a number of 64 bit problems
+
+ 27 Apr 2004; Aron Griffis <agriffis@gentoo.org> mac-fdisk-0.1-r1.ebuild:
+ Add inherit eutils
+
+*mac-fdisk-0.1-r1 (30 Mar 2004)
+
+ 30 Mar 2004; Tom Gall <tgall@gentoo.org> mac-fdisk-0.2:
+ fix amazingly bad 2.6 kernel header problems for ppc64 with
+ utterly bad hack.
+ pull in latest fixes from debian land diff 8 to diff 10
+ mark as ~for ppc
+
+ 09 Dec 2003; <spider@gentoo.org> mac-fdisk-0.1.ebuild:
+ fix chown 0.0 to 0:0
+
+ 06 Dec 2002; Rodney Rees <manson@gentoo.org> : changed sparc ~sparc keywords
+
+*mac-fdisk-0.1 (17 Mar 2002)
+
+17 Mar 2002; Kain <kain@kain.org> all:
+
+ This is an initial .ebuild for mac-fdisk 0.1 for ppc machines.
diff --git a/sys-fs/mac-fdisk/files/digest-mac-fdisk-0.1 b/sys-fs/mac-fdisk/files/digest-mac-fdisk-0.1
new file mode 100644
index 000000000000..2e7306ce3a7f
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/digest-mac-fdisk-0.1
@@ -0,0 +1,2 @@
+MD5 5dea1f9f8d44fe89c00322c315633443 mac-fdisk_0.1-8.diff.gz 17541
+MD5 24476329fe86ef6ccf222e233e2a99f1 mac-fdisk_0.1.orig.tar.gz 55817
diff --git a/sys-fs/mac-fdisk/files/digest-mac-fdisk-0.1-r2 b/sys-fs/mac-fdisk/files/digest-mac-fdisk-0.1-r2
new file mode 100644
index 000000000000..a2615b38d3a2
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/digest-mac-fdisk-0.1-r2
@@ -0,0 +1,2 @@
+MD5 24476329fe86ef6ccf222e233e2a99f1 mac-fdisk_0.1.orig.tar.gz 55817
+MD5 63b0cfe92f48d12603a9c6f7421febd8 mac-fdisk_0.1-10.diff.gz 18591
diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-ppc.patch b/sys-fs/mac-fdisk/files/mac-fdisk-ppc.patch
new file mode 100644
index 000000000000..d06099c7be95
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/mac-fdisk-ppc.patch
@@ -0,0 +1,121 @@
+Files mac-fdisk-0.1/fdisk and /root/mac-fdisk-0.1/fdisk differ
+diff -uNr mac-fdisk-0.1/fdisk.c /root/mac-fdisk-0.1/fdisk.c
+--- mac-fdisk-0.1/fdisk.c 2004-03-30 04:34:58.394924976 +0000
++++ /root/mac-fdisk-0.1/fdisk.c 2004-03-30 03:53:26.447986904 +0000
+@@ -59,9 +59,88 @@
+ */
+
+
++/* ----------- */
++#define _PPC_TYPES_H
++#define BITS_PER_LONG 32
++
++typedef __signed__ char __s8;
++typedef signed char s8;
++typedef unsigned char u8;
++typedef unsigned char __u8;
++
++typedef __signed__ short __s16;
++typedef signed short s16;
++typedef unsigned short __u16;
++typedef unsigned short u16;
++
++typedef __signed__ int __s32;
++typedef signed int s32;
++typedef unsigned int __u32;
++typedef unsigned int u32;
++
++typedef __signed__ long __s64;
++typedef signed long s64;
++typedef unsigned long __u64;
++typedef unsigned long u64;
++
++typedef struct {
++ __u32 u[4];
++} __vector128;
++
++typedef __vector128 vector128;
++
++typedef u32 dma_addr_t;
++typedef u64 dma64_addr_t;
++
++typedef struct {
++ unsigned long entry;
++ unsigned long toc;
++ unsigned long env;
++} func_descr_t;
++
++typedef unsigned int umode_t;
++
++#define BITS_TO_LONGS(bits) \
++ (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
++#define DECLARE_BITMAP(name,bits) \
++ unsigned long name[BITS_TO_LONGS(bits)]
++#define CLEAR_BITMAP(name,bits) \
++ memset(name, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long))
++
++struct partition {
++ unsigned char boot_ind; /* 0x80 - active */
++ unsigned char head; /* starting head */
++ unsigned char sector; /* starting sector */
++ unsigned char cyl; /* starting cylinder */
++ unsigned char sys_ind; /* What partition type */
++ unsigned char end_head; /* end head */
++ unsigned char end_sector; /* end sector */
++ unsigned char end_cyl; /* end cylinder */
++ unsigned int start_sect; /* starting sector counting from 0 */
++ unsigned int nr_sects; /* nr of sectors in partition */
++} __attribute__((packed));
++
++
++struct hd_geometry {
++ unsigned char heads;
++ unsigned char sectors;
++ unsigned short cylinders;
++ unsigned long start;
++};
++
++/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
++#define HDIO_GETGEO 0x0301 /* get device geometry */
++
++#define BLKRRPART _IO(0x12,95) /* re-read partition table */
++
++/* ---------- */
++
++typedef unsigned short kdev_t; /* BAD hack; kdev_t is not exported */
++
++
+ #include <unistd.h>
+ #include <stdio.h>
+-#include <stdlib.h>
++#include <stdlib.h>
+ #include <fcntl.h>
+ #include <ctype.h>
+ #include <setjmp.h>
+@@ -70,14 +149,6 @@
+
+ #include <sys/ioctl.h>
+
+-#include <linux/types.h>
+-
+-typedef unsigned short kdev_t; /* BAD hack; kdev_t is not exported */
+-
+-#include <linux/genhd.h>
+-#include <linux/hdreg.h>
+-#include <linux/fs.h>
+-
+ #include "fdisk.h"
+
+ #define hex_val(c) ({ \
+Files mac-fdisk-0.1/fdisk.o and /root/mac-fdisk-0.1/fdisk.o differ
+diff -uNr mac-fdisk-0.1/fdisklabel.c /root/mac-fdisk-0.1/fdisklabel.c
+--- mac-fdisk-0.1/fdisklabel.c 2004-03-30 04:34:58.396924672 +0000
++++ /root/mac-fdisk-0.1/fdisklabel.c 2004-03-30 01:16:31.974999800 +0000
+@@ -46,6 +46,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/param.h>
+
++#include <asm/types.h>
+ #include <linux/hdreg.h>
+ #include <linux/fs.h>
+
diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-ppc64-1.patch b/sys-fs/mac-fdisk/files/mac-fdisk-ppc64-1.patch
new file mode 100644
index 000000000000..7fbbdfd356e9
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/mac-fdisk-ppc64-1.patch
@@ -0,0 +1,491 @@
+diff -Naur mac-fdisk-0.1.orig/bitfield.c mac-fdisk-0.1/bitfield.c
+--- mac-fdisk-0.1.orig/bitfield.c 1997-01-10 00:30:51.000000000 +0200
++++ mac-fdisk-0.1/bitfield.c 2004-05-28 23:08:50.693300896 +0300
+@@ -67,13 +67,12 @@
+ //
+ // Routines
+ //
+-unsigned long
+-bitfield_set(unsigned long *bf, int base, int length, unsigned long value)
++unsigned int
++bitfield_set(unsigned int *bf, int base, int length, unsigned int value)
+ {
+- unsigned long t;
+- unsigned long m;
++ unsigned int t;
++ unsigned int m;
+ int s;
+- int i;
+
+ // compute shift & mask, coerce value to correct number of bits,
+ // zap the old bits and stuff the new value
+@@ -86,12 +85,11 @@
+ }
+
+
+-unsigned long
+-bitfield_get(unsigned long bf, int base, int length)
++unsigned int
++bitfield_get(unsigned int bf, int base, int length)
+ {
+- unsigned long m;
++ unsigned int m;
+ int s;
+- int i;
+
+ // compute shift & mask
+ // return the correct number of bits (shifted to low end)
+diff -Naur mac-fdisk-0.1.orig/bitfield.h mac-fdisk-0.1/bitfield.h
+--- mac-fdisk-0.1.orig/bitfield.h 1996-12-18 02:44:16.000000000 +0200
++++ mac-fdisk-0.1/bitfield.h 2004-05-28 19:50:24.751301024 +0300
+@@ -63,5 +63,5 @@
+ //
+ // Forward declarations
+ //
+-unsigned long bitfield_set(unsigned long *bf, int base, int length, unsigned long value);
+-unsigned long bitfield_get(unsigned long bf, int base, int length);
++unsigned int bitfield_set(unsigned int *bf, int base, int length, unsigned int value);
++unsigned int bitfield_get(unsigned int bf, int base, int length);
+diff -Naur mac-fdisk-0.1.orig/dpme.h mac-fdisk-0.1/dpme.h
+--- mac-fdisk-0.1.orig/dpme.h 2004-05-28 19:23:49.281282000 +0300
++++ mac-fdisk-0.1/dpme.h 2004-05-28 19:25:24.764273728 +0300
+@@ -61,7 +61,7 @@
+ //
+ typedef unsigned char u8;
+ typedef unsigned short u16;
+-typedef unsigned long u32;
++typedef unsigned int u32;
+
+
+ // Physical block zero of the disk has this format
+@@ -113,10 +113,10 @@
+ #endif
+ u32 dpme_boot_block ;
+ u32 dpme_boot_bytes ;
+- u8 *dpme_load_addr ;
+- u8 *dpme_load_addr_2 ;
+- u8 *dpme_goto_addr ;
+- u8 *dpme_goto_addr_2 ;
++ u32 dpme_load_addr ;
++ u32 dpme_load_addr_2 ;
++ u32 dpme_goto_addr ;
++ u32 dpme_goto_addr_2 ;
+ u32 dpme_checksum ;
+ char dpme_process_id[16] ;
+ u32 dpme_boot_args[32] ;
+diff -Naur mac-fdisk-0.1.orig/dump.c mac-fdisk-0.1/dump.c
+--- mac-fdisk-0.1.orig/dump.c 2004-05-28 19:23:49.292281000 +0300
++++ mac-fdisk-0.1/dump.c 2004-05-28 22:52:39.905370360 +0300
+@@ -30,8 +30,8 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
+ #include <stdlib.h>
++#ifndef __linux__
+ #include <unistd.h>
+ #endif
+ #include <string.h>
+@@ -63,16 +63,16 @@
+ // Global Constants
+ //
+ NAMES plist[] = {
+- "Drvr", "Apple_Driver",
+- "Dr43", "Apple_Driver43",
+- "Free", "Apple_Free",
+- " HFS", "Apple_HFS",
+- " MFS", "Apple_MFS",
+- "PDOS", "Apple_PRODOS",
+- "junk", "Apple_Scratch",
+- "unix", "Apple_UNIX_SVR2",
+- " map", "Apple_partition_map",
+- 0, 0
++ {"Drvr"}, {"Apple_Driver"},
++ {"Dr43"}, {"Apple_Driver43"},
++ {"Free"}, {"Apple_Free"},
++ {" HFS"}, {"Apple_HFS"},
++ {" MFS"}, {"Apple_MFS"},
++ {"PDOS"}, {"Apple_PRODOS"},
++ {"junk"}, {"Apple_Scratch"},
++ {"unix"}, {"Apple_UNIX_SVR2"},
++ {" map"}, {"Apple_partition_map"},
++ {0}, {0}
+ };
+
+ const char * kStringEmpty = "";
+@@ -164,10 +164,10 @@
+ }
+ #ifdef __mc68000__
+ printf("%*s type name "
+- "%*s %-*s ( size ) system\n", strlen(map->name)+1, "#", j, "length", j, "base");
++ "%*s %-*s ( size ) system\n", (int)strlen(map->name)+1, "#", j, "length", j, "base");
+ #else
+ printf("%*s type name "
+- "%*s %-*s ( size ) system\n", strlen(map->name)+1, "#", j, "length", j, "base");
++ "%*s %-*s ( size ) system\n", (int)strlen(map->name)+1, "#", j, "length", j, "base");
+ #endif
+
+ /* Grok devfs names. (courtesy Colin Walters)*/
+@@ -201,7 +201,6 @@
+ partition_map_header *map;
+ int j;
+ DPME *p;
+- BZB *bp;
+ char *s;
+ #ifdef __mc68000__
+ int aflag = 1;
+@@ -224,13 +223,13 @@
+ }
+ }
+ #ifdef __mc68000__
+- printf("%s%-2d %.4s %-12.12s ", dev, entry->disk_address, s, p->dpme_name);
++ printf("%s%-2d %.4s %-12.12s ", dev, (int)entry->disk_address, s, p->dpme_name);
+ #else
+- printf("%s%-4d %.4s %-18.32s ", dev, entry->disk_address, s, p->dpme_name);
++ printf("%s%-4d %.4s %-18.32s ", dev, (int)entry->disk_address, s, p->dpme_name);
+ #endif
+ } else {
+ printf("%s%-4d %20.32s %-18.32s ", dev,
+- entry->disk_address, p->dpme_type, p->dpme_name);
++ (int)entry->disk_address, p->dpme_type, p->dpme_name);
+ }
+
+ if (pflag) {
+@@ -314,7 +313,6 @@
+ int i;
+ int fd;
+ DPME * data;
+- long t;
+
+ data = (DPME *) malloc(PBLOCK_SIZE);
+ if (data == NULL) {
+@@ -382,7 +380,7 @@
+ printf("Header:\n");
+ printf("fd=%d (%s)\n", map->fd, (map->regular_file)?"file":"device");
+ printf("map %d blocks out of %d, media %u blocks\n",
+- map->blocks_in_map, map->maximum_in_map, map->media_size);
++ map->blocks_in_map, map->maximum_in_map, (unsigned int)map->media_size);
+ printf("Map is%s writeable", (map->writeable)?kStringEmpty:kStringNot);
+ printf(", but%s changed\n", (map->changed)?kStringEmpty:kStringNot);
+ printf("\n");
+@@ -426,7 +424,7 @@
+ for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
+ p = entry->data;
+ printf("%2d: %20.32s ",
+- entry->disk_address, p->dpme_type);
++ (int)entry->disk_address, p->dpme_type);
+ printf("%7u @ %-7u ", p->dpme_pblocks, p->dpme_pblock_start);
+ printf("%c%c%c%c%c%c%c%c%c%c ",
+ (dpme_valid_get(p))?'V':'v',
+@@ -449,7 +447,7 @@
+ "goto_address checksum processor\n");
+ for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
+ p = entry->data;
+- printf("%2d: ", entry->disk_address);
++ printf("%2d: ", (int)entry->disk_address);
+ printf("%7u ", p->dpme_boot_block);
+ printf("%7u ", p->dpme_boot_bytes);
+ printf("%8x ", p->dpme_load_addr);
+@@ -466,7 +464,7 @@
+ */
+ for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
+ p = entry->data;
+- printf("%2d: ", entry->disk_address);
++ printf("%2d: ", (int)entry->disk_address);
+
+ bp = (BZB *) (p->dpme_bzb);
+ j = -1;
+diff -Naur mac-fdisk-0.1.orig/errors.c mac-fdisk-0.1/errors.c
+--- mac-fdisk-0.1.orig/errors.c 1997-01-14 22:29:39.000000000 +0200
++++ mac-fdisk-0.1/errors.c 2004-05-28 23:13:02.016305152 +0300
+@@ -26,12 +26,11 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
+ #include <stdlib.h>
+-#endif
+ #include <string.h>
+ #include <stdarg.h>
+
++#include <errno.h>
+ #include "errors.h"
+ #include "pdisk.h"
+
+@@ -115,8 +114,8 @@
+ va_end(ap);
+
+ #ifdef __linux__
+- if (value > 0 && value < sys_nerr) {
+- fprintf(stderr, " (%s)\n", sys_errlist[value]);
++ if (value > 0 && value < errno) {
++ fprintf(stderr, " (%s)\n", strerror(value));
+ } else {
+ fprintf(stderr, "\n");
+ }
+@@ -144,8 +143,8 @@
+ va_end(ap);
+
+ #ifdef __linux__
+- if (value > 0 && value < sys_nerr) {
+- fprintf(stderr, " (%s)\n", sys_errlist[value]);
++ if (value > 0 && value < errno) {
++ fprintf(stderr, " (%s)\n", strerror(value));
+ } else {
+ fprintf(stderr, "\n");
+ }
+diff -Naur mac-fdisk-0.1.orig/fdisk.c mac-fdisk-0.1/fdisk.c
+--- mac-fdisk-0.1.orig/fdisk.c 2004-05-28 19:23:49.665358000 +0300
++++ mac-fdisk-0.1/fdisk.c 2004-05-28 23:08:05.861327040 +0300
+@@ -146,7 +146,8 @@
+ #include <setjmp.h>
+ #include <errno.h>
+ #include <endian.h>
+-
++#include <string.h>
++#include <sys/types.h>
+ #include <sys/ioctl.h>
+
+ #include "fdisk.h"
+@@ -1490,7 +1491,7 @@
+ }
+ }
+
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+ if (argc > 3)
+ fatal(usage);
+diff -Naur mac-fdisk-0.1.orig/fdisklabel.c mac-fdisk-0.1/fdisklabel.c
+--- mac-fdisk-0.1.orig/fdisklabel.c 2004-05-28 19:23:49.667358000 +0300
++++ mac-fdisk-0.1/fdisklabel.c 2004-05-28 23:05:53.467351208 +0300
+@@ -35,6 +35,7 @@
+ SUCH DAMAGE.
+ */
+
++#include <sys/types.h>
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -42,6 +43,7 @@
+ #include <ctype.h>
+ #include <setjmp.h>
+ #include <errno.h>
++#include <string.h>
+
+ #include <sys/ioctl.h>
+ #include <sys/param.h>
+@@ -264,8 +266,8 @@
+ fprintf(f, "type: %s\n", bsd_dktypenames[lp->d_type]);
+ else
+ fprintf(f, "type: %d\n", lp->d_type);
+- fprintf(f, "disk: %.*s\n", sizeof(lp->d_typename), lp->d_typename);
+- fprintf(f, "label: %.*s\n", sizeof(lp->d_packname), lp->d_packname);
++ fprintf(f, "disk: %.*s\n", (int)sizeof(lp->d_typename), lp->d_typename);
++ fprintf(f, "label: %.*s\n", (int)sizeof(lp->d_packname), lp->d_packname);
+ fprintf(f, "flags:");
+ if (lp->d_flags & BSD_D_REMOVABLE)
+ fprintf(f, " removable");
+@@ -274,17 +276,17 @@
+ if (lp->d_flags & BSD_D_BADSECT)
+ fprintf(f, " badsect");
+ fprintf(f, "\n");
+- fprintf(f, "bytes/sector: %d\n", lp->d_secsize);
+- fprintf(f, "sectors/track: %d\n", lp->d_nsectors);
+- fprintf(f, "tracks/cylinder: %d\n", lp->d_ntracks);
+- fprintf(f, "sectors/cylinder: %d\n", lp->d_secpercyl);
+- fprintf(f, "cylinders: %d\n", lp->d_ncylinders);
++ fprintf(f, "bytes/sector: %d\n", (int)lp->d_secsize);
++ fprintf(f, "sectors/track: %d\n", (int)lp->d_nsectors);
++ fprintf(f, "tracks/cylinder: %d\n", (int)lp->d_ntracks);
++ fprintf(f, "sectors/cylinder: %d\n", (int)lp->d_secpercyl);
++ fprintf(f, "cylinders: %d\n", (int)lp->d_ncylinders);
+ fprintf(f, "rpm: %d\n", lp->d_rpm);
+ fprintf(f, "interleave: %d\n", lp->d_interleave);
+ fprintf(f, "trackskew: %d\n", lp->d_trackskew);
+ fprintf(f, "cylinderskew: %d\n", lp->d_cylskew);
+- fprintf(f, "headswitch: %d\t\t# milliseconds\n", lp->d_headswitch);
+- fprintf(f, "track-to-track seek: %d\t# milliseconds\n", lp->d_trkseek);
++ fprintf(f, "headswitch: %d\t\t# milliseconds\n", (int)lp->d_headswitch);
++ fprintf(f, "track-to-track seek: %d\t# milliseconds\n", (int)lp->d_trkseek);
+ fprintf(f, "drivedata: ");
+ for (i = NDDATA - 1; i >= 0; i--)
+ if (lp->d_drivedata[i])
+@@ -292,7 +294,7 @@
+ if (i < 0)
+ i = 0;
+ for (j = 0; j <= i; j++)
+- fprintf(f, "%d ", lp->d_drivedata[j]);
++ fprintf(f, "%d ", (int)lp->d_drivedata[j]);
+ }
+ fprintf (f, "\n%d partitions:\n", lp->d_npartitions);
+ fprintf (f, "# size offset fstype [fsize bsize cpg]\n");
+@@ -300,7 +302,7 @@
+ for (i = 0; i < lp->d_npartitions; i++, pp++) {
+ if (pp->p_size) {
+ fprintf(f, " %c: %8d %8d ", 'a' + i,
+- pp->p_size, pp->p_offset);
++ (int)pp->p_size, (int)pp->p_offset);
+ if ((unsigned) pp->p_fstype < BSD_FSMAXTYPES)
+ fprintf(f, "%8.8s", bsd_fstypes[pp->p_fstype].name);
+ else
+@@ -309,12 +311,12 @@
+ {
+ case BSD_FS_UNUSED:
+ fprintf(f, " %5d %5d %5.5s ",
+- pp->p_fsize, pp->p_fsize * pp->p_frag, "");
++ (int)pp->p_fsize, (int)pp->p_fsize * pp->p_frag, "");
+ break;
+
+ case BSD_FS_BSDFFS:
+ fprintf(f, " %5d %5d %5d ",
+- pp->p_fsize, pp->p_fsize * pp->p_frag,
++ (int)pp->p_fsize, (int)pp->p_fsize * pp->p_frag,
+ pp->p_cpg);
+ break;
+
+@@ -324,21 +326,21 @@
+ }
+ fprintf(f, "\t# (Cyl. %4d",
+ #if 0
+- pp->p_offset / lp->d_secpercyl); /* differs from Linux fdisk */
++ (int)(pp->p_offset / lp->d_secpercyl)); /* differs from Linux fdisk */
+ #else
+- pp->p_offset / lp->d_secpercyl + 1);
++ (int)(pp->p_offset / lp->d_secpercyl + 1));
+ #endif
+ if (pp->p_offset % lp->d_secpercyl)
+ putc('*', f);
+ else
+ putc(' ', f);
+ fprintf(f, "- %d",
+- (pp->p_offset +
++ (int)((pp->p_offset +
+ pp->p_size + lp->d_secpercyl - 1) /
+ #if 0
+- lp->d_secpercyl - 1); /* differs from Linux fdisk */
++ lp->d_secpercyl - 1)); /* differs from Linux fdisk */
+ #else
+- lp->d_secpercyl);
++ lp->d_secpercyl));
+ #endif
+ if (pp->p_size % lp->d_secpercyl)
+ putc('*', f);
+diff -Naur mac-fdisk-0.1.orig/io.c mac-fdisk-0.1/io.c
+--- mac-fdisk-0.1.orig/io.c 2004-05-28 19:23:49.303279000 +0300
++++ mac-fdisk-0.1/io.c 2004-05-28 23:23:46.721284784 +0300
+@@ -26,15 +26,18 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
+ #include <stdlib.h>
++#ifndef __linux__
+ #include <fcntl.h>
+ #include <SCSI.h>
+ #else
+ #ifdef __GLIBC__
++#include <fcntl.h>
+ #include <sys/types.h>
++#include <sys/stat.h>
+ #endif
+ #endif
++#include <linux/unistd.h>
+ #include <unistd.h>
+ #include <string.h>
+ #include <stdarg.h>
+@@ -466,7 +469,7 @@
+ long t;
+
+ if (rflag) {
+- printf("Can't write block %u to file", num);
++ printf("Can't write block %u to file", (unsigned int)num);
+ return 0;
+ }
+ #ifndef __linux__
+diff -Naur mac-fdisk-0.1.orig/partition_map.c mac-fdisk-0.1/partition_map.c
+--- mac-fdisk-0.1.orig/partition_map.c 2004-05-28 19:23:49.314277000 +0300
++++ mac-fdisk-0.1/partition_map.c 2004-05-28 23:18:12.165286000 +0300
+@@ -26,12 +26,10 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
+ #include <stdlib.h>
+ #include <unistd.h>
+-#endif
+ #include <errno.h>
+-
++#include <string.h>
+ #include <fcntl.h>
+ #ifdef __linux__
+ #include <sys/ioctl.h>
+@@ -107,7 +105,6 @@
+ int fd;
+ partition_map_header * map;
+ int writeable;
+- unsigned long length;
+ #ifdef __linux__
+ struct stat info;
+ #endif
+@@ -404,9 +401,7 @@
+ {
+ int fd;
+ partition_map_header * map;
+- unsigned long length;
+ DPME *data;
+- int ok;
+ unsigned long number;
+ #ifdef __linux__
+ struct stat info;
+@@ -435,13 +430,13 @@
+ map->maximum_in_map = -1;
+
+ number = compute_device_size(fd);
+- printf("size of 'device' is %u blocks: ", number);
++ printf("size of 'device' is %u blocks: ", (unsigned int)number);
+ flush_to_newline(0);
+ get_number_argument("what should be the size? ", (long *)&number, number);
+ if (number < 4) {
+ number = 4;
+ }
+- printf("new size of 'device' is %u blocks\n", number);
++ printf("new size of 'device' is %u blocks\n", (unsigned int)number);
+ map->media_size = number;
+
+ #ifdef __linux__
+--- mac-fdisk-0.1/pdisk.c.orig 2004-05-29 02:34:15.833913144 -0500
++++ mac-fdisk-0.1/pdisk.c 2004-05-29 02:36:05.775975008 -0500
+@@ -28,12 +28,14 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <string.h>
++
+ #ifdef __linux__
+ #include <getopt.h>
+ #include <stddef.h>
+ #else
+-#include <stdlib.h>
+-#include <unistd.h>
+ #include <SIOUX.h>
+ #endif
+ #include <errno.h>
+@@ -437,7 +439,6 @@
+ {
+ long base;
+ long length;
+- long mult;
+ char *name;
+ char *type_name;
+
+@@ -599,7 +600,6 @@
+ void
+ do_reorder(partition_map_header *map)
+ {
+- partition_map * cur;
+ long old_index;
+ long index;
+
diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-ppc64.patch b/sys-fs/mac-fdisk/files/mac-fdisk-ppc64.patch
new file mode 100644
index 000000000000..1d0606f254e3
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/mac-fdisk-ppc64.patch
@@ -0,0 +1,121 @@
+Files mac-fdisk-0.1/fdisk and /root/mac-fdisk-0.1/fdisk differ
+diff -uNr mac-fdisk-0.1/fdisk.c /root/mac-fdisk-0.1/fdisk.c
+--- mac-fdisk-0.1/fdisk.c 2004-03-30 04:34:58.394924976 +0000
++++ /root/mac-fdisk-0.1/fdisk.c 2004-03-30 03:53:26.447986904 +0000
+@@ -59,9 +59,88 @@
+ */
+
+
++/* ----------- */
++#define _PPC64_TYPES_H
++#define BITS_PER_LONG 64
++
++typedef __signed__ char __s8;
++typedef signed char s8;
++typedef unsigned char u8;
++typedef unsigned char __u8;
++
++typedef __signed__ short __s16;
++typedef signed short s16;
++typedef unsigned short __u16;
++typedef unsigned short u16;
++
++typedef __signed__ int __s32;
++typedef signed int s32;
++typedef unsigned int __u32;
++typedef unsigned int u32;
++
++typedef __signed__ long __s64;
++typedef signed long s64;
++typedef unsigned long __u64;
++typedef unsigned long u64;
++
++typedef struct {
++ __u32 u[4];
++} __attribute((aligned(16))) __vector128;
++
++typedef __vector128 vector128;
++
++typedef u32 dma_addr_t;
++typedef u64 dma64_addr_t;
++
++typedef struct {
++ unsigned long entry;
++ unsigned long toc;
++ unsigned long env;
++} func_descr_t;
++
++typedef unsigned int umode_t;
++
++#define BITS_TO_LONGS(bits) \
++ (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
++#define DECLARE_BITMAP(name,bits) \
++ unsigned long name[BITS_TO_LONGS(bits)]
++#define CLEAR_BITMAP(name,bits) \
++ memset(name, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long))
++
++struct partition {
++ unsigned char boot_ind; /* 0x80 - active */
++ unsigned char head; /* starting head */
++ unsigned char sector; /* starting sector */
++ unsigned char cyl; /* starting cylinder */
++ unsigned char sys_ind; /* What partition type */
++ unsigned char end_head; /* end head */
++ unsigned char end_sector; /* end sector */
++ unsigned char end_cyl; /* end cylinder */
++ unsigned int start_sect; /* starting sector counting from 0 */
++ unsigned int nr_sects; /* nr of sectors in partition */
++} __attribute__((packed));
++
++
++struct hd_geometry {
++ unsigned char heads;
++ unsigned char sectors;
++ unsigned short cylinders;
++ unsigned long start;
++};
++
++/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
++#define HDIO_GETGEO 0x0301 /* get device geometry */
++
++#define BLKRRPART _IO(0x12,95) /* re-read partition table */
++
++/* ---------- */
++
++typedef unsigned short kdev_t; /* BAD hack; kdev_t is not exported */
++
++
+ #include <unistd.h>
+ #include <stdio.h>
+-#include <stdlib.h>
++#include <stdlib.h>
+ #include <fcntl.h>
+ #include <ctype.h>
+ #include <setjmp.h>
+@@ -70,14 +149,6 @@
+
+ #include <sys/ioctl.h>
+
+-#include <linux/types.h>
+-
+-typedef unsigned short kdev_t; /* BAD hack; kdev_t is not exported */
+-
+-#include <linux/genhd.h>
+-#include <linux/hdreg.h>
+-#include <linux/fs.h>
+-
+ #include "fdisk.h"
+
+ #define hex_val(c) ({ \
+Files mac-fdisk-0.1/fdisk.o and /root/mac-fdisk-0.1/fdisk.o differ
+diff -uNr mac-fdisk-0.1/fdisklabel.c /root/mac-fdisk-0.1/fdisklabel.c
+--- mac-fdisk-0.1/fdisklabel.c 2004-03-30 04:34:58.396924672 +0000
++++ /root/mac-fdisk-0.1/fdisklabel.c 2004-03-30 01:16:31.974999800 +0000
+@@ -46,6 +46,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/param.h>
+
++#include <asm/types.h>
+ #include <linux/hdreg.h>
+ #include <linux/fs.h>
+
diff --git a/sys-fs/mac-fdisk/mac-fdisk-0.1-r2.ebuild b/sys-fs/mac-fdisk/mac-fdisk-0.1-r2.ebuild
new file mode 100644
index 000000000000..cfcfb54b4941
--- /dev/null
+++ b/sys-fs/mac-fdisk/mac-fdisk-0.1-r2.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/mac-fdisk/mac-fdisk-0.1-r2.ebuild,v 1.1 2004/06/08 12:39:29 vapier Exp $
+
+inherit eutils
+
+DEBRV=10
+DESCRIPTION="Mac/PowerMac disk partitinoing utility"
+HOMEPAGE="ftp://ftp.mklinux.apple.com/pub/Other_Tools/"
+SRC_URI="http://http.us.debian.org/debian/pool/main/m/mac-fdisk/${PN}_${PV}.orig.tar.gz
+ http://http.us.debian.org/debian/pool/main/m/mac-fdisk/${PN}_${PV}-${DEBRV}.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~ppc ~ppc64"
+IUSE=""
+
+DEPEND="virtual/glibc"
+
+src_unpack() {
+ unpack mac-fdisk_${PV}.orig.tar.gz
+ mv mac-fdisk-${PV}.orig ${P}
+ cd ${S}
+ cat ${DISTDIR}/mac-fdisk_${PV}-${DEBRV}.diff.gz | gzip -dc | patch -p1 || die
+
+ # Hard code 2.4 headers in mac-fdisk itself - if no maintainer is found, macfdisk should
+ # be deprecated in favor or parted
+
+ use ppc && epatch ${FILESDIR}/mac-fdisk-ppc.patch
+ use ppc64 && epatch ${FILESDIR}/mac-fdisk-ppc64.patch
+
+ # this can be applied on ppc32 too:
+ use ppc64 && epatch ${FILESDIR}/mac-fdisk-ppc64-1.patch
+
+ cd ${WORKDIR}
+ chown -R 0:0 *
+ chmod -R a+r-w+X,u+w *
+}
+
+src_compile() {
+ emake || die
+}
+
+src_install() {
+ mv pdisk.8 pdisk.8.in
+ ln mac-fdisk.8.in mac-fdisk.8 || die
+ ln pmac-fdisk.8.in pmac-fdisk.8 || die
+ ln pdisk mac-fdisk || die
+ ln fdisk pmac-fdisk || die
+
+ into /
+ dosbin mac-fdisk pmac-fdisk || die
+
+ into /usr
+ doman mac-fdisk.8 pmac-fdisk.8
+ dodoc README HISTORY
+}
diff --git a/sys-fs/mac-fdisk/mac-fdisk-0.1.ebuild b/sys-fs/mac-fdisk/mac-fdisk-0.1.ebuild
new file mode 100644
index 000000000000..4f8b604cab63
--- /dev/null
+++ b/sys-fs/mac-fdisk/mac-fdisk-0.1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/mac-fdisk/mac-fdisk-0.1.ebuild,v 1.1 2004/06/08 12:39:29 vapier Exp $
+
+DEBRV=8
+DESCRIPTION="Mac/PowerMac disk partitinoing utility"
+HOMEPAGE="ftp://ftp.mklinux.apple.com/pub/Other_Tools/"
+SRC_URI="http://http.us.debian.org/debian/pool/main/m/mac-fdisk/${PN}_${PV}.orig.tar.gz
+ http://http.us.debian.org/debian/pool/main/m/mac-fdisk/${PN}_${PV}-${DEBRV}.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc ppc64"
+IUSE=""
+
+DEPEND="virtual/glibc"
+
+src_unpack() {
+ unpack mac-fdisk_${PV}.orig.tar.gz
+ mv mac-fdisk-${PV}.orig ${P}
+ cd ${S}
+ cat ${DISTDIR}/mac-fdisk_${PV}-${DEBRV}.diff.gz | gzip -dc | patch -p1 || die
+ cd ${WORKDIR}
+ chown -R 0:0 *
+ chmod -R a+r-w+X,u+w *
+}
+
+src_compile() {
+ emake || die
+}
+
+src_install() {
+ mv pdisk.8 pdisk.8.in
+ ln mac-fdisk.8.in mac-fdisk.8 || die
+ ln pmac-fdisk.8.in pmac-fdisk.8 || die
+ ln pdisk mac-fdisk || die
+ ln fdisk pmac-fdisk || die
+
+ into /
+ dosbin mac-fdisk
+ dosbin pmac-fdisk
+
+ into /usr
+ doman mac-fdisk.8 pmac-fdisk.8
+ dodoc README HISTORY
+}
diff --git a/sys-fs/mac-fdisk/metadata.xml b/sys-fs/mac-fdisk/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/mac-fdisk/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>