Convert/update arc to working recipe

--HG--
rename : app-arch/arc/arc-5.21o.recipe => app-arch/arc/arc-5.21p.recipe
This commit is contained in:
Chris Roberts
2013-11-24 20:53:40 -07:00
parent 3101433d7c
commit 94a40407a0
4 changed files with 88 additions and 154 deletions

View File

@@ -1,23 +0,0 @@
DESCRIPTION="Create & extract files from DOS .ARC files"
HOMEPAGE="http://arc.sourceforge.net/"
SRC_URI="http://sunet.dl.sourceforge.net/project/arc/arc/arc-5.21o/arc-5.21o.tgz"
CHECKSUM_MD5="3b30c739b42b2fe8ac4ec0a05f34f284"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD()
{
cd arc-5.21o
make
}
INSTALL()
{
cd arc-5.21o
install arc --prefix={$DESTDIR}`finddir B_COMMON_DIRECTORY`
install marc --prefix={$DESTDIR}`finddir B_COMMON_DIRECTORY`
install arc.1 {$DESTDIR}`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man1
}
LICENSE="GNU GPL v2"
COPYRIGHT="1985-2009 Thom Henderson"

View File

@@ -0,0 +1,43 @@
SUMMARY="Create & extract files from DOS .ARC files"
DESCRIPTION="Create & extract files from DOS .ARC files"
HOMEPAGE="http://arc.sourceforge.net/"
LICENSE="GNU GPL v2"
COPYRIGHT="1985-2009 Thom Henderson"
SRC_URI="http://sourceforge.net/projects/arc/files/arc/arc-5.21p/arc-5.21p.tar.gz"
CHECKSUM_MD5="902ce24b23422880d474df6f1d9eba5e"
REVISION="1"
ARCHITECTURES="x86 ?x86_gcc2 ?x86_64"
PATCHES="arc-5.21p.patchset"
PROVIDES="
arc = $portVersion
cmd:arc = $portVersion
cmd:marc = $portVersion
"
REQUIRES="
haiku >= $haikuVersion
"
BUILD_PREREQUIRES="
haiku_devel >= $haikuVersion
"
BUILD_REQUIRES="
cmd:make
cmd:gcc
"
BUILD()
{
make
}
INSTALL()
{
mkdir -p $binDir
cp -af arc marc $binDir
mkdir -p $manDir/man1
cp -af arc.1 marc.1 $manDir/man1
}

View File

@@ -1,131 +0,0 @@
diff -Naur arc-5.21o.orig/Makefile arc-5.21o/Makefile
--- arc-5.21o.orig/Makefile 2009-11-23 21:01:04.000000000 +0000
+++ arc-5.21o/Makefile 2009-11-23 21:59:58.000000000 +0000
@@ -38,14 +38,14 @@
#SYSTEM = -DBSD=1
SYSTEM = -DSYSV=1
-OPT = -O
+OPT = -O2 -DNEED_ALPHASORT
# For MWC 3.0 on the Atari ST, use:
#CFLAGS = -VCOMPAC -VPEEP
CFLAGS = $(OPT) $(SYSTEM)
# GNU's gcc is very nice, if you've got it. Otherwise just cc.
#CC = cgcc -mshort -mbaserel
-CC = cc
+#CC = cc
# tmclock is only needed on Unix systems...
TMCLOCK = tmclock.o
diff -Naur arc-5.21o.orig/arcdos.c arc-5.21o/arcdos.c
--- arc-5.21o.orig/arcdos.c 2009-11-23 21:01:04.000000000 +0000
+++ arc-5.21o/arcdos.c 2009-11-23 21:26:18.000000000 +0000
@@ -33,7 +33,7 @@
#if BSD
#include <sys/time.h>
#else
-#include <time.h> /* Sys V. Bleah. */
+#include <sys/time.h> /* Sys V. Bleah. */
#if NEED_TIMEVAL
struct timeval {
long tv_sec;
diff -Naur arc-5.21o.orig/arcmisc.c arc-5.21o/arcmisc.c
--- arc-5.21o.orig/arcmisc.c 2009-11-23 21:01:04.000000000 +0000
+++ arc-5.21o/arcmisc.c 2009-11-23 22:22:03.000000000 +0000
@@ -8,6 +8,8 @@
#include "arc.h"
#include <string.h>
+#include <dirent.h>
+#include <errno.h>
#if BSD
#include <strings.h>
#endif
@@ -211,6 +213,73 @@
#endif
+#if UNIX
+
+#define DIRSIZ(d) (sizeof(struct dirent) + strlen(d->d_name) + 1)
+#define INITIAL_SIZE 30
+
+int
+scandir(name, dirlist, selector, sorter)
+ const char *name;
+ struct dirent ***dirlist;
+ int (*selector)();
+ int (*sorter)();
+{
+ static struct dirent *E;
+ struct dirent **names;
+ DIR *Dp;
+ int i;
+ int size = INITIAL_SIZE;
+
+ if (!(names = (struct dirent **) malloc(size * sizeof names[0])) ||
+ access(name, R_OK | X_OK) || !(Dp = opendir(name)))
+ return -1;
+
+ /* Read entries in the directory. */
+
+ for (i = 0; (E = readdir(Dp)); )
+ if (selector == NULL || (*selector)(E))
+ {
+ /* User wants them all, or he wants this one. */
+ if (++i >= size)
+ {
+ size <<= 1;
+ names = (struct dirent **) realloc(names,
+ size * sizeof names[0]);
+ if (names == NULL)
+ {
+ closedir(Dp);
+ free(&names);
+ return(-1);
+ }
+ }
+
+ /* Copy the entry. */
+ names[i - 1] = (struct dirent *) malloc(DIRSIZ(E));
+ if (names[i - 1] == NULL)
+ {
+ closedir(Dp);
+ free(&names);
+ return(-1);
+ }
+ strcpy(names[i - 1]->d_name, E->d_name);
+ }
+
+ /* Close things off. */
+ names = (struct dirent **) realloc(names,
+ (i + 1) * sizeof names[0]);
+ names[i] = 0;
+ *dirlist = names;
+ closedir(Dp);
+
+ /* Sort? */
+ if (i && sorter)
+ qsort((char *)names, i, sizeof names[0], sorter);
+
+ return i;
+}
+#endif
+
VOID
upper(string)
char *string;
@@ -309,9 +378,10 @@
static char **NameList;
static char namecopy[STRLEN], *dirname;
#if UNIX
- int alphasort();
- int scandir();
+ //int alphasort();
+ //int scandir();
#endif /* UNIX */
+
int fmatch();
static int Nnum = 0, ii;

View File

@@ -0,0 +1,45 @@
From 6a8719729899cb89bdd1ae5602ab882eb832644e Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sun, 24 Nov 2013 18:37:38 -0700
Subject: Minor Haiku fixes
diff --git a/Makefile b/Makefile
index c6273d0..d4b6a86 100644
--- a/Makefile
+++ b/Makefile
@@ -39,9 +39,9 @@ PROG =
# (See the Sysvarcstuf shar file)
#SYSTEM = -DGEMDOS=1 -fstrength-reduce -fomit-frame-pointer -finline-functions -fdefer-pop -mpcrel
#SYSTEM = -DBSD=1
-SYSTEM = -DSYSV=1
+SYSTEM = -DSYSV=1 -DHAIKU=1
-OPT = -O -Wall
+OPT = -O2 -Wall
# For MWC 3.0 on the Atari ST, use:
#CFLAGS = -VCOMPAC -VPEEP
CFLAGS = $(OPT) $(SYSTEM)
@@ -137,4 +137,4 @@ install: all
install -s -m 0755 -D marc $(DESTDIR)$(PREFIX)/bin/marc
install -m 0644 -D arc.1 $(DESTDIR)$(PREFIX)/share/man/man1/arc.1
install -m 0644 -D marc.1 $(DESTDIR)$(PREFIX)/share/man/man1/marc.1
-
\ No newline at end of file
+
diff --git a/arcdos.c b/arcdos.c
index a47e6f1..4743ac3 100644
--- a/arcdos.c
+++ b/arcdos.c
@@ -30,7 +30,7 @@
#if UNIX
#include <sys/types.h>
#include <sys/stat.h>
-#if BSD
+#if BSD || HAIKU
#include <sys/time.h>
#else
#include <time.h> /* Sys V. Bleah. */
--
1.8.3.4