X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 7691EDC153D for ; Sun, 6 Mar 2016 23:00:47 +0000 (UTC) Received: from mail-qg0-f65.google.com (mail-qg0-f65.google.com [209.85.192.65]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 3D588DC14B8 for ; Sun, 6 Mar 2016 23:00:44 +0000 (UTC) Received: by mail-qg0-f65.google.com with SMTP id p68so7264377qge.2 for ; Sun, 06 Mar 2016 15:00:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=teJF/DPNu9Hlx5q3CKksITb9+U+joVXgVsl526kH7uI=; b=IFkU3y4Bdpd1J6f3vdSPiXC2GFvUHT+ll2ZX0tRAUaoBVWBKF8TUoLRIpJjSNamZhS rd4rx7NLEGH2Ncv4CdrJXKIPPHT0shRzcGtp+EQxL7sH1Lx2rBa4GBmdeQ3lrOOYwBMw 5AFHvXwY+A9DfaU96lCqMONQzcCbCUIMIlwVE0u+Iz0IseJbIJF7Zo78YAw4CzJRzwSR 09e2azUTXluggkAZALQJpwK07xJITJUL0d4ZbJOtkce3M5g75x3K8m2vgGCZuBuUjtj1 kb2YeMbvjqiwmcdHfVKHS35RLKuLWhF8l9nr/faEbM+xgF23m4AJLAKE9g4NXGCagW4e co1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=teJF/DPNu9Hlx5q3CKksITb9+U+joVXgVsl526kH7uI=; b=U6kbD5t8z7iZcqrFd1go2z4cUVZJX0co2g+mHP9NEPUXmQZJK9xyUp8k4GsrfdL5eu sI299miy89Rd7rfHGU+3LvcVifdffRsYCbEv67JjgT2MeM25iOFaz80VvDVO9ZzWnTjb XgCbKXb/k/3ZYDAbaEOMYnCw7RHseCqVNXSTlCjmGFIbsWX3x7PjMr3xjWlOlHKF5eKh 1XqIVEuOz4adFGQmUNa/BsiS3Mo54hRekLZ8jaEkyMMtibvEN4aIZTGv2OZZpdTky7h1 NtIHBjHG7XrwCbMxevgXCWR0Zs6zz+u8RVrLQEtNm/n8izisEo8IxRMFMRvp0WC/a9L2 g7rA== X-Gm-Message-State: AD7BkJJDz1DkP2Hqq8iwpFHp6qXvDoJSBWH1QtJfjgct9QBtdm/goMvIYBH1p9aBuzhmtQ== X-Received: by 10.140.163.84 with SMTP id j81mr4658357qhj.68.1457305242968; Sun, 06 Mar 2016 15:00:42 -0800 (PST) Received: from mirarg170a.williams.edu ([137.165.162.5]) by smtp.gmail.com with ESMTPSA id b40sm6844953qga.7.2016.03.06.15.00.41 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 06 Mar 2016 15:00:41 -0800 (PST) From: Muh Muhten To: alpine-aports@lists.alpinelinux.org Cc: Muh Muhten Subject: [alpine-aports] [PATCH] main/lua-socket: cleanup and upgrade to latest git Date: Sun, 6 Mar 2016 18:00:37 -0500 Message-Id: <1457305237-43494-1-git-send-email-muh.muhten@gmail.com> X-Mailer: git-send-email 2.5.4 (Apple Git-61) X-Virus-Scanned: ClamAV using ClamSMTP X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Fast-forward to pick up fixes since last release, remove patches that no longer apply, and clean up APKBUILD to closer to the current style. --- Not too sure I got the patchset right here. Fast-forward because it's been a year since last update and there have been substantial bugfixes since. Removed patches that no longer apply cleanly; unix.patch was no longer used. I'm not sure what include-luasocket.patch was for; it compiles cleanly without it but the change is not reflected upstream--is it necessary? Can we look into getting lua-cflags upstreamed? It doesn't seem like it should be too distro-specific, I'm not sure. A bit of cleanup in the APKBUILD. main/lua-socket/APKBUILD | 40 +- main/lua-socket/git.patch | 5346 ++++++++++++++++++++++++++++++- main/lua-socket/include-luasocket.patch | 10 - main/lua-socket/lua-cflags.patch | 10 +- main/lua-socket/unix.patch | 25 - 5 files changed, 5217 insertions(+), 214 deletions(-) delete mode 100644 main/lua-socket/include-luasocket.patch delete mode 100644 main/lua-socket/unix.patch diff --git a/main/lua-socket/APKBUILD b/main/lua-socket/APKBUILD index d2b1251..86dea01 100644 --- a/main/lua-socket/APKBUILD +++ b/main/lua-socket/APKBUILD @@ -3,7 +3,7 @@ _luaversions="5.1 5.2 5.3" pkgname=lua-socket _name=luasocket -pkgver=3.0_rc1_git20150301 +pkgver=3.0_rc1_git20160306 pkgrel=0 _ver=${pkgver%_git*} _ver=${_ver/_rc/-rc} @@ -11,8 +11,8 @@ pkgdesc="Networking library for Lua" url="http://luaforge.net/projects/luasocket/" arch="all" license="MIT" -install= -depends="lua5.1-socket" +install="" +depends="" makedepends="" subpackages="" for _i in $_luaversions; do @@ -22,21 +22,15 @@ done source="luasocket-$_ver.tar.gz::https://github.com/diegonehab/luasocket/archive/v$_ver.tar.gz git.patch lua-cflags.patch - include-luasocket.patch " -_sdir="$srcdir/$_name-$_ver" +# default_prepare assumes $_builddir +_builddir="$srcdir/$_name-$_ver" prepare() { - cd "$_sdir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac - done - + default_prepare for _i in $_luaversions; do - cp -r "$_sdir" "$srcdir"/build-$_i + cp -r "$_builddir" "$srcdir"/build-$_i # set lua version sed -i -e "/^LUAV?=/s/=.*/=$_i/" \ "$srcdir"/build-$_i/src/makefile || return 1 @@ -44,27 +38,22 @@ prepare() { } build() { - cd "$_builddir" for _i in $_luaversions; do make -C "$srcdir"/build-$_i/src all-unix || return 1 done } package() { - cd "$_builddir" for _i in $_luaversions; do cd "$srcdir"/build-$_i make prefix=/usr DESTDIR="$pkgdir" install-unix || return 1 done - } _split() { local d= _ver=$1 pkgdesc="Networking library for Lua $_ver" install_if="lua$_ver $pkgname=$pkgver-r$pkgrel" - replaces="$pkgname" - depends= for d in usr/lib/lua usr/share/lua; do if [ -d "$pkgdir"/$d/$_ver ]; then mkdir -p "$subpkgdir"/$d @@ -78,14 +67,11 @@ for _i in $_luaversions; do done md5sums="08bd2f265b244eb4bf5c2c36bf89b759 luasocket-3.0-rc1.tar.gz -2e14aba126cec984e1824a4da35d45f8 git.patch -8adb3bb6f4c6f63de8c56412ef623953 lua-cflags.patch -4bcbbc8d3383db94223155fc7a6d454e include-luasocket.patch" +44c07dc3dd311541a50b21aaa40e36d7 git.patch +d4319e4a20d476ea8d77a3421fca1808 lua-cflags.patch" sha256sums="8b67d9b5b545e1b694753dab7bd6cdbc24c290f2b21ba1e14c77b32817ea1249 luasocket-3.0-rc1.tar.gz -d64d35ba14a8b1381c20273d1390ee7c170b4ff566ad503621cac9f4c129bbb8 git.patch -e5d38d3b1484b61ab43627efdc302f78c24733aa2d422e6745fe273b1a56d94b lua-cflags.patch -42b1a439805efaf33110e01a53798b3e8d044101470808fe9478ca3be0ae5165 include-luasocket.patch" +414cfe53e4455fc2b416779d5eaa3ade6d97c01fa62dbffb6c9d4d4ad84bdd76 git.patch +77d77fe688b27ae51bcf9d3ae51d43141ab85d95fd322b3904b55dbc76900418 lua-cflags.patch" sha512sums="f6efce259aaacaa11472911471f8a13b118fe009b8953a82c6aa18b9ec829cd1293180904e56935cb130d36d267e3f27c91db2d78e03f7488f3e100571ed0540 luasocket-3.0-rc1.tar.gz -85a6dc3b8e674200a2928f397fcb7fb9ca0e41870d5628c9c24aabc140d8fa14c12576cfa6e8bef687ab914d378585557b9a2f3bf09173a003d51f7f8e2a0d34 git.patch -9a155e11e117b9f0485899951051a61d21cdc088d3a5e1ec0e2d018cb257b6edaaf342f5f5304cb229160247ced5ff0fe825f880cb695a201295b4399546de84 lua-cflags.patch -34db925f9e9a1a629d01dc26072f4edec77087f7bf89dda8140326447662efbc53ce5e36087fa9127d708d498c129613f7ed82862dd3176df16796418868548d include-luasocket.patch" +45c80e488fedc879f0217bc8a654d80da003039f5d1ff21b0dea0eb769151787dbe793e44a3dfd72cb07ff2697eceaf4fc7b55b4634cd170fa71281f19f025a5 git.patch +fb482ad22b5caa2054b25c86edc01d1a666035930f6b55e7d12704dd78b9c31343c39eab5f13958941180d819aa37470c75fe27f1b206a4b431fb589663e2685 lua-cflags.patch" diff --git a/main/lua-socket/git.patch b/main/lua-socket/git.patch index 65c5595..d665fc2 100644 --- a/main/lua-socket/git.patch +++ b/main/lua-socket/git.patch @@ -1,3 +1,109 @@ +diff --git a/doc/http.html b/doc/http.html +index cd41c0d..3b7a8b1 100644 +--- a/doc/http.html ++++ b/doc/http.html +@@ -112,12 +112,15 @@ the HTTP module: +

+ +
    +-
  • PORT: default port used for connections; +-
  • PROXY: default proxy used for connections; ++
  • PROXY: default proxy used for connections; +
  • TIMEOUT: sets the timeout for all I/O operations; +
  • USERAGENT: default user agent reported to server. +
+ ++

++Note: These constants are global. Changing them will also ++change the behavior other code that might be using LuaSocket. ++

+ + + +diff --git a/doc/mime.html b/doc/mime.html +index ae136fd..8cb3507 100644 +--- a/doc/mime.html ++++ b/doc/mime.html +@@ -72,34 +72,6 @@ local mime = require("mime") + +

High-level filters

+ +- +- +-

+-mime.normalize([marker]) +-

+- +-

+-Converts most common end-of-line markers to a specific given marker. +-

+- +-

+-Marker is the new marker. It defaults to CRLF, the canonic +-end-of-line marker defined by the MIME standard. +-

+- +-

+-The function returns a filter that performs the conversion. +-

+- +-

+-Note: There is no perfect solution to this problem. Different end-of-line +-markers are an evil that will probably plague developers forever. +-This function, however, will work perfectly for text created with any of +-the most common end-of-line markers, i.e. the Mac OS (CR), the Unix (LF), +-or the DOS (CRLF) conventions. Even if the data has mixed end-of-line +-markers, the function will still work well, although it doesn't +-guarantee that the number of empty lines will be correct. +-

+ + + +@@ -159,6 +131,35 @@ base64 = ltn12.filter.chain( + ) + + ++ ++ ++

++mime.normalize([marker]) ++

++ ++

++Converts most common end-of-line markers to a specific given marker. ++

++ ++

++Marker is the new marker. It defaults to CRLF, the canonic ++end-of-line marker defined by the MIME standard. ++

++ ++

++The function returns a filter that performs the conversion. ++

++ ++

++Note: There is no perfect solution to this problem. Different end-of-line ++markers are an evil that will probably plague developers forever. ++This function, however, will work perfectly for text created with any of ++the most common end-of-line markers, i.e. the Mac OS (CR), the Unix (LF), ++or the DOS (CRLF) conventions. Even if the data has mixed end-of-line ++markers, the function will still work well, although it doesn't ++guarantee that the number of empty lines will be correct. ++

++ + + +

+@@ -466,7 +467,7 @@ marker. +

+ + Last modified by Diego Nehab on
+-Thu Apr 20 00:25:44 EDT 2006 ++Fri Mar 4 15:19:17 BRT 2016 +
+

+ diff --git a/doc/reference.css b/doc/reference.css index b1dd25d..04e38cf 100644 --- a/doc/reference.css @@ -9,7 +115,1821 @@ index b1dd25d..04e38cf 100644 + background: #ffffff; } - tt { + tt { +diff --git a/doc/reference.html b/doc/reference.html +index e9bb5eb..287dc19 100644 +--- a/doc/reference.html ++++ b/doc/reference.html +@@ -147,6 +147,7 @@ Support, Manual"> + connect, + connect4, + connect6, ++_DATAGRAMSIZE, + _DEBUG, + dns, + gettime, +@@ -158,11 +159,14 @@ Support, Manual"> + skip, + sleep, + _SETSIZE, ++_SOCKETINVALID, + source, + tcp, ++tcp4, + tcp6, + try, + udp, ++udp4, + udp6, + _VERSION. + +@@ -183,6 +187,7 @@ Support, Manual"> + getpeername, + getsockname, + getstats, ++gettimeout, + listen, + receive, + send, +@@ -203,6 +208,7 @@ Support, Manual"> + getoption, + getpeername, + getsockname, ++gettimeout, + receive, + receivefrom, + send, +diff --git a/doc/smtp.html b/doc/smtp.html +index bbbff80..600ec37 100644 +--- a/doc/smtp.html ++++ b/doc/smtp.html +@@ -114,6 +114,124 @@ the SMTP module: +
  • ZONE: default time zone. + + ++ ++ ++

    ++smtp.message(mesgt) ++

    ++ ++

    ++Returns a simple ++LTN12 source that sends an SMTP message body, possibly multipart (arbitrarily deep). ++

    ++ ++

    ++The only parameter of the function is a table describing the message. ++Mesgt has the following form (notice the recursive structure): ++

    ++ ++
    ++ ++ ++
    ++mesgt = {
    ++  headers = header-table,
    ++  body = LTN12 source or string or ++multipart-mesgt
    ++}
    ++ 
    ++multipart-mesgt = {
    ++  [preamble = string,]
    ++  [1] = mesgt,
    ++  [2] = mesgt,
    ++  ...
    ++  [n] = mesgt,
    ++  [epilogue = string,]
    ++}
    ++
    ++
    ++ ++

    ++For a simple message, all that is needed is a set of headers ++and the body. The message body can be given as a string ++or as a simple ++LTN12 ++source. For multipart messages, the body is a table that ++recursively defines each part as an independent message, plus an optional ++preamble and epilogue. ++

    ++ ++

    ++The function returns a simple ++LTN12 ++source that produces the ++message contents as defined by mesgt, chunk by chunk. ++Hopefully, the following ++example will make things clear. When in doubt, refer to the appropriate RFC ++as listed in the introduction.

    ++ ++
    ++-- load the smtp support and its friends
    ++local smtp = require("socket.smtp")
    ++local mime = require("mime")
    ++local ltn12 = require("ltn12")
    ++
    ++-- creates a source to send a message with two parts. The first part is 
    ++-- plain text, the second part is a PNG image, encoded as base64.
    ++source = smtp.message{
    ++  headers = {
    ++     -- Remember that headers are *ignored* by smtp.send. 
    ++     from = "Sicrano de Oliveira <sicrano@example.com>",
    ++     to = "Fulano da Silva <fulano@example.com>",
    ++     subject = "Here is a message with attachments"
    ++  },
    ++  body = {
    ++    preamble = "If your client doesn't understand attachments, \r\n" ..
    ++               "it will still display the preamble and the epilogue.\r\n" ..
    ++               "Preamble will probably appear even in a MIME enabled client.",
    ++    -- first part: no headers means plain text, us-ascii.
    ++    -- The mime.eol low-level filter normalizes end-of-line markers.
    ++    [1] = { 
    ++      body = mime.eol(0, [[
    ++        Lines in a message body should always end with CRLF. 
    ++        The smtp module will *NOT* perform translation. However, the 
    ++        send function *DOES* perform SMTP stuffing, whereas the message
    ++        function does *NOT*.
    ++      ]])
    ++    },
    ++    -- second part: headers describe content to be a png image, 
    ++    -- sent under the base64 transfer content encoding.
    ++    -- notice that nothing happens until the message is actually sent. 
    ++    -- small chunks are loaded into memory right before transmission and 
    ++    -- translation happens on the fly.
    ++    [2] = { 
    ++      headers = {
    ++        ["content-type"] = 'image/png; name="image.png"',
    ++        ["content-disposition"] = 'attachment; filename="image.png"',
    ++        ["content-description"] = 'a beautiful image',
    ++        ["content-transfer-encoding"] = "BASE64"
    ++      },
    ++      body = ltn12.source.chain(
    ++        ltn12.source.file(io.open("image.png", "rb")),
    ++        ltn12.filter.chain(
    ++          mime.encode("base64"),
    ++          mime.wrap()
    ++        )
    ++      )
    ++    },
    ++    epilogue = "This might also show up, but after the attachments"
    ++  }
    ++}
    ++
    ++-- finally send it
    ++r, e = smtp.send{
    ++    from = "<sicrano@example.com>",
    ++    rcpt = "<fulano@example.com>",
    ++    source = source,
    ++}
    ++
    ++ ++ + + +

    +@@ -275,123 +393,6 @@ r, e = smtp.send{ + } + + +- +- +-

    +-smtp.message(mesgt) +-

    +- +-

    +-Returns a simple +-LTN12 source that sends an SMTP message body, possibly multipart (arbitrarily deep). +-

    +- +-

    +-The only parameter of the function is a table describing the message. +-Mesgt has the following form (notice the recursive structure): +-

    +- +-
    +- +- +-
    +-mesgt = {
    +-  headers = header-table,
    +-  body = LTN12 source or string or +-multipart-mesgt
    +-}
    +- 
    +-multipart-mesgt = {
    +-  [preamble = string,]
    +-  [1] = mesgt,
    +-  [2] = mesgt,
    +-  ...
    +-  [n] = mesgt,
    +-  [epilogue = string,]
    +-}
    +-
    +-
    +- +-

    +-For a simple message, all that is needed is a set of headers +-and the body. The message body can be given as a string +-or as a simple +-LTN12 +-source. For multipart messages, the body is a table that +-recursively defines each part as an independent message, plus an optional +-preamble and epilogue. +-

    +- +-

    +-The function returns a simple +-LTN12 +-source that produces the +-message contents as defined by mesgt, chunk by chunk. +-Hopefully, the following +-example will make things clear. When in doubt, refer to the appropriate RFC +-as listed in the introduction.

    +- +-
    +--- load the smtp support and its friends
    +-local smtp = require("socket.smtp")
    +-local mime = require("mime")
    +-local ltn12 = require("ltn12")
    +-
    +--- creates a source to send a message with two parts. The first part is 
    +--- plain text, the second part is a PNG image, encoded as base64.
    +-source = smtp.message{
    +-  headers = {
    +-     -- Remember that headers are *ignored* by smtp.send. 
    +-     from = "Sicrano de Oliveira <sicrano@example.com>",
    +-     to = "Fulano da Silva <fulano@example.com>",
    +-     subject = "Here is a message with attachments"
    +-  },
    +-  body = {
    +-    preamble = "If your client doesn't understand attachments, \r\n" ..
    +-               "it will still display the preamble and the epilogue.\r\n" ..
    +-               "Preamble will probably appear even in a MIME enabled client.",
    +-    -- first part: no headers means plain text, us-ascii.
    +-    -- The mime.eol low-level filter normalizes end-of-line markers.
    +-    [1] = { 
    +-      body = mime.eol(0, [[
    +-        Lines in a message body should always end with CRLF. 
    +-        The smtp module will *NOT* perform translation. However, the 
    +-        send function *DOES* perform SMTP stuffing, whereas the message
    +-        function does *NOT*.
    +-      ]])
    +-    },
    +-    -- second part: headers describe content to be a png image, 
    +-    -- sent under the base64 transfer content encoding.
    +-    -- notice that nothing happens until the message is actually sent. 
    +-    -- small chunks are loaded into memory right before transmission and 
    +-    -- translation happens on the fly.
    +-    [2] = { 
    +-      headers = {
    +-        ["content-type"] = 'image/png; name="image.png"',
    +-        ["content-disposition"] = 'attachment; filename="image.png"',
    +-        ["content-description"] = 'a beautiful image',
    +-        ["content-transfer-encoding"] = "BASE64"
    +-      },
    +-      body = ltn12.source.chain(
    +-        ltn12.source.file(io.open("image.png", "rb")),
    +-        ltn12.filter.chain(
    +-          mime.encode("base64"),
    +-          mime.wrap()
    +-        )
    +-      )
    +-    },
    +-    epilogue = "This might also show up, but after the attachments"
    +-  }
    +-}
    +-
    +--- finally send it
    +-r, e = smtp.send{
    +-    from = "<sicrano@example.com>",
    +-    rcpt = "<fulano@example.com>",
    +-    source = source,
    +-}
    +-
    +- + + +