summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2013-02-07 20:57:03 +0100
committerSebastian Pipping <sebastian@pipping.org>2013-02-07 20:59:12 +0100
commitbac54973c5628bb466cef18d2f69317eb40abaad (patch)
tree5c1c9d692cdedc93fffd3f36bcabfe8b83af09cc /sys-block
parentInCVS version is newer (diff)
downloadbetagarden-bac54973c5628bb466cef18d2f69317eb40abaad.tar.gz
betagarden-bac54973c5628bb466cef18d2f69317eb40abaad.tar.bz2
betagarden-bac54973c5628bb466cef18d2f69317eb40abaad.zip
sys-block/nbd-http: 0.2.1
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/nbd-http/Manifest1
-rw-r--r--sys-block/nbd-http/files/nbd-http-0.2.1-compile.patch34
-rw-r--r--sys-block/nbd-http/files/nbd-http-0.2.1-ldflags.patch25
-rw-r--r--sys-block/nbd-http/files/nbd-http-0.2.1-warnings.patch72
-rw-r--r--sys-block/nbd-http/metadata.xml8
-rw-r--r--sys-block/nbd-http/nbd-http-0.2.1.ebuild32
6 files changed, 172 insertions, 0 deletions
diff --git a/sys-block/nbd-http/Manifest b/sys-block/nbd-http/Manifest
new file mode 100644
index 0000000..c94e4aa
--- /dev/null
+++ b/sys-block/nbd-http/Manifest
@@ -0,0 +1 @@
+DIST nbd-http-0.2.1.tgz 7455 SHA256 4aa6acb91965dec2e24158c207a11951d6ec3b97f144247d2502c4e92e705cea SHA512 d80583ee6bb7bf1b23fd4958cd21b7050ae8ef43bf3a1bdb6a8cc1c189726a4ff2acc954a084a7eea20a98868324bd2390371dec5c8628be659cf79df97d6a4f WHIRLPOOL 11d181c2667b528dac7b7651c5903818ee33447756b47f1a003e417d93870a5d77c435d596abbac4832659aab1db74aa66d2944652b5997fe9c88aee742e6f86
diff --git a/sys-block/nbd-http/files/nbd-http-0.2.1-compile.patch b/sys-block/nbd-http/files/nbd-http-0.2.1-compile.patch
new file mode 100644
index 0000000..291fadd
--- /dev/null
+++ b/sys-block/nbd-http/files/nbd-http-0.2.1-compile.patch
@@ -0,0 +1,34 @@
+From dfda64c667db416ce6716ff191c3a05d56fe3c33 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Thu, 7 Feb 2013 20:36:30 +0100
+Subject: [PATCH 1/2] Fix compilation
+
+---
+ main.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/main.c b/main.c
+index 0467c62..31d9665 100644
+--- a/main.c
++++ b/main.c
+@@ -14,7 +14,6 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <ctype.h>
+-#include <asm/page.h>
+ #include <linux/types.h>
+ #include <byteswap.h>
+ #include <pthread.h>
+@@ -22,7 +21,9 @@
+ #include <signal.h>
+ #include <errno.h>
+ #include <assert.h>
++#include <linux/limits.h> /* for PATH_MAX */
+
++#define PAGE_SIZE 4096
+ #define BUFSZ (4 * PAGE_SIZE)
+ #define MAX_READAHEAD 2500 /* ms */
+ #define THREAD_CNT 2
+--
+1.7.12.4
+
diff --git a/sys-block/nbd-http/files/nbd-http-0.2.1-ldflags.patch b/sys-block/nbd-http/files/nbd-http-0.2.1-ldflags.patch
new file mode 100644
index 0000000..1a5acbb
--- /dev/null
+++ b/sys-block/nbd-http/files/nbd-http-0.2.1-ldflags.patch
@@ -0,0 +1,25 @@
+From 3df5e97fc23b3b51b49b5f699ac38914564ec2ac Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Thu, 7 Feb 2013 20:53:55 +0100
+Subject: [PATCH] Support LDFLAGS
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index f5f549a..9216188 100644
+--- a/Makefile
++++ b/Makefile
+@@ -7,7 +7,7 @@ OBJS=main.o
+ LIBS=-lpthread
+
+ nbd-http: $(OBJS)
+- $(CC) -o nbd-http $(OBJS) $(LIBS)
++ $(CC) $(LDFLAGS) $(TARGET_ARCH) -o $@ $(OBJS) $(LIBS)
+
+ clean:
+ $(RM) $(OBJS) nbd-http
+--
+1.7.12.4
+
diff --git a/sys-block/nbd-http/files/nbd-http-0.2.1-warnings.patch b/sys-block/nbd-http/files/nbd-http-0.2.1-warnings.patch
new file mode 100644
index 0000000..3ee5cab
--- /dev/null
+++ b/sys-block/nbd-http/files/nbd-http-0.2.1-warnings.patch
@@ -0,0 +1,72 @@
+From 15c48bb21172f1ee257cd9e4fc8eca7c627c764a Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Thu, 7 Feb 2013 20:36:51 +0100
+Subject: [PATCH 2/2] Fix GCC warnings
+
+---
+ main.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/main.c b/main.c
+index 31d9665..82f52d3 100644
+--- a/main.c
++++ b/main.c
+@@ -203,7 +203,7 @@ int handle_read(int sock, u64 from, u32 len, char * handle)
+ if (ret < 0)
+ PERROR("sendfile()");
+ else
+- DBG(0, "only read %d bytes\n", ret);
++ DBG(0, "only read %zd bytes\n", ret);
+ exit(0);
+ }
+ return 0;
+@@ -234,7 +234,7 @@ void handle_disc(int sock, char * handle)
+
+ void * req_loop(void * arg)
+ {
+- int sock = (int)arg;
++ int sock = (int)(long)arg;
+ int done = 0;
+
+ DBG(3, "waiting for requests\n");
+@@ -438,8 +438,8 @@ int http_open(http_t * http)
+ value += 2;
+ mem_tolower(line, value - line - 2);
+ DBG(5, "[%.*s]: [%.*s]\n",
+- value - line - 2, line,
+- ll - (value - line), value);
++ (int)(value - line - 2), line,
++ (int)(ll - (value - line)), value);
+
+ if (file_size == ~0ULL && ! memcmp(line, "content-length", 14)) {
+ file_size = atoll(value);
+@@ -569,7 +569,7 @@ int volunteer_req(int id)
+
+ void * thread_func(void * arg)
+ {
+- int id = (int)arg;
++ int id = (int)(long)arg;
+ thr_data_t * us = threads + id;
+ http_t http;
+
+@@ -725,7 +725,7 @@ int init_cache()
+ }
+
+ for (i=0; i<THREAD_CNT; i++)
+- pthread_create(&threads[i].tid, NULL, thread_func, (void *)i);
++ pthread_create(&threads[i].tid, NULL, thread_func, (void *)(long)i);
+
+ return 0;
+ }
+@@ -794,7 +794,7 @@ int main(int argc, char * argv[])
+ if (init_cache())
+ return 0;
+
+- if (pthread_create(&loop_tid, NULL, req_loop, (void *)socks[1]) != 0) {
++ if (pthread_create(&loop_tid, NULL, req_loop, (void *)(long)socks[1]) != 0) {
+ PERROR("pthread_create()");
+ return 0;
+ }
+--
+1.7.12.4
+
diff --git a/sys-block/nbd-http/metadata.xml b/sys-block/nbd-http/metadata.xml
new file mode 100644
index 0000000..16bcc9f
--- /dev/null
+++ b/sys-block/nbd-http/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>sping@gentoo.org</email>
+ <name>Sebastian Pipping</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-block/nbd-http/nbd-http-0.2.1.ebuild b/sys-block/nbd-http/nbd-http-0.2.1.ebuild
new file mode 100644
index 0000000..cafa435
--- /dev/null
+++ b/sys-block/nbd-http/nbd-http-0.2.1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="3"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Read a file over HTTP as a block device."
+HOMEPAGE="http://patraulea.com/nbd-http/"
+SRC_URI="http://patraulea.com/${PN}/src/${P}.tgz"
+
+LICENSE="all-rights-reserved" # i.e. not specific
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-{compile,ldflags,warnings}.patch
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" || die
+}
+
+src_install() {
+ dodoc ChangeLog README || die
+ dobin ${PN} || die
+}