Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add libmaa and update dictd #162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions devel/libmaa/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
COMMENT = library required by dictd-server and dictd-client.

DISTNAME = libmaa-1.4.7

CATEGORIES = devel

SHARED_LIBS += maa 4.0 # 4.0

HOMEPAGE = http://www.dict.org

MAINTAINER = Moritz Buhl <mbuhl@openbsd.org>

# MIT
PERMIT_PACKAGE = Yes

MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=dict/}

CONFIGURE_STYLE = none

WRKSRC = ${WRKDIST}/maa
MAKE_ENV = SRCDIR_maa=${WRKSRC}
FAKE_FLAGS = LIBDIR=${LOCALBASE}/lib

.include <bsd.port.mk>
2 changes: 2 additions & 0 deletions devel/libmaa/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SHA256 (libmaa-1.4.7.tar.gz) = TgGp68XZa8koS2cGqoK93CoRBH+pvQLpTPh1PsfcuY4=
SIZE (libmaa-1.4.7.tar.gz) = 173728
9 changes: 9 additions & 0 deletions devel/libmaa/patches/patch-maa_Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Index: maa/Makefile
--- maa/Makefile.orig
+++ maa/Makefile
@@ -47,4 +47,4 @@ EXPORT_SYMBOLS = export.sym

##################################################

-.include <mkc.lib.mk>
+.include <bsd.lib.mk>
44 changes: 44 additions & 0 deletions devel/libmaa/patches/patch-maa_bit_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Index: maa/bit.c
--- maa/bit.c.orig
+++ maa/bit.c
@@ -59,24 +59,21 @@ int bit_cnt(unsigned long *flags)
{
unsigned long x = *flags;

-#if SIZEOF_LONG == 4
- x = (x >> 1 & 0x55555555) + (x & 0x55555555);
- x = ((x >> 2) & 0x33333333) + (x & 0x33333333);
- x = ((x >> 4) + x) & 0x0f0f0f0f;
- x = ((x >> 8) + x);
- return (x + (x >> 16)) & 0xff;
-#else
-#if SIZEOF_LONG == 8
- x = (x >> 1 & 0x5555555555555555) + (x & 0x5555555555555555);
- x = ((x >> 2) & 0x3333333333333333) + (x & 0x3333333333333333);
- x = ((x >> 4) + x) & 0x0f0f0f0f0f0f0f0f;
- x = ((x >> 8) + x) & 0x00ff00ff00ff00ff;
- x = ((x >> 16) + x) & 0x0000ffff0000ffff;
- return (x + (x >> 32)) & 0xff;
-#else
- err_internal(__func__,
+ if (sizeof(long) == 4) {
+ x = (x >> 1 & 0x55555555) + (x & 0x55555555);
+ x = ((x >> 2) & 0x33333333) + (x & 0x33333333);
+ x = ((x >> 4) + x) & 0x0f0f0f0f;
+ x = ((x >> 8) + x);
+ return (x + (x >> 16)) & 0xff;
+ } else if(sizeof(long) == 8) {
+ x = (x >> 1 & 0x5555555555555555) + (x & 0x5555555555555555);
+ x = ((x >> 2) & 0x3333333333333333) + (x & 0x3333333333333333);
+ x = ((x >> 4) + x) & 0x0f0f0f0f0f0f0f0f;
+ x = ((x >> 8) + x) & 0x00ff00ff00ff00ff;
+ x = ((x >> 16) + x) & 0x0000ffff0000ffff;
+ return (x + (x >> 32)) & 0xff;
+ } else
+ err_internal(__func__,
"Implemented for 32-bit and 64-bit longs, not %d-bit longs",
- SIZEOF_LONG * 8);
-#endif
-#endif
+ sizeof(long) * 8);
}
12 changes: 12 additions & 0 deletions devel/libmaa/patches/patch-maa_timer_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Index: maa/timer.c
--- maa/timer.c.orig
+++ maa/timer.c
@@ -29,6 +29,8 @@
*
*/

+#include <sys/resource.h>
+
#include "maaP.h"

static hsh_HashTable _tim_Hash;
9 changes: 9 additions & 0 deletions devel/libmaa/pkg/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The libmaa library provides many low-level data structures which are
helpful for writing compilers, including hash tables, sets, lists,
debugging support, and memory management. Although libmaa was designed
and implemented as a foundation for the Khepera Transformation System,
the data structures are generally applicable to a wide range of programming
problems.

The memory management routines are especially helpful for improving the
performance of memory-intensive applications.
3 changes: 3 additions & 0 deletions devel/libmaa/pkg/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@static-lib lib/libmaa.a
@lib lib/libmaa.so.${LIBmaa_VERSION}
@static-lib lib/libmaa_p.a
40 changes: 40 additions & 0 deletions net/dictd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
COMMENT-main= Dictionary Server Protocol client
COMMENT-server= Dictionary Server Protocol server

V= 1.13.1
DISTNAME= dictd-$V

PKGNAME-main= dictd-client-$V
PKGNAME-server= dictd-server-$V
#REVISION-main= 3
#REVISION-server=1

CATEGORIES= net education

HOMEPAGE= http://www.dict.org
MAINTAINER = Moritz Buhl <mbuhl@openbsd.org>

# GPL v2
PERMIT_PACKAGE= Yes
WANTLIB= c z maa

LIB_DEPENDS= devel/libmaa

MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=dict/}

USE_GMAKE= Yes
CONFIGURE_STYLE=gnu
CONFIGURE_ARGS= --prefix=${PREFIX}

CFLAGS += -I${LOCALBASE}/include

MULTI_PACKAGES= -main -server

NO_TEST= Yes

post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/dictd/
${INSTALL_DATA} ${WRKSRC}/examples/* \
${PREFIX}/share/examples/dictd

.include <bsd.port.mk>
2 changes: 2 additions & 0 deletions net/dictd/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SHA256 (dictd-1.13.1.tar.gz) = 5PGmfRaJTYSUVp19yUQsFcw4wBHyuWMcfxzGInZlKhs=
SIZE (dictd-1.13.1.tar.gz) = 395619
12 changes: 12 additions & 0 deletions net/dictd/patches/patch-configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Index: configure
--- configure.orig
+++ configure
@@ -4447,7 +4447,7 @@ if ${ac_cv_lib_maa_maa_shutdown+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmaa $LIBS"
+LIBS="-L/usr/local/lib -lmaa $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

12 changes: 12 additions & 0 deletions net/dictd/patches/patch-dict_h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Index: dict.h
--- dict.h.orig
+++ dict.h
@@ -22,7 +22,7 @@
#define _DICT_H_

#include "dictP.h"
-#include "maa.h"
+#include <maa.h>
#include "zlib.h"
#include "net.h"
#include "codes.h"
12 changes: 12 additions & 0 deletions net/dictd/patches/patch-dictd_h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
endex: dictd.h
--- dictd.h.orig
+++ dictd.h
@@ -23,7 +23,7 @@
#define _DICTD_H_

#include "dictP.h"
-#include "maa.h"
+#include <maa.h>
#include "codes.h"
#include "defs.h"

6 changes: 6 additions & 0 deletions net/dictd/pkg/DESCR-main
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The Dictionary Server Protocol (DICT) is a TCP transaction based
query/response protocol that allows a client to access dictionary
definitions from a set of natural language dictionary databases.

This package contains a client which can access DICT servers from
the command line.
2 changes: 2 additions & 0 deletions net/dictd/pkg/DESCR-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This package contains server implementing the Dictionary Server Protocol
(DICT) described in RFC 2229.
10 changes: 10 additions & 0 deletions net/dictd/pkg/PLIST-main
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@conflict p5-Net-Dict-*
@pkgpath net/dictd
@bin bin/dict
bin/dict_lookup
bin/dictl
@man man/man1/dict.1
@man man/man1/dict_lookup.1
@man man/man1/dictl.1
share/examples/dictd/
share/examples/dictd/dict1.conf
28 changes: 28 additions & 0 deletions net/dictd/pkg/PLIST-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
bin/colorit
bin/dictdplugin-config
@bin bin/dictfmt
bin/dictfmt_index2suffix
bin/dictfmt_index2word
bin/dictunformat
@bin bin/dictzip
include/dictdplugin.h
@man man/man1/colorit.1
@man man/man1/dictfmt.1
@man man/man1/dictfmt_index2suffix.1
@man man/man1/dictfmt_index2word.1
@man man/man1/dictunformat.1
@man man/man1/dictzip.1
@man man/man8/dictd.8
@bin sbin/dictd
share/examples/dictd/
share/examples/dictd/dictd1.conf
share/examples/dictd/dictd2.conf
share/examples/dictd/dictd3.conf
share/examples/dictd/dictd4.conf
share/examples/dictd/dictd_complex.conf
share/examples/dictd/dictd_mime.conf
share/examples/dictd/dictd_plugin_dbi.conf
share/examples/dictd/dictd_popen.conf
share/examples/dictd/dictd_popen.conf.in
share/examples/dictd/dictd_site.txt
share/examples/dictd/dictd_virtual.conf