aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2006-12-31 04:25:28 +0800
committermiwi <miwi@FreeBSD.org>2006-12-31 04:25:28 +0800
commit510da5c7f93c8d6559d1cb3f02cbbe2a72669c0b (patch)
tree9168609cd5e3cc71729124bbcdfd5b998baecebd /net
parent05179dfd79b984c78d87a255c6b95ec947d0e8e8 (diff)
downloadfreebsd-ports-gnome-510da5c7f93c8d6559d1cb3f02cbbe2a72669c0b.tar.gz
freebsd-ports-gnome-510da5c7f93c8d6559d1cb3f02cbbe2a72669c0b.tar.zst
freebsd-ports-gnome-510da5c7f93c8d6559d1cb3f02cbbe2a72669c0b.zip
- Fix problems with libintl
- Fix many compiler warnings Submitted by: Volker Theile (maintainer via privat mail)
Diffstat (limited to 'net')
-rw-r--r--net/ushare/Makefile5
-rw-r--r--net/ushare/files/patch-Makefile.am10
-rw-r--r--net/ushare/files/patch-Makefile.in20
-rw-r--r--net/ushare/files/patch-cfgparser.c59
-rw-r--r--net/ushare/files/patch-getline.c35
-rw-r--r--net/ushare/files/patch-getline.h11
-rw-r--r--net/ushare/files/patch-http.c13
-rw-r--r--net/ushare/files/patch-strndup.c16
-rw-r--r--net/ushare/files/patch-strndup.h11
-rw-r--r--net/ushare/files/patch-ushare.c8
-rw-r--r--net/ushare/files/patch-ushare.h17
11 files changed, 133 insertions, 72 deletions
diff --git a/net/ushare/Makefile b/net/ushare/Makefile
index 1ce36d5cc3de..f390c212a3f9 100644
--- a/net/ushare/Makefile
+++ b/net/ushare/Makefile
@@ -7,6 +7,7 @@
PORTNAME= ushare
PORTVERSION= 0.9.8
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= http://ushare.geexbox.org/releases/
@@ -22,11 +23,11 @@ MAN1= ${PORTNAME}.1
USE_BZIP2= yes
GNU_CONFIGURE= yes
-CONFIGURE_ARGS= --with-libiconv-prefix=${LOCALBASE}/lib --mandir=${LOCALBASE}/man
+CONFIGURE_ARGS= --with-libiconv-prefix=${LOCALBASE}/lib --with-libintl-prefix=${LOCALBASE}/lib --mandir=${LOCALBASE}/man
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/src/${PORTNAME} ${PREFIX}/bin
- ${MV} ${WRKSRC}/scripts/${PORTNAME}.conf ${PREFIX}/etc/${PORTNAME}.conf.sample
+ ${CP} ${WRKSRC}/scripts/${PORTNAME}.conf ${PREFIX}/etc/${PORTNAME}.conf.sample
${INSTALL_MAN} ${WRKSRC}/src/${PORTNAME}.1 ${PREFIX}/man/man1
.include <bsd.port.mk>
diff --git a/net/ushare/files/patch-Makefile.am b/net/ushare/files/patch-Makefile.am
new file mode 100644
index 000000000000..abb8c52a6fa7
--- /dev/null
+++ b/net/ushare/files/patch-Makefile.am
@@ -0,0 +1,10 @@
+--- src/Makefile.am.orig Thu Nov 2 22:24:08 2006
++++ src/Makefile.am Sat Dec 23 03:44:42 2006
+@@ -1,5 +1,7 @@
+ bin_PROGRAMS=ushare
+ ushare_SOURCES= \
++ strndup.h strndup.c \
++ getline.h getline.c \
+ cds.h cds.c \
+ cms.h cms.c \
+ msr.h msr.c \
diff --git a/net/ushare/files/patch-Makefile.in b/net/ushare/files/patch-Makefile.in
new file mode 100644
index 000000000000..474a69239374
--- /dev/null
+++ b/net/ushare/files/patch-Makefile.in
@@ -0,0 +1,20 @@
+--- src/Makefile.in.orig Sun Dec 10 18:39:08 2006
++++ src/Makefile.in Sat Dec 23 13:32:07 2006
+@@ -59,7 +59,7 @@
+ http.$(OBJEXT) presentation.$(OBJEXT) metadata.$(OBJEXT) \
+ mime.$(OBJEXT) services.$(OBJEXT) buffer.$(OBJEXT) \
+ util_iconv.$(OBJEXT) content.$(OBJEXT) cfgparser.$(OBJEXT) \
+- trace.$(OBJEXT) ushare.$(OBJEXT)
++ trace.$(OBJEXT) ushare.$(OBJEXT) getline.$(OBJEXT) strndup.$(OBJEXT)
+ ushare_OBJECTS = $(am_ushare_OBJECTS)
+ ushare_LDADD = $(LDADD)
+ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+@@ -182,6 +182,8 @@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
+ ushare_SOURCES = \
++ strndup.h strndup.c \
++ getline.h getline.c \
+ cds.h cds.c \
+ cms.h cms.c \
+ msr.h msr.c \
diff --git a/net/ushare/files/patch-cfgparser.c b/net/ushare/files/patch-cfgparser.c
index b046749e16b5..71bb1ef497f6 100644
--- a/net/ushare/files/patch-cfgparser.c
+++ b/net/ushare/files/patch-cfgparser.c
@@ -1,53 +1,14 @@
---- src/cfgparser_orig.c Sun Nov 12 13:40:35 2006
-+++ src/cfgparser.c Mon Dec 11 09:58:17 2006
-@@ -38,6 +38,50 @@
+--- src/cfgparser.c.orig Sun Nov 12 13:40:35 2006
++++ src/cfgparser.c Sat Dec 23 03:33:22 2006
+@@ -36,6 +36,11 @@
+ #include "ushare.h"
+ #include "trace.h"
- #define USHARE_DIR_DELIM ","
-
-+#if (defined(__unix__) || defined(unix)) && !defined(USG)
-+char *strndup(const char *s, size_t n) {
-+ size_t len;
-+ char *sdup;
-+ if(!s)
-+ return NULL;
-+ len = strlen(s);
-+ len = (n < len ? n : len);
-+ sdup = (char *)malloc(len + 1);
-+ if(sdup) {
-+ memcpy(sdup, s, len);
-+ sdup[len] = '\0';
-+ }
-+ return sdup;
-+}
-+
-+ssize_t getline(char **lineptr, size_t *n, FILE *stream) {
-+ static char line[256];
-+ char *ptr;
-+ unsigned int len;
-+ if(lineptr == NULL || n == NULL) {
-+ return -1;
-+ }
-+ if(ferror(stream))
-+ return -1;
-+ if(feof(stream))
-+ return -1;
-+ fgets(line,256,stream);
-+ ptr = strchr(line,'\n');
-+ if(ptr)
-+ *ptr = '\0';
-+ len = strlen(line);
-+ if((len+1) < 256) {
-+ ptr = realloc(*lineptr, 256);
-+ if(ptr == NULL)
-+ return(-1);
-+ *lineptr = ptr;
-+ *n = 256;
-+ }
-+ strcpy(*lineptr,line);
-+ return(len);
-+}
++#if defined(__FreeBSD__)
++#include "strndup.h"
++#include "getline.h"
+#endif
+
+ #define USHARE_DIR_DELIM ","
+
static bool
- ignore_line (const char *line)
- {
diff --git a/net/ushare/files/patch-getline.c b/net/ushare/files/patch-getline.c
new file mode 100644
index 000000000000..eca56d7c253c
--- /dev/null
+++ b/net/ushare/files/patch-getline.c
@@ -0,0 +1,35 @@
+--- src/getline.c.orig Sat Dec 23 02:49:09 2006
++++ src/getline.c Sat Dec 23 13:26:42 2006
+@@ -0,0 +1,32 @@
++#include <sys/types.h>
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include "getline.h"
++
++ssize_t getline(char **lineptr, size_t *n, FILE *stream) {
++ static char line[256];
++ char *ptr;
++ unsigned int len;
++ if(lineptr == NULL || n == NULL) {
++ return -1;
++ }
++ if(ferror(stream))
++ return -1;
++ if(feof(stream))
++ return -1;
++ fgets(line,256,stream);
++ ptr = strchr(line,'\n');
++ if(ptr)
++ *ptr = '\0';
++ len = strlen(line);
++ if((len+1) < 256) {
++ ptr = realloc(*lineptr, 256);
++ if(ptr == NULL)
++ return(-1);
++ *lineptr = ptr;
++ *n = 256;
++ }
++ strcpy(*lineptr,line);
++ return(len);
++}
diff --git a/net/ushare/files/patch-getline.h b/net/ushare/files/patch-getline.h
new file mode 100644
index 000000000000..4510fef82ea6
--- /dev/null
+++ b/net/ushare/files/patch-getline.h
@@ -0,0 +1,11 @@
+--- src/getline.h.orig Sat Dec 23 02:49:13 2006
++++ src/getline.h Sat Dec 23 13:24:11 2006
+@@ -0,0 +1,8 @@
++#ifndef _GETLINE_H_
++#define _GETLINE_H_
++
++#if defined(__FreeBSD__) || defined(__OpenBSD__)
++ssize_t getline(char **lineptr, size_t *n, FILE *stream);
++#endif
++
++#endif /* _GETLINE_H_ */
diff --git a/net/ushare/files/patch-http.c b/net/ushare/files/patch-http.c
new file mode 100644
index 000000000000..f7075bdfa215
--- /dev/null
+++ b/net/ushare/files/patch-http.c
@@ -0,0 +1,13 @@
+--- src/http.c.orig Sun Nov 12 13:40:35 2006
++++ src/http.c Sat Dec 23 02:47:10 2006
+@@ -47,6 +47,10 @@
+ #include "trace.h"
+ #include "presentation.h"
+
++#if defined(__FreeBSD__)
++#include "strndup.h"
++#endif
++
+ struct web_file_t {
+ char *fullpath;
+ size_t pos;
diff --git a/net/ushare/files/patch-strndup.c b/net/ushare/files/patch-strndup.c
new file mode 100644
index 000000000000..29471085d84b
--- /dev/null
+++ b/net/ushare/files/patch-strndup.c
@@ -0,0 +1,16 @@
+--- src/strndup.c.orig Sat Dec 23 02:49:09 2006
++++ src/strndup.c Sat Dec 23 13:36:14 2006
+@@ -0,0 +1,13 @@
++#include <sys/types.h>
++#include <stdlib.h>
++#include <string.h>
++#include "strndup.h"
++
++char *strndup(const char *s, size_t n) {
++ char *dup = (char *)malloc(n+1);
++ if(dup) {
++ strncpy(dup,s,n);
++ dup[n]= '\0';
++ }
++ return dup;
++}
diff --git a/net/ushare/files/patch-strndup.h b/net/ushare/files/patch-strndup.h
new file mode 100644
index 000000000000..8239f5baaa4d
--- /dev/null
+++ b/net/ushare/files/patch-strndup.h
@@ -0,0 +1,11 @@
+--- src/strndup.h.orig Sat Dec 23 02:49:13 2006
++++ src/strndup.h Sat Dec 23 13:24:04 2006
+@@ -0,0 +1,8 @@
++#ifndef _STRNDUP_H_
++#define _STRNDUP_H_
++
++#if defined(__FreeBSD__) || defined(__OpenBSD__)
++char *strndup(const char *s, size_t n);
++#endif
++
++#endif /* _STRNDUP_H_ */
diff --git a/net/ushare/files/patch-ushare.c b/net/ushare/files/patch-ushare.c
index 8d2f503e9ad7..0a48a4d975ba 100644
--- a/net/ushare/files/patch-ushare.c
+++ b/net/ushare/files/patch-ushare.c
@@ -1,10 +1,10 @@
---- src/ushare_orig.c Sun Nov 12 13:40:35 2006
-+++ src/ushare.c Mon Dec 11 09:59:04 2006
+--- src/ushare.c.orig Sun Nov 12 13:40:35 2006
++++ src/ushare.c Sat Dec 23 02:11:43 2006
@@ -33,6 +33,11 @@
#include <unistd.h>
#include <errno.h>
#include <getopt.h>
-+#if (defined(__unix__) || defined(unix)) && !defined(USG)
++#if defined(__FreeBSD__)
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <net/if_dl.h>
@@ -16,7 +16,7 @@
static char *
create_udn (char *interface)
{
-+#if (defined(__unix__) || defined(unix)) && !defined(USG)
++#if defined(__FreeBSD__)
+ int mib[6], len;
+ char *buf;
+ unsigned char *ptr;
diff --git a/net/ushare/files/patch-ushare.h b/net/ushare/files/patch-ushare.h
deleted file mode 100644
index babf67549386..000000000000
--- a/net/ushare/files/patch-ushare.h
+++ /dev/null
@@ -1,17 +0,0 @@
---- src/ushare.h.orig Sun Nov 12 13:40:36 2006
-+++ src/ushare.h Wed Dec 13 17:16:10 2006
-@@ -101,4 +101,14 @@
-
- inline void display_headers (void);
-
-+#if (defined(__unix__) || defined(unix)) && !defined(USG)
-+#ifndef HAVE_STRNDUP
-+char *strndup(const char *s, size_t n);
-+#endif
-+
-+#ifndef HAVE_GETLINE
-+ssize_t getline(char **lineptr, size_t *n, FILE *stream);
-+#endif
-+#endif
-+
- #endif /* _USHARE_H_ */