Add libmaa and dictd packages.
This commit is contained in:
Ayanokoji Takesi 2019-10-25 02:08:35 +09:00 committed by Leonid Pliushch
parent 410b0e1223
commit cfa29e328c
4 changed files with 169 additions and 0 deletions

7
packages/dictd/build.sh Normal file
View File

@ -0,0 +1,7 @@
TERMUX_PKG_HOMEPAGE=http://sourceforge.net/projects/dict/
TERMUX_PKG_DESCRIPTION="Online dictionary client and server"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=1.12.1
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/dict/dictd/dictd-${TERMUX_PKG_VERSION}/dictd-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=a237f6ecdc854ab10de5145ed42eaa2d9b6d51ffdc495f7daee59b05cc363656
TERMUX_PKG_DEPENDS="libmaa"

108
packages/dictd/dictd.patch Normal file
View File

@ -0,0 +1,108 @@
diff -u -r ../dictd-1.12.1.orig/Makefile.in ./Makefile.in
--- ../dictd-1.12.1.orig/Makefile.in 2011-03-07 02:52:54.000000000 +0900
+++ ./Makefile.in 2018-02-08 18:50:15.790039388 +0900
@@ -123,7 +123,7 @@
%: %.o
$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -static \
- $^ $(OBJS) $(LDFLAGS) -lz ${LIBS}
+ $(^:.o=.lo) $(OBJS) $(LDFLAGS) -lz ${LIBS}
include $(srcdir)/deps
diff -u -r ../dictd-1.12.1.orig/dictd.c ./dictd.c
--- ../dictd-1.12.1.orig/dictd.c 2011-01-10 01:53:27.000000000 +0900
+++ ./dictd.c 2018-02-08 18:50:19.980039386 +0900
@@ -75,7 +75,7 @@
const char *logFile = NULL;
int logFile_set; /* 1 if set by command line option */
-const char *pidFile = "/var/run/dictd.pid";
+const char *pidFile = "@TERMUX_PREFIX@/var/run/dictd.pid";
int pidFile_set; /* 1 if set by command line option */
const char *daemon_service = DICT_DEFAULT_SERVICE;
Only in .: dictd.patch
diff -u -r ../dictd-1.12.1.orig/net.c ./net.c
--- ../dictd-1.12.1.orig/net.c 2010-08-22 02:55:40.000000000 +0900
+++ ./net.c 2018-02-08 18:50:22.640039385 +0900
@@ -65,7 +65,9 @@
{
struct hostent *hostEntry;
struct servent *serviceEntry;
+ /*
struct protoent *protocolEntry;
+ */
struct sockaddr_in ssin;
int s;
int hosts = 0;
@@ -79,8 +81,10 @@
} else if (!(ssin.sin_port = htons(atoi(service))))
return NET_NOSERVICE;
+ /*
if (!(protocolEntry = getprotobyname("tcp")))
return NET_NOPROTOCOL;
+ */
if ((hostEntry = gethostbyname(host))) {
++hosts;
@@ -92,7 +96,7 @@
memcpy( &ssin.sin_addr.s_addr, *current, hostEntry->h_length );
PRINTF(DBG_VERBOSE,
("Trying %s (%s)\n",host,inet_ntoa(ssin.sin_addr)));
- if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0)
+ if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0)
err_fatal_errno( __func__, "Can't open socket on port %d\n",
ntohs(ssin.sin_port) );
if (connect(s, (struct sockaddr *)&ssin, sizeof(ssin)) >= 0)
@@ -100,7 +104,7 @@
close(s);
}
} else {
- if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0)
+ if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0)
err_fatal_errno( __func__, "Can't open socket on port %d\n",
ntohs(ssin.sin_port) );
if (connect(s, (struct sockaddr *)&ssin, sizeof(ssin)) >= 0)
@@ -117,7 +121,9 @@
int queueLength)
{
struct servent *serviceEntry;
+ /*
struct protoent *protocolEntry;
+ */
struct sockaddr_in ssin;
int s;
const int one = 1;
@@ -131,10 +137,12 @@
} else if (!(ssin.sin_port = htons(atoi(service))))
err_fatal( __func__, "Can't get \"%s\" service entry\n", service );
+ /*
if (!(protocolEntry = getprotobyname("tcp")))
err_fatal( __func__, "Can't get \"tcp\" protocol entry\n" );
+ */
- if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0)
+ if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0)
err_fatal_errno( __func__, "Can't open socket on port %d\n",
ntohs(ssin.sin_port) );
diff -u -r ../dictd-1.12.1.orig/parse.c ./parse.c
--- ../dictd-1.12.1.orig/parse.c 2008-12-08 01:50:05.000000000 +0900
+++ ./parse.c 2018-02-08 18:52:46.640039330 +0900
@@ -90,10 +90,9 @@
char *buffer;
const char **pt;
static const char *cpp = NULL;
- static const char *cpps[] = { "/lib/cpp",
- "/usr/lib/cpp",
- "/usr/ccs/lib/cpp", /* Solaris */
- "/usr/lang/cpp",
+ static const char *cpps[] = { "@TERMUX_PREFIX@/lib/cpp",
+ "@TERMUX_PREFIX@/ccs/lib/cpp", /* Solaris */
+ "@TERMUX_PREFIX@/lang/cpp",
0 };
static const char *extra_options = "";
FILE *tmp;

11
packages/libmaa/build.sh Normal file
View File

@ -0,0 +1,11 @@
TERMUX_PKG_HOMEPAGE=http://sourceforge.net/projects/dict/
TERMUX_PKG_DESCRIPTION="Provides many low-level data structures which are helpful for writing compilers"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=1.3.2
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/dict/libmaa/libmaa-${TERMUX_PKG_VERSION}/libmaa-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=59a5a01e3a9036bd32160ec535d25b72e579824e391fea7079e9c40b0623b1c5
termux_step_pre_configure() {
autoreconf -ivf
LDFLAGS+=" -llog"
}

View File

@ -0,0 +1,43 @@
diff -u -r ../libmaa-1.3.2.orig/Makefile.in ./Makefile.in
--- ../libmaa-1.3.2.orig/Makefile.in 2011-04-11 00:06:20.000000000 +0900
+++ ./Makefile.in 2018-02-10 00:15:25.508838999 +0900
@@ -27,6 +27,7 @@
.SUFFIXES:
.SUFFIXES: .c .o
+top_builddir= @top_builddir@
srcdir= @srcdir@
VPATH= @srcdir@
prefix= @prefix@
@@ -37,6 +38,7 @@
CC= @CC@
CPP= @CPP@
+LD= @LD@
LIBTOOL= @LIBTOOL@
INSTALL= @INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
@@ -136,9 +138,9 @@
$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS)
$(MAALIB): $(LIBOBJS)
- $(LIBTOOL) --tag=CC --mode=link ${CC} -o libmaa.la ${LIBOBJS:.o=.lo} \
+ $(LIBTOOL) --tag=CC --mode=link $(CC) -o libmaa.la $(LIBOBJS:.o=.lo) \
$(LDFLAGS) $(LIBS) \
- -rpath "${libdir}" -export-symbols ${srcdir}/export.sym \
+ -rpath $(libdir) -export-symbols $(srcdir)/export.sym \
-version-info 3:0
$(LIBOBJS): $(HEADERS) # version.stamp # don't automatically bump version
diff -u -r ../libmaa-1.3.2.orig/configure.in ./configure.in
--- ../libmaa-1.3.2.orig/configure.in 2012-07-22 23:47:18.000000000 +0900
+++ ./configure.in 2018-02-10 00:15:25.508838999 +0900
@@ -38,7 +38,7 @@
AC_CANONICAL_HOST
AC_PROG_AWK
AC_PROG_CC
-#AC_PROG_LIBTOOL
+AC_PROG_LIBTOOL
AC_ISC_POSIX
if test "$CC" = gcc; then