pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Add wip/dict-server-current
Module Name: pkgsrc-wip
Committed By: Aleksey Cheusov <vle%gmx.net@localhost>
Pushed By: cheusov
Date: Fri Dec 1 21:49:57 2023 +0400
Changeset: a0fc0d986f89e42688d920325303d87283016bb6
Modified Files:
Makefile
Added Files:
dict-server-current/DESCR
dict-server-current/Makefile
dict-server-current/PLIST
dict-server-current/files/dictd.conf
dict-server-current/files/dictd.sh
Log Message:
Add wip/dict-server-current
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=a0fc0d986f89e42688d920325303d87283016bb6
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 1 +
dict-server-current/DESCR | 13 +++++++
dict-server-current/Makefile | 55 +++++++++++++++++++++++++++
dict-server-current/PLIST | 22 +++++++++++
dict-server-current/files/dictd.conf | 74 ++++++++++++++++++++++++++++++++++++
dict-server-current/files/dictd.sh | 31 +++++++++++++++
6 files changed, 196 insertions(+)
diffs:
diff --git a/Makefile b/Makefile
index a0b080914c..9beaae7019 100644
--- a/Makefile
+++ b/Makefile
@@ -641,6 +641,7 @@ SUBDIR+= dfam
SUBDIR+= dhcpd-snmp
SUBDIR+= diablo
SUBDIR+= dict-client-current
+SUBDIR+= dict-server-current
SUBDIR+= dict-est-rus
SUBDIR+= dict-freedict-eng-ara
SUBDIR+= dict-freedict-eng-fra
diff --git a/dict-server-current/DESCR b/dict-server-current/DESCR
new file mode 100644
index 0000000000..ad20900860
--- /dev/null
+++ b/dict-server-current/DESCR
@@ -0,0 +1,13 @@
+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.
+
+dictd(8) is a server which supports the DICT protocol.
+
+dictzip(1) is a compression program which creates compressed files in the
+gzip format (see RFC 1952). However, unlike gzip(1), dictzip(1) compresses
+the file in pieces and stores an index to the pieces in the gzip header.
+This allows random access to the file at the granularity of the compressed
+pieces (currently about 64kB) while maintaining good compression ratios
+(within 5% of the expected ratio for dictionary data). dictd(8) uses files
+stored in this format.
diff --git a/dict-server-current/Makefile b/dict-server-current/Makefile
new file mode 100644
index 0000000000..7329d7cdc7
--- /dev/null
+++ b/dict-server-current/Makefile
@@ -0,0 +1,55 @@
+# $NetBSD
+
+PKGNAME= dict-server-2.0.0
+CATEGORIES= textproc
+
+MAINTAINER= cheusov%NetBSD.org@localhost
+HOMEPAGE= https://github.com/cheusov/dictd
+COMMENT= Dictionary Service Protocol server
+LICENSE= gnu-gpl-v2
+
+.include "../../mk/bsd.prefs.mk"
+
+GIT_REPOSITORIES= dictd
+GIT_REPO.dictd= https://github.com/cheusov/dictd.git
+
+USE_TOOLS+= yacc lex m4:run
+TOOL_DEPENDS+= mk-configure>=0.38.2:../../devel/mk-configure
+
+DICTD_USER?= dictd
+.if ${OPSYS} == "Interix"
+DICTD_GROUP?= nogroup
+.else
+DICTD_GROUP?= dictd
+.endif
+
+PKG_GROUPS= ${DICTD_GROUP}
+PKG_USERS= ${DICTD_USER}:${DICTD_GROUP}
+PKG_GECOS.${DICTD_USER}= Dictionary\ protocol\ server\ user
+#PKG_HOME.${DICT_USER}= /nonexistent
+#PKG_SHELL.${DICT_USER}= ${NOLOGIN}
+
+RCD_SCRIPTS= dictd
+
+# for -L /var/log/dictd/<filename_or_pattern>
+OWN_DIRS_PERMS= ${VARBASE}/log/dictd dictd dictd 0750
+
+WRKSRC = ${WRKDIR}/dictd
+EGDIR = ${PREFIX}/share/examples/dictd
+
+CONF_FILES= ${EGDIR}/dictd.conf \
+ ${PKG_SYSCONFDIR}/dictd.conf
+
+CONFIGURE_TARGET= configure-dictd configure-dictzip configure-dictfmt
+BUILD_TARGET= all-dictd all-dictzip all-dictfmt
+INSTALL_TARGET= install-dictd install-dictzip install-dictfmt
+
+post-install:
+ ${INSTALL_DATA} ${.CURDIR}/files/dictd.conf ${DESTDIR}${EGDIR}/
+
+.include "../../devel/mk-configure/mk-c.mk"
+.include "../../devel/libmaa/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+
+.include "../../wip/mk/git-package.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/dict-server-current/PLIST b/dict-server-current/PLIST
new file mode 100644
index 0000000000..7918647a9d
--- /dev/null
+++ b/dict-server-current/PLIST
@@ -0,0 +1,22 @@
+@comment $NetBSD: PLIST,v 1.9 2014/03/11 14:05:17 jperkin Exp $
+bin/dictfmt
+bin/dictfmt_index2suffix
+bin/dictfmt_index2word
+bin/dictunformat
+bin/dictzip
+man/man1/dictfmt.1
+man/man1/dictfmt_index2suffix.1
+man/man1/dictfmt_index2word.1
+man/man1/dictunformat.1
+man/man1/dictzip.1
+man/man8/dictd.8
+sbin/dictd
+share/examples/dictd/dictd.conf
+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_site.txt
+share/examples/dictd/dictd_virtual.conf
diff --git a/dict-server-current/files/dictd.conf b/dict-server-current/files/dictd.conf
new file mode 100644
index 0000000000..6769f0a311
--- /dev/null
+++ b/dict-server-current/files/dictd.conf
@@ -0,0 +1,74 @@
+# dictionary server (site) description
+#site /usr/pkg/etc/dictd_site.txt
+
+# global settings
+global {
+ port 2628
+# delay 600
+# depth 10
+# limit 20
+# timestamp 10
+
+ log_option "found"
+ log_option "notfound"
+ log_option "stats"
+ log_option "client"
+
+ debug_option "init"
+
+ listen_to 127.0.0.1 # available for localhost only
+
+ syslog
+ syslog_facility daemon
+# log_file "/var/log/dictd/dictd.log"
+}
+
+# macros to specify databases easier
+m4_define(new_db, `
+database $1 {
+ data "/usr/pkg/share/dictd/$1.dict.dz"
+ `index' "/usr/pkg/share/dictd/$1.`index'"
+')
+
+# English monolingual dictionaries
+new_db(web1913)
+ # add additional options here
+}
+new_db(wn)
+}
+new_db(gazetteer)
+}
+new_db(jargon)
+}
+new_db(foldoc)
+}
+new_db(elements)
+}
+new_db(easton)
+}
+new_db(hitchcock)
+}
+new_db(world95)
+}
+
+# English-Russian dictionary
+new_db(mueller7)
+}
+
+# stop the default search here
+database_exit
+
+# a few virtual dictionaries
+database_virtual en-en {
+ name "English monolingual dictionaries"
+ info "--English monolingual dictionaries--"
+
+ database_list "web1913,wn,gazetteer,jargon,foldoc,elements,easton,hitchcock,world95"
+}
+
+database_virtual en-ru {
+ name "English-Russian dictionaries"
+ info "--English-Russian dictionaries--"
+
+ database_list "mueller7"
+}
diff --git a/dict-server-current/files/dictd.sh b/dict-server-current/files/dictd.sh
new file mode 100644
index 0000000000..2cf0daf7a5
--- /dev/null
+++ b/dict-server-current/files/dictd.sh
@@ -0,0 +1,31 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: dictd.sh,v 1.1 2009/12/30 11:55:49 abs Exp $
+#
+# PROVIDE: dictd
+# REQUIRE: LOGIN
+
+. /etc/rc.subr
+
+name="dictd"
+unload_cmd="dictd_unload"
+load_cmd="dictd_load"
+dictd_flags=${dictd_flags-"--pp '@PATH_TO_M4@ -P'"}
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+pidfile="/var/run/${name}.pid"
+required_files="@PKG_SYSCONFDIR@/dictd.conf"
+extra_commands="reload unload load"
+
+dictd_load (){
+ echo "Loading dictd databases."
+ kill -HUP $(check_pidfile $pidfile $name)
+}
+
+dictd_unload (){
+ echo "Unloading dictd databases."
+ kill -USR1 $(check_pidfile $pidfile $name)
+}
+
+load_rc_config $name
+run_rc_command "$1"
Home |
Main Index |
Thread Index |
Old Index