--- syslog-ocaml-1.4.orig/Makefile +++ syslog-ocaml-1.4/Makefile @@ -1,6 +1,6 @@ --include Makefile.conf +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 @@ -13,4 +13,4 @@ uninstall: libuninstall doc: htdoc --include OCamlMakefile +include $(OCAMLMAKEFILE) --- syslog-ocaml-1.4.orig/aux.ml +++ syslog-ocaml-1.4/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 --- syslog-ocaml-1.4.orig/aux_stubs.c +++ syslog-ocaml-1.4/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); +} --- syslog-ocaml-1.4.orig/aux.mli +++ syslog-ocaml-1.4/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 --- syslog-ocaml-1.4.orig/syslog.ml +++ syslog-ocaml-1.4/syslog.ml @@ -191,14 +191,11 @@ (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 --- syslog-ocaml-1.4.orig/debian/copyright +++ syslog-ocaml-1.4/debian/copyright @@ -0,0 +1,29 @@ +syslog(3) routines for ocaml + +Packaged for Debian by Eric Cooper on Wed, 30 Apr 2005 + +Downloaded from http://homepage.mac.com/letaris/ + +This library is based on Shawn Wagner's original syslog +library as included in annexlib, with significant modifications +by Eric Stokes . + +Copyright (C) 2002 Shawn Wagner +Copyright (C) 2005 Eric Stokes + +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. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian GNU/Linux systems, the complete text of the GNU Lesser +General Public License can be found in /usr/share/common-licenses/LGPL. --- syslog-ocaml-1.4.orig/debian/compat +++ syslog-ocaml-1.4/debian/compat @@ -0,0 +1 @@ +7 --- syslog-ocaml-1.4.orig/debian/rules +++ syslog-ocaml-1.4/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/ocaml.mk +include /usr/share/cdbs/1/class/makefile.mk + +DESTDIR = $(CURDIR)/debian/tmp/$(OCAML_STDLIB_DIR) +DEB_MAKE_INSTALL_TARGET = libinstall OCAMLFIND_DESTDIR=$(DESTDIR) OCAMLFIND_LDCONF=ignore + +DEB_MAKE_BUILD_TARGET = byte-code-library NO_CUSTOM=y +ifeq ($(OCAML_HAVE_OCAMLOPT),yes) + DEB_MAKE_BUILD_TARGET += native-code-library +endif + +build/libsyslog-ocaml:: + mkdir -p $(DESTDIR) --- syslog-ocaml-1.4.orig/debian/changelog +++ syslog-ocaml-1.4/debian/changelog @@ -0,0 +1,150 @@ +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 --- syslog-ocaml-1.4.orig/debian/control +++ syslog-ocaml-1.4/debian/control @@ -0,0 +1,44 @@ +Source: syslog-ocaml +Section: ocaml +Priority: optional +Maintainer: Debian OCaml Maintainers +Uploaders: + Eric Cooper , + Ralf Treinen +DM-Upload-Allowed: yes +Build-Depends: + debhelper (>= 7.0), + ocaml-nox (>= 3.11), + ocaml-findlib, + cdbs, + ocamlmakefile, + dh-ocaml (>= 0.9) +Standards-Version: 3.8.3 +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 + This library implements a syslog client in Objective Caml. + . + This package contains the shared runtime stub libraries. + +Package: libsyslog-ocaml-dev +Architecture: any +Depends: + ${ocaml:Depends}, + ${misc:Depends}, + ${shlibs:Depends} +Provides: ${ocaml:Provides} +Description: syslog routines for OCaml + This library implements a syslog client in Objective Caml. + . + This package contains the files needed to compile OCaml programs + that use the syslog library. --- syslog-ocaml-1.4.orig/debian/libsyslog-ocaml.install.in +++ syslog-ocaml-1.4/debian/libsyslog-ocaml.install.in @@ -0,0 +1 @@ +@OCamlStdlibDir@/syslog/*.so @OCamlDllDir@ --- syslog-ocaml-1.4.orig/debian/libsyslog-ocaml-dev.ocamldoc +++ syslog-ocaml-1.4/debian/libsyslog-ocaml-dev.ocamldoc @@ -0,0 +1,2 @@ +# flags for ocamldoc +# (this file must be non-empty to be represented in the .diff.gz for the package) --- syslog-ocaml-1.4.orig/debian/libsyslog-ocaml-dev.install.in +++ syslog-ocaml-1.4/debian/libsyslog-ocaml-dev.install.in @@ -0,0 +1,4 @@ +@OCamlStdlibDir@/syslog/META +@OCamlStdlibDir@/syslog/*.a +@OCamlStdlibDir@/syslog/*.cm* +@OCamlStdlibDir@/syslog/*.ml* --- syslog-ocaml-1.4.orig/debian/watch +++ syslog-ocaml-1.4/debian/watch @@ -0,0 +1,3 @@ +version=3 + +http://homepage.mac.com/letaris/syslog-(.*)\.tar\.gz --- syslog-ocaml-1.4.orig/debian/gbp.conf +++ syslog-ocaml-1.4/debian/gbp.conf @@ -0,0 +1,2 @@ +[DEFAULT] +pristine-tar = True