aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2003-06-14 05:17:18 +0800
committerkris <kris@FreeBSD.org>2003-06-14 05:17:18 +0800
commitc1929c6c5ae9ab78fb11f759ec608c83572a89d3 (patch)
treed5b60e7f56947b34c1f7690dd59bd3baf1dff610
parente636eae5a4e49e63f6020a7821eb3c5065c9ecd4 (diff)
downloadfreebsd-ports-gnome-c1929c6c5ae9ab78fb11f759ec608c83572a89d3.tar.gz
freebsd-ports-gnome-c1929c6c5ae9ab78fb11f759ec608c83572a89d3.tar.zst
freebsd-ports-gnome-c1929c6c5ae9ab78fb11f759ec608c83572a89d3.zip
Use mkstemp() for tempfile handling instead of tmpnam() [1]
Respect CC and CFLAGS. Bump PORTREVISION. Obtained from: OpenBSD [1]
-rw-r--r--comms/bpl+/Makefile1
-rw-r--r--comms/bpl+/files/patch-Makefile15
-rw-r--r--comms/bpl+/files/patch-bplexec.c50
-rw-r--r--comms/bpl+/files/patch-config.sh30
4 files changed, 96 insertions, 0 deletions
diff --git a/comms/bpl+/Makefile b/comms/bpl+/Makefile
index 4751ee591881..573b7fd493d9 100644
--- a/comms/bpl+/Makefile
+++ b/comms/bpl+/Makefile
@@ -7,6 +7,7 @@
PORTNAME= bpl+
PORTVERSION= 1.0
+PORTREVISION= 1
CATEGORIES= comms
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= max
diff --git a/comms/bpl+/files/patch-Makefile b/comms/bpl+/files/patch-Makefile
new file mode 100644
index 000000000000..2b157ca235c7
--- /dev/null
+++ b/comms/bpl+/files/patch-Makefile
@@ -0,0 +1,15 @@
+--- Makefile.orig Fri Jun 13 14:13:23 2003
++++ Makefile Fri Jun 13 14:13:43 2003
+@@ -4,11 +4,9 @@
+ # USE_MKTIME use mktime instead of timelocal
+ #
+ MAKE = make
+-CC = gcc
+-OPTFLAG = -O $(OPTS)
+ OBJS = bpl.o bplexec.o rsraw.o
+
+-CFLAGS = $(OPTFLAG) $(FLAG1) $(FLAG2)
++CFLAGS += $(FLAG1) $(FLAG2)
+
+ all:
+ @sh config.sh
diff --git a/comms/bpl+/files/patch-bplexec.c b/comms/bpl+/files/patch-bplexec.c
new file mode 100644
index 000000000000..9830a08aa22a
--- /dev/null
+++ b/comms/bpl+/files/patch-bplexec.c
@@ -0,0 +1,50 @@
+--- bplexec.c.orig Thu Feb 9 17:25:34 1995
++++ bplexec.c Wed Nov 15 20:45:53 2000
+@@ -17,6 +17,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
++#include <errno.h>
+
+ #include "bpl.h"
+ #include "machine.h"
+@@ -1096,7 +1097,7 @@
+
+ fname_w_index = strlen(fname_work);
+ if (copy_body(s)) { /* ファイル名異常 */
+- strcpy(fname_work, tmpnam(NULL));
++ strcpy(fname_work, "/tmp/bpl.XXXXXXXXXX");
+ }
+
+ my_free(real_filename);
+@@ -1118,16 +1119,19 @@
+ FILE *fp;
+ UCHAR *my_tmp;
+ char *tmp;
++ int fd;
+
+- tmp = tmpnam(NULL);
++ tmp = "/tmp/bpl.XXXXXXXXXX";
+ my_tmp = (UCHAR *) malloc(strlen(tmp) + 1);
+ if (my_tmp == NULL)
+ return NULL;
+ strcpy(my_tmp, tmp);
+
+- fp = fopen(tmp, "wb");
+- if (fp == NULL) {
++ if ((fd = mkstemp(my_tmp)) == -1 ||
++ (fp = fdopen(fd, "wb")) == NULL ) {
++ fprintf(stderr, "%s: %s\n", my_tmp, strerror(errno));
+ free(my_tmp);
++ return NULL;
+ } else {
+ /* ディレクトリは current を使う */
+ strwarn(STR_CANT_CREATE_L); /* 「ファイルが作成できないので」 */
+@@ -1136,6 +1140,7 @@
+ strwarn(STR_CANT_CREATE_R);
+ my_free(real_filename);
+ real_filename = my_tmp;
++ close(fd);
+ }
+ return fp;
+ }
diff --git a/comms/bpl+/files/patch-config.sh b/comms/bpl+/files/patch-config.sh
new file mode 100644
index 000000000000..07febcb06085
--- /dev/null
+++ b/comms/bpl+/files/patch-config.sh
@@ -0,0 +1,30 @@
+--- config.sh.orig Fri Jun 13 14:14:53 2003
++++ config.sh Fri Jun 13 14:15:18 2003
+@@ -8,27 +8,6 @@
+ exit
+ fi
+
+-# check compiler
+-CC=cc
+-#type
+-#if [ $? = 1 ]; then
+- # Ultrix
+- for file in `echo $PATH|sed 's/:/ /g'`
+- do
+- if [ -f $file/gcc ]; then
+- CC=gcc
+- OPTS=-g
+- break
+- fi
+- done
+-#else
+-# set `type gcc`
+-# if [ $1 = gcc ]; then
+-# CC=$3
+-# OPTS=-g
+-# fi
+-#fi
+-
+ if [ -f /usr/include/utime.h ]; then
+ FUTIME="-DHAME_UTIME_H"
+ fi