2010-04-13 21:34:11 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Ushare < Formula
|
2010-04-13 21:34:11 +00:00
|
|
|
homepage 'http://ushare.geexbox.org/'
|
2012-03-11 23:27:04 +00:00
|
|
|
url 'http://ushare.geexbox.org/releases/ushare-1.1a.tar.bz2'
|
2012-06-12 16:55:32 +00:00
|
|
|
sha1 '1539e83cde5d80f433d262d971f5fe78486c9375'
|
2010-04-13 21:34:11 +00:00
|
|
|
|
2012-06-12 16:55:32 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-04-13 21:34:11 +00:00
|
|
|
depends_on 'gettext'
|
|
|
|
depends_on 'libupnp'
|
|
|
|
depends_on 'libdlna'
|
|
|
|
|
2013-11-10 02:39:43 +00:00
|
|
|
# Fix compilation with newer libupnp
|
|
|
|
def patches; DATA; end
|
2010-04-13 21:34:11 +00:00
|
|
|
|
|
|
|
def install
|
2013-11-10 02:39:43 +00:00
|
|
|
ENV.append 'CFLAGS', '-std=gnu89'
|
|
|
|
|
2012-03-11 23:27:04 +00:00
|
|
|
# Need to explicitly add intl and gettext here.
|
2014-02-26 05:37:58 +00:00
|
|
|
gettext = Formula["gettext"]
|
2011-03-29 19:33:19 +00:00
|
|
|
ENV.append 'CFLAGS', "-I#{gettext.include}"
|
2012-06-12 16:55:32 +00:00
|
|
|
ENV.append 'LDFLAGS', "-lintl"
|
2010-04-13 21:34:11 +00:00
|
|
|
|
|
|
|
inreplace 'configure', /config.h/, 'src/config.h'
|
|
|
|
system "./configure", "--disable-debug",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--enable-dlna",
|
|
|
|
"--with-libupnp-dir=#{HOMEBREW_PREFIX}",
|
|
|
|
"--with-libdlna-dir=#{HOMEBREW_PREFIX}",
|
|
|
|
"--disable-strip"
|
|
|
|
system "make install"
|
|
|
|
man1.install "src/ushare.1"
|
|
|
|
end
|
|
|
|
end
|
2013-07-21 07:39:31 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/src/ushare.c b/src/ushare.c
|
|
|
|
index 717e862..8e51bf7 100644
|
|
|
|
--- a/src/ushare.c
|
|
|
|
+++ b/src/ushare.c
|
|
|
|
@@ -188,7 +188,7 @@ handle_action_request (struct Upnp_Action_Request *request)
|
|
|
|
if (strcmp (request->DevUDN + 5, ut->udn))
|
|
|
|
return;
|
|
|
|
|
|
|
|
- ip = request->CtrlPtIPAddr.s_addr;
|
|
|
|
+ ip = ((struct sockaddr *) &request->CtrlPtIPAddr)->sa_data;
|
|
|
|
ip = ntohl (ip);
|
|
|
|
sprintf (val, "%d.%d.%d.%d",
|
|
|
|
(ip >> 24) & 0xFF, (ip >> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF);
|