debian/0000755000000000000000000000000012256061110007160 5ustar debian/libsyslog-ocaml.install.in0000644000000000000000000000005311531627477014276 0ustar @OCamlStdlibDir@/syslog/*.so @OCamlDllDir@ debian/changelog0000644000000000000000000001245212256061110011036 0ustar syslog-ocaml (1.4-6build4) trusty; urgency=medium * Rebuild for ocaml-4.01. -- Matthias Klose Mon, 23 Dec 2013 16:18:17 +0000 syslog-ocaml (1.4-6build3) precise; urgency=low * Rebuild with ocamlopt on armhf. -- Colin Watson Tue, 24 Jan 2012 10:52:33 +0000 syslog-ocaml (1.4-6build2) precise; urgency=low * Rebuild for OCaml 3.12.1. -- Colin Watson Sat, 19 Nov 2011 01:01:20 +0000 syslog-ocaml (1.4-6build1) oneiric; urgency=low * Rebuild to pick up ocaml fixes on armel. -- Adam Conrad Wed, 24 Aug 2011 16:28:30 -0600 syslog-ocaml (1.4-6) unstable; urgency=low * Use dh instead of cdbs * Suggest ocaml-findlib * Update standards version and build dependencies * Make debian/copyright file machine-readable * Improve package descriptions * Add debian/source/format * Use debian/patches for all changes to upstream source -- Eric Cooper Thu, 24 Feb 2011 23:02:45 -0500 syslog-ocaml (1.4-5) unstable; urgency=low * Use DESTDIR with ocamlfind for install target * Convert to dh_ocaml version 0.9 -- Eric Cooper Tue, 06 Oct 2009 12:10:15 -0400 syslog-ocaml (1.4-4) unstable; urgency=low * Add NO_CUSTOM = yes in Makefile -- Eric Cooper Fri, 06 Mar 2009 11:00:57 -0500 syslog-ocaml (1.4-3) unstable; urgency=low * Compile C files with -fPIC (closes: #518041) * Revert to using OCamlMakefile from ocamlmakefile package, since it overrides CFLAGS correctly when invoked by *-buildpackage -- Eric Cooper Tue, 03 Mar 2009 16:20:10 -0500 syslog-ocaml (1.4-2) unstable; urgency=low [ Eric Cooper] * Update standards version * Update versioned build-dep on ocaml-nox * Remove dpatch and apply patches to master git branch instead * Use upstream OCamlMakefile and remove build-dep on ocamlmakefile * Add build-dep on dh-ocaml * Change debhelper version build-dep and debian/compat to 7 * Add misc:Depends to debian/control [ Stephane Glondu ] * Switching packaging to git -- Eric Cooper Sun, 01 Mar 2009 20:17:27 -0500 syslog-ocaml (1.4-1) unstable; urgency=low [ Eric Cooper ] * New upstream release * Added DM-Upload-Allowed to debian/control * Updated standards version [ Stefano Zacchiroli ] * fix vcs-svn field to point just above the debian/ dir -- Eric Cooper Mon, 04 Feb 2008 11:37:29 -0500 syslog-ocaml (1.3-7) unstable; urgency=low * promote Homepage to a real debian/control field -- Stefano Zacchiroli Fri, 21 Sep 2007 09:57:40 +0200 syslog-ocaml (1.3-6) unstable; urgency=low * Use support for ocamldoc in OCaml cdbs class -- Eric Cooper Mon, 03 Sep 2007 17:22:49 -0400 syslog-ocaml (1.3-5) unstable; urgency=low * Create libsyslog-ocaml as well as libsyslog-ocaml-dev since there is now a stub library for bytecode client programs -- Eric Cooper Tue, 12 Jun 2007 16:51:37 -0400 syslog-ocaml (1.3-4) unstable; urgency=low * Use send(2) with MSG_NOSIGNAL flag instead of write(2), to avoid a SIGPIPE signal when syslog-ng closes its connection (closes: #395469) -- Eric Cooper Sat, 09 Jun 2007 15:26:38 -0400 syslog-ocaml (1.3-3) unstable; urgency=low * Changed dependency on ocaml-tools to ocamlmakefile. * Added myself to Uploaders. -- Ralf Treinen Sun, 03 Jun 2007 22:10:35 +0200 syslog-ocaml (1.3-2) unstable; urgency=low * Use OCaml cdbs class -- Eric Cooper Tue, 24 Apr 2007 21:23:41 -0400 syslog-ocaml (1.3-1) unstable; urgency=low * New upstream release (closes: #379459) * Don't install cmx file * Update version in META file * Modify copyright file to eliminate lintian warnings * Removed debian/control.in per OCaml packaging policy -- Eric Cooper Thu, 31 Aug 2006 10:10:35 -0400 syslog-ocaml (1.2-4) unstable; urgency=low * Transition to OCaml 3.09.1 -- Eric Cooper Mon, 9 Jan 2006 15:40:32 -0500 syslog-ocaml (1.2-3.1) unstable; urgency=medium * Non-maintainer upload. * No changes, just build and upload to get changes from -2 and -3 into unstable. -- Jordi Mallach Tue, 27 Dec 2005 10:46:15 +0100 syslog-ocaml (1.2-3) unstable; urgency=low * Added debian/control.in and a rule to generate debian/control from it -- Eric Cooper Sun, 13 Nov 2005 13:32:25 -0500 syslog-ocaml (1.2-2) unstable; urgency=low * Updated debian/control for ocaml version 3.09.0 -- Eric Cooper Tue, 1 Nov 2005 17:27:40 -0500 syslog-ocaml (1.2-1) unstable; urgency=low * New upstream release incorporating syslog-ng support * Only build byte-code version on architectures with no ocamlopt -- Eric Cooper Sat, 30 Apr 2005 15:50:47 -0400 syslog-ocaml (1.0-3) unstable; urgency=low * Support SOCK_STREAM log sockets for syslog-ng (closes: #305019) -- Eric Cooper Sun, 17 Apr 2005 12:31:25 -0400 syslog-ocaml (1.0-2) unstable; urgency=low * Removed trunk/ directory layer. * Added Build-Depends on dpatch (closes: #303760) -- Eric Cooper Fri, 8 Apr 2005 14:04:48 -0400 syslog-ocaml (1.0-1) unstable; urgency=low * Initial release. -- Sven Luther Sat, 2 Apr 2005 09:28:38 +0200 debian/rules0000755000000000000000000000051711531627477010266 0ustar #!/usr/bin/make -f %: dh $@ --with ocaml export NO_CUSTOM = yes ifneq ($(wildcard /usr/bin/ocamlopt),) override_dh_auto_build: $(MAKE) reallyall endif export OCAMLFIND_DESTDIR = debian/tmp/$(shell /usr/bin/ocamlc -where) export OCAMLFIND_LDCONF = ignore override_dh_auto_install: mkdir -p $(OCAMLFIND_DESTDIR) $(MAKE) install debian/gbp.conf0000644000000000000000000000003611531627477010621 0ustar [DEFAULT] pristine-tar = True debian/control0000644000000000000000000000270111531627477010606 0ustar Source: syslog-ocaml Section: ocaml Priority: optional Maintainer: Debian OCaml Maintainers Uploaders: Eric Cooper , Ralf Treinen DM-Upload-Allowed: yes Build-Depends: debhelper (>= 8.0), ocaml-nox (>= 3.11.2), ocaml-findlib, ocamlmakefile, dh-ocaml (>= 0.9.6) Standards-Version: 3.9.1 Homepage: http://homepage.mac.com/letaris Vcs-Git: git://git.debian.org/git/pkg-ocaml-maint/packages/syslog-ocaml.git Vcs-Browser: http://git.debian.org/?p=pkg-ocaml-maint/packages/syslog-ocaml.git Package: libsyslog-ocaml Architecture: any Depends: ${ocaml:Depends}, ${misc:Depends}, ${shlibs:Depends} Provides: ${ocaml:Provides} Description: syslog routines for OCaml (runtime) This library provides syslog client functions for OCaml programs. These functions are implemented almost entirely in OCaml, not as bindings to the standard C library. . This package contains the shared runtime stub libraries. Package: libsyslog-ocaml-dev Architecture: any Depends: ${ocaml:Depends}, ${misc:Depends}, ${shlibs:Depends} Provides: ${ocaml:Provides} Suggests: ocaml-findlib Description: syslog routines for OCaml (development files) This library provides syslog client functions for OCaml programs. These functions are implemented almost entirely in OCaml, not as bindings to the standard C library. . This package contains the files needed to compile OCaml programs that use the syslog library. debian/copyright0000644000000000000000000000127611531627477011144 0ustar Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn Files: * Copyright: 2002 Shawn Wagner 2005 Eric Stokes License: LGPL-2.1+ Files: debian/* Copyright: 2011 Eric Cooper License: LGPL-2.1+ License: LGPL-2.1+ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. . On Debian systems, the complete text of the GNU Lesser General Public License version 2.1 can be found in /usr/share/common-licenses/LGPL-2.1 debian/source/0000755000000000000000000000000011531627477010503 5ustar debian/source/format0000644000000000000000000000001411531627477011711 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000010011531627477010223 0ustar version=3 http://homepage.mac.com/letaris/syslog-(.*)\.tar\.gz debian/patches/0000755000000000000000000000000011531627477010632 5ustar debian/patches/0002-add-wrapper-for-send-with-flags.patch0000644000000000000000000000506011531627477020217 0ustar From: Eric Cooper Date: Thu, 24 Feb 2011 22:41:33 -0500 Subject: add wrapper for send with flags allow send(2) to be called with flags such as MSG_NOSIGNAL Signed-off-by: Eric Cooper --- Makefile | 2 +- aux.ml | 10 ++++++++++ aux.mli | 3 +++ aux_stubs.c | 31 +++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 1 deletions(-) create mode 100644 aux.ml create mode 100644 aux.mli create mode 100644 aux_stubs.c diff --git a/Makefile b/Makefile index 948bed5..1facb86 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ OCAMLMAKEFILE = /usr/share/ocamlmakefile/OCamlMakefile -SOURCES=syslog.mli syslog.ml +SOURCES=aux.mli aux.ml aux_stubs.c syslog.mli syslog.ml RESULT=syslog PACKS=unix diff --git a/aux.ml b/aux.ml new file mode 100644 index 0000000..6aa8b95 --- /dev/null +++ b/aux.ml @@ -0,0 +1,10 @@ +type msg_flag = MSG_OOB | MSG_DONTROUTE | MSG_PEEK | MSG_NOSIGNAL + +external unsafe_send : + Unix.file_descr -> string -> int -> int -> msg_flag list -> int + = "aux_send" + +let send fd buf ofs len flags = + if ofs < 0 || len < 0 || ofs > String.length buf - len + then invalid_arg "Unix.send" + else unsafe_send fd buf ofs len flags diff --git a/aux.mli b/aux.mli new file mode 100644 index 0000000..d36bcbf --- /dev/null +++ b/aux.mli @@ -0,0 +1,3 @@ +type msg_flag = MSG_OOB | MSG_DONTROUTE | MSG_PEEK | MSG_NOSIGNAL + +val send : Unix.file_descr -> string -> int -> int -> msg_flag list -> int diff --git a/aux_stubs.c b/aux_stubs.c new file mode 100644 index 0000000..118ce22 --- /dev/null +++ b/aux_stubs.c @@ -0,0 +1,31 @@ +#include +#include +#include +#include +#include + +// These are from .../otherlibs/unix/unixsupport.h +#define UNIX_BUFFER_SIZE 16384 +extern void uerror (char * cmdname, value arg) Noreturn; + +static int msg_flag_table[] = { + MSG_OOB, MSG_DONTROUTE, MSG_PEEK, MSG_NOSIGNAL +}; + +CAMLprim value aux_send(value sock, value buff, value ofs, value len, + value flags) +{ + int ret, cv_flags; + long numbytes; + char iobuf[UNIX_BUFFER_SIZE]; + + cv_flags = convert_flag_list(flags, msg_flag_table); + numbytes = Long_val(len); + if (numbytes > UNIX_BUFFER_SIZE) numbytes = UNIX_BUFFER_SIZE; + memmove(iobuf, &Byte(buff, Long_val(ofs)), numbytes); + enter_blocking_section(); + ret = send(Int_val(sock), iobuf, (int) numbytes, cv_flags); + leave_blocking_section(); + if (ret == -1) uerror("send", (value) 0); + return Val_int(ret); +} -- debian/patches/0001-use-ocamlmakefile-package.patch0000644000000000000000000000111711531627477017205 0ustar From: Eric Cooper Date: Tue, 3 Mar 2009 16:28:31 -0500 Subject: use ocamlmakefile package Signed-off-by: Eric Cooper --- Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 61245a8..948bed5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ --include Makefile.conf +OCAMLMAKEFILE = /usr/share/ocamlmakefile/OCamlMakefile SOURCES=syslog.mli syslog.ml RESULT=syslog @@ -13,4 +13,4 @@ install: libinstall uninstall: libuninstall doc: htdoc --include OCamlMakefile +include $(OCAMLMAKEFILE) -- debian/patches/series0000644000000000000000000000021011531627477012040 0ustar 0001-use-ocamlmakefile-package.patch 0002-add-wrapper-for-send-with-flags.patch 0003-call-send-with-MSG_NOSIGNAL-to-avoid-SIGPIPE.patch debian/patches/0003-call-send-with-MSG_NOSIGNAL-to-avoid-SIGPIPE.patch0000644000000000000000000000173411531627477021607 0ustar From: Eric Cooper Date: Thu, 24 Feb 2011 22:43:13 -0500 Subject: call send with MSG_NOSIGNAL to avoid SIGPIPE Signed-off-by: Eric Cooper --- syslog.ml | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/syslog.ml b/syslog.ml index c6c66f4..80e179c 100644 --- a/syslog.ml +++ b/syslog.ml @@ -191,14 +191,11 @@ let protected_write loginfo str = (try open_connection loginfo with _ -> ()); if List.mem `LOG_CONS loginfo.flags then log_console str in - let prev = Sys.signal Sys.sigpipe (Sys.Signal_handle fallback) in try - ignore (write loginfo.fd str 0 (String.length str)); - Sys.set_signal Sys.sigpipe prev + ignore (Aux.send loginfo.fd str 0 (String.length str) [Aux.MSG_NOSIGNAL]) with Unix_error (_, _, _) -> (* on error, attempt to reconnect *) - fallback (); - Sys.set_signal Sys.sigpipe prev + fallback () let syslog ?fac loginfo lev str = let msg = Buffer.create 64 in -- debian/libsyslog-ocaml-dev.ocamldoc0000644000000000000000000000014711531627477014564 0ustar # flags for ocamldoc # (this file must be non-empty to be represented in the .diff.gz for the package) debian/compat0000644000000000000000000000000211531627477010401 0ustar 8 debian/libsyslog-ocaml-dev.install.in0000644000000000000000000000016511531627477015056 0ustar @OCamlStdlibDir@/syslog/META @OCamlStdlibDir@/syslog/*.a @OCamlStdlibDir@/syslog/*.cm* @OCamlStdlibDir@/syslog/*.ml*