new package: gopher

This commit is contained in:
Tee KOBAYASHI 2022-03-04 10:39:46 +09:00 committed by xtkoba
parent fdc4fc240e
commit cc2ea67b5b
5 changed files with 94 additions and 0 deletions

View File

@ -0,0 +1,9 @@
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -292,5 +292,5 @@
WAISINCLUDES = -I@top_srcdir@/wais -I../ui
INCLUDES = -I@top_srcdir@ -I@top_srcdir@/object
-LDFLAGS = -L../object
+LDFLAGS += -L../object
SHELL = /bin/sh

14
packages/gopher/build.sh Normal file
View File

@ -0,0 +1,14 @@
TERMUX_PKG_HOMEPAGE=gopher://gopher.quux.org/1/devel/gopher
TERMUX_PKG_DESCRIPTION="University of Minnesota gopher"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.0.17.3
TERMUX_PKG_SRCURL=http://archive.ubuntu.com/ubuntu/pool/universe/g/gopher/gopher_${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=584b4ffeaa5221bab94bc4934b644f64df35c955e7720f3cfff648072eb0370b
TERMUX_PKG_DEPENDS="ncurses"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_pre_configure() {
CFLAGS+=" $CPPFLAGS"
LDFLAGS+=" -lncursesw"
}

View File

@ -0,0 +1,20 @@
--- a/conf.h
+++ b/conf.h
@@ -480,7 +480,7 @@
#endif
#ifndef MAIL_COMMAND
-#define MAIL_COMMAND "/bin/mail"
+#define MAIL_COMMAND "@TERMUX_PREFIX@/bin/mail"
#endif
#ifndef TELNET_COMMAND
@@ -496,7 +496,7 @@
#endif
#ifndef PLAY_COMMAND
-#define PLAY_COMMAND "/bin/false"
+#define PLAY_COMMAND "@TERMUX_PREFIX@/bin/false"
#endif
#ifndef MIME_COMMAND

View File

@ -0,0 +1,13 @@
--- a/gopher/download.c
+++ b/gopher/download.c
@@ -271,8 +271,8 @@
return;
}
#else
- if (chdir("/tmp")!=0) {
- CursesErrorMsg(Gtxt("Can't write to the /tmp directory!",70));
+ if (chdir("@TERMUX_PREFIX@/tmp")!=0) {
+ CursesErrorMsg(Gtxt("Can't write to the @TERMUX_PREFIX@/tmp directory!",70));
return;
}
#endif

View File

@ -0,0 +1,38 @@
--- a/gopher/gopher.c
+++ b/gopher/gopher.c
@@ -1056,7 +1056,7 @@
FILE *tmpfile;
char inputline[512];
char *view = NULL;
- char mkstemp_template[] = "/tmp/gopher-XXXXXX";
+ char mkstemp_template[] = "@TERMUX_PREFIX@/tmp/gopher-XXXXXX";
int mkstemp_fd = -1;
boolean WritePipe = FALSE,
ForkOff = FALSE;
@@ -1109,7 +1109,7 @@
tmpfilename = strdup(mkstemp_template);
tmpfile = fdopen(mkstemp_fd, "w");
#else /* ! HAVE_MKSTEMP */
- tmpfilename = tempnam("/tmp","gopher");
+ tmpfilename = tempnam("@TERMUX_PREFIX@/tmp","gopher");
tmpfile = fopen(tmpfilename, "w");
#endif /* HAVE_MKSTEMP */
#endif /* VMS */
@@ -3060,7 +3060,7 @@
{
char *tmpfilename;
- char mkstemp_template[] = "/tmp/gopher-XXXXXX";
+ char mkstemp_template[] = "@TERMUX_PREFIX@/tmp/gopher-XXXXXX";
int mkstemp_fd = -1;
FILE *tmpfile;
Blockobj *bl;
@@ -3092,7 +3092,7 @@
Gopenfile = tmpfilename;
tmpfile = fdopen(mkstemp_fd, "w");
#else /* ! HAVE_MKSTEMP */
- Gopenfile = tmpfilename = tempnam("/tmp", "gopher");
+ Gopenfile = tmpfilename = tempnam("@TERMUX_PREFIX@/tmp", "gopher");
tmpfile = fopen(tmpfilename, "w");
#endif /* HAVE_MKSTEMP */
#endif /* VMS */