diff options
author | fhajny <fhajny@pkgsrc.org> | 2018-01-31 20:09:20 +0000 |
---|---|---|
committer | fhajny <fhajny@pkgsrc.org> | 2018-01-31 20:09:20 +0000 |
commit | 43d94050ecce6994a31d58cdff70bb31cd2d665b (patch) | |
tree | 42fc29db86935e0814352549ae26b1c1983b7716 /mail/rspamd | |
parent | fd807f9abab46167ec491db9f0805f6316bc8eda (diff) | |
download | pkgsrc-43d94050ecce6994a31d58cdff70bb31cd2d665b.tar.gz |
mail/rspamd: Provide endian detection and fcntl support. Fixes SunOS builds.
Diffstat (limited to 'mail/rspamd')
-rw-r--r-- | mail/rspamd/distinfo | 4 | ||||
-rw-r--r-- | mail/rspamd/patches/patch-config.h.in | 20 | ||||
-rw-r--r-- | mail/rspamd/patches/patch-src_lua_lua__util.c | 62 |
3 files changed, 85 insertions, 1 deletions
diff --git a/mail/rspamd/distinfo b/mail/rspamd/distinfo index d92e56c73e1..a17c372c91c 100644 --- a/mail/rspamd/distinfo +++ b/mail/rspamd/distinfo @@ -1,8 +1,10 @@ -$NetBSD: distinfo,v 1.15 2017/06/23 13:47:05 wiz Exp $ +$NetBSD: distinfo,v 1.16 2018/01/31 20:09:20 fhajny Exp $ SHA1 (rspamd-1.6.1.tar.gz) = c2fb3b8aae561932b2cde746b77bdeb1ba5ea0c9 RMD160 (rspamd-1.6.1.tar.gz) = 1576044887557da12075776dbf259e25f4d00dfe SHA512 (rspamd-1.6.1.tar.gz) = 3bd50ebc1d7e413afbe52608f94b644e1cf684a708776207710eb4556abb0500b2a23141a90e811854a25a9fbedf0a6b1c5a05363c0cf372921b8acd457b702b Size (rspamd-1.6.1.tar.gz) = 2462565 bytes SHA1 (patch-CMakeLists.txt) = 1d3e66b52ef38638674baf4c10b68c97b2ca38ad +SHA1 (patch-config.h.in) = 1e626956227dc69fb781ce5847e0f9f8eaee8c09 SHA1 (patch-src_CMakeLists.txt) = c80015bb275ba8b9ad31491311275bf353f8f30a +SHA1 (patch-src_lua_lua__util.c) = 9aebe7e7d88e4dced48cf5016ce932b2da5020d0 diff --git a/mail/rspamd/patches/patch-config.h.in b/mail/rspamd/patches/patch-config.h.in new file mode 100644 index 00000000000..47bb11df280 --- /dev/null +++ b/mail/rspamd/patches/patch-config.h.in @@ -0,0 +1,20 @@ +$NetBSD: patch-config.h.in,v 1.1 2018/01/31 20:09:20 fhajny Exp $ + +Add endianness support for earlier SunOS platforms. + +--- config.h.in.orig 2017-06-14 14:45:41.000000000 +0000 ++++ config.h.in +@@ -151,6 +151,13 @@ + #include <sys/endian.h> + #elif defined(HAVE_MACHINE_ENDIAN_H) + #include <machine/endian.h> ++#elif defined(__sun) ++ #include <sys/byteorder.h> ++ #ifdef _LITTLE_ENDIAN ++ #define BYTE_ORDER LITTLE_ENDIAN ++ #else ++ #define BYTE_ORDER BIG_ENDIAN ++ #endif + #endif + + #ifndef BYTE_ORDER diff --git a/mail/rspamd/patches/patch-src_lua_lua__util.c b/mail/rspamd/patches/patch-src_lua_lua__util.c new file mode 100644 index 00000000000..5d131f2d08e --- /dev/null +++ b/mail/rspamd/patches/patch-src_lua_lua__util.c @@ -0,0 +1,62 @@ +$NetBSD: patch-src_lua_lua__util.c,v 1.1 2018/01/31 20:09:20 fhajny Exp $ + +Add fcntl support (namely for SunOS). + +--- src/lua/lua_util.c.orig 2017-06-14 14:45:41.000000000 +0000 ++++ src/lua/lua_util.c +@@ -1544,6 +1544,15 @@ lua_util_lock_file (lua_State *L) + gint fd = -1; + gboolean own = FALSE; + ++#if !HAVE_FLOCK ++ struct flock fl = { ++ .l_type = F_WRLCK, ++ .l_whence = SEEK_SET, ++ .l_start = 0, ++ .l_len = 0 ++ }; ++#endif ++ + fpath = luaL_checkstring (L, 1); + + if (fpath) { +@@ -1562,7 +1571,11 @@ lua_util_lock_file (lua_State *L) + return 2; + } + ++#if HAVE_FLOCK + if (flock (fd, LOCK_EX) == -1) { ++#else ++ if (fcntl (fd, F_SETLKW, &fl) == -1) { ++#endif + lua_pushnil (L); + lua_pushstring (L, strerror (errno)); + +@@ -1588,6 +1601,15 @@ lua_util_unlock_file (lua_State *L) + gint fd = -1, ret, serrno; + gboolean do_close = TRUE; + ++#if !HAVE_FLOCK ++ struct flock fl = { ++ .l_type = F_UNLCK, ++ .l_whence = SEEK_SET, ++ .l_start = 0, ++ .l_len = 0 ++ }; ++#endif ++ + if (lua_isnumber (L, 1)) { + fd = lua_tonumber (L, 1); + +@@ -1595,7 +1617,11 @@ lua_util_unlock_file (lua_State *L) + do_close = lua_toboolean (L, 2); + } + ++#if HAVE_FLOCK + ret = flock (fd, LOCK_UN); ++#else ++ ret = fcntl (fd, F_SETLKW, &fl); ++#endif + + if (do_close) { + serrno = errno; |