diff options
author | Juergen Lock <nox@FreeBSD.org> | 2011-03-26 19:18:18 +0000 |
---|---|---|
committer | Juergen Lock <nox@FreeBSD.org> | 2011-03-26 19:18:18 +0000 |
commit | 64f3861442f393e33ffeae8143047216adf36ccf (patch) | |
tree | e1ceb847eefbe511dcbad2eea5f9c911418ba331 /multimedia/vdr-plugin-infosatepg | |
parent | cebeac87712e72006b582b214fc68ea4dd27c8dd (diff) | |
download | ports-64f3861442f393e33ffeae8143047216adf36ccf.tar.gz ports-64f3861442f393e33ffeae8143047216adf36ccf.zip |
Notes
Diffstat (limited to 'multimedia/vdr-plugin-infosatepg')
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/Makefile | 36 | ||||
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/distinfo | 2 | ||||
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/files/patch-Makefile | 21 | ||||
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/files/patch-filter.cpp | 110 | ||||
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/files/patch-filter.h | 13 | ||||
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/files/patch-global.cpp | 40 | ||||
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/files/patch-global.h | 22 | ||||
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/files/patch-infosatepg.cpp | 11 | ||||
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/files/patch-process.cpp | 26 | ||||
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/files/patch-readline.cpp | 50 | ||||
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/pkg-descr | 5 | ||||
-rw-r--r-- | multimedia/vdr-plugin-infosatepg/pkg-plist | 4 |
12 files changed, 340 insertions, 0 deletions
diff --git a/multimedia/vdr-plugin-infosatepg/Makefile b/multimedia/vdr-plugin-infosatepg/Makefile new file mode 100644 index 000000000000..b7a414d74580 --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/Makefile @@ -0,0 +1,36 @@ +# New ports collection makefile for: vdr-plugin-infosatepg +# Date created: Wed Apr 14 18:11:42 CEST 2010 +# Whom: Juergen Lock <nox@freebsd.org> +# +# $FreeBSD$ +# + +PORTNAME= vdr-plugin-infosatepg +PORTVERSION= 0.0.11 +PORTREVISION= 6 +CATEGORIES= multimedia +MASTER_SITES= http://projects.vdr-developer.org/attachments/download/342/ +DISTNAME= ${PORTNAME:S/-plugin-/-/}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX} +EXTRACT_SUFX= .tgz + +MAINTAINER= nox@FreeBSD.org +COMMENT= Video Disk Recorder - infosat EPG plugin + +PATCH_STRIP= -p1 +HAVE_CONFIGURE= yes +PORTDOCS= COPYING README +MAKE_JOBS_SAFE= yes +WRKSRC= ${WRKDIR}/${PLUGIN}-${DISTVERSION} + +.include "${.CURDIR}/../vdr/Makefile.plugins" + +post-patch: post-patch-plugin + +post-install: post-install-pluginlocales +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + (cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}) +.endif + ${INSTALL} -o ${VDR_USER} -g ${VDR_GROUP} -d /var/cache/vdr/${PLUGIN} + +.include <bsd.port.mk> diff --git a/multimedia/vdr-plugin-infosatepg/distinfo b/multimedia/vdr-plugin-infosatepg/distinfo new file mode 100644 index 000000000000..b9b123f29030 --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/distinfo @@ -0,0 +1,2 @@ +SHA256 (vdr/vdr-infosatepg-0.0.11.tgz) = 14495b07f15f928b9ae66d6ec2f6e9639aa0cf86865900b7d6a9e212d7eb80ac +SIZE (vdr/vdr-infosatepg-0.0.11.tgz) = 35585 diff --git a/multimedia/vdr-plugin-infosatepg/files/patch-Makefile b/multimedia/vdr-plugin-infosatepg/files/patch-Makefile new file mode 100644 index 000000000000..442e90a98803 --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/files/patch-Makefile @@ -0,0 +1,21 @@ +--- a/Makefile ++++ b/Makefile +@@ -97,7 +97,11 @@ i18n: $(I18Nmsgs) $(I18Npot) + + libvdr-$(PLUGIN).so: $(OBJS) + $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@ ++ifdef FREEBSD ++ @cp -f $@ $(LIBDIR)/$@.$(APIVERSION) ++else + @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION) ++endif + + dist: clean + @-rm -rf $(TMPDIR)/$(ARCHIVE) +@@ -110,3 +114,6 @@ dist: clean + + clean: + @-rm -f $(OBJS) $(DEPFILE) *.so* *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot ++ ++install: ++ ${INSTALL_PROGRAM} $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION) $(PREFIX)/lib/vdr/libvdr-$(PLUGIN).so.$(APIVERSION) diff --git a/multimedia/vdr-plugin-infosatepg/files/patch-filter.cpp b/multimedia/vdr-plugin-infosatepg/files/patch-filter.cpp new file mode 100644 index 000000000000..262ac078db15 --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/files/patch-filter.cpp @@ -0,0 +1,110 @@ +--- a/filter.cpp ++++ b/filter.cpp +@@ -6,6 +6,9 @@ + * $Id$ + */ + ++#include <sys/types.h> ++#include <sys/socket.h> ++#include <netinet/in.h> + #include <netinet/if_ether.h> + #include <unistd.h> + +@@ -47,24 +50,32 @@ u_short cFilterInfosatepg::foldsum(u_lon + return ((u_short) ~sum); + } + +-u_short cFilterInfosatepg::IPChecksum(iphdr *ipHeader) ++u_short cFilterInfosatepg::IPChecksum(ip *ipHeader) + { +- return foldsum(do_sum(0, (u_char*) ipHeader, sizeof(iphdr))); ++ return foldsum(do_sum(0, (u_char*) ipHeader, sizeof(ip))); + + } /* IpChecksum() */ + + +-u_short cFilterInfosatepg::UDPChecksum(iphdr *ipHeader, udphdr *udpHeader) ++u_short cFilterInfosatepg::UDPChecksum(ip *ipHeader, udphdr *udpHeader) + { + u_long sum = 0; + + // Ip-Pseudo-Header +- sum = do_sum(sum, (u_char*)(&ipHeader->saddr), sizeof(ipHeader->saddr)); +- sum = do_sum(sum, (u_char*)(&ipHeader->daddr), sizeof(ipHeader->daddr)); ++ sum = do_sum(sum, (u_char*)(&ipHeader->ip_src), sizeof(ipHeader->ip_src)); ++ sum = do_sum(sum, (u_char*)(&ipHeader->ip_dst), sizeof(ipHeader->ip_dst)); ++#ifdef __linux__ + sum += udpHeader->len; +- sum += ipHeader->protocol<<8; ++#else ++ sum += udpHeader->uh_ulen; ++#endif ++ sum += ipHeader->ip_p<<8; + ++#ifdef __linux__ + sum = do_sum(sum, (u_char*)udpHeader, ntohs(udpHeader->len)); ++#else ++ sum = do_sum(sum, (u_char*)udpHeader, ntohs(udpHeader->uh_ulen)); ++#endif + + return foldsum(sum); + } +@@ -78,27 +89,27 @@ void cFilterInfosatepg::Process(u_short + + if (Data[0]!=0x3E) return; + +- struct ethhdr eth_hdr; +- memset(ð_hdr,0,sizeof(struct ethhdr)); ++ struct ether_header eth_hdr; ++ memset(ð_hdr,0,sizeof(struct ether_header)); + +- eth_hdr.h_dest[0]=Data[11]; +- eth_hdr.h_dest[1]=Data[10]; +- eth_hdr.h_dest[2]=Data[9]; +- eth_hdr.h_dest[3]=Data[8]; +- eth_hdr.h_dest[4]=Data[4]; +- eth_hdr.h_dest[5]=Data[3]; ++ eth_hdr.ether_dhost[0]=Data[11]; ++ eth_hdr.ether_dhost[1]=Data[10]; ++ eth_hdr.ether_dhost[2]=Data[9]; ++ eth_hdr.ether_dhost[3]=Data[8]; ++ eth_hdr.ether_dhost[4]=Data[4]; ++ eth_hdr.ether_dhost[5]=Data[3]; + + // check mac and range + if (!global->CheckMAC(ð_hdr)) return; + +- int mac = eth_hdr.h_dest[5]; ++ int mac = eth_hdr.ether_dhost[5]; + global->ActualMac=mac; + +- struct iphdr *ip_hdr = (iphdr *) &Data[SECT_IP_HDR_START]; ++ struct ip *ip_hdr = (ip *) &Data[SECT_IP_HDR_START]; + struct udphdr *udp_hdr = (udphdr *) &Data[SECT_UDP_HDR_START]; + + // Only IPv4 +- if (ip_hdr->version!=4) return; ++ if (ip_hdr->ip_v!=4) return; + + // Check IP checksum + if (IPChecksum(ip_hdr)!=0) +@@ -108,7 +119,7 @@ void cFilterInfosatepg::Process(u_short + } + + // Only UDP +- if (ip_hdr->protocol!=17) return; ++ if (ip_hdr->ip_p!=17) return; + + // Check UDP checksum + if (UDPChecksum(ip_hdr,udp_hdr)!=0) +@@ -149,8 +160,8 @@ void cFilterInfosatepg::Process(u_short + + + #ifdef VDRDEBUG +- dsyslog("infosatepg: mac=%02x-%02x-%02x-%02x-%02x-%02x",eth_hdr.h_dest[0],eth_hdr.h_dest[1], +- eth_hdr.h_dest[2],eth_hdr.h_dest[3],eth_hdr.h_dest[4],eth_hdr.h_dest[5] ); ++ dsyslog("infosatepg: mac=%02x-%02x-%02x-%02x-%02x-%02x",eth_hdr.ether_dhost[0],eth_hdr.ether_dhost[1], ++ eth_hdr.ether_dhost[2],eth_hdr.ether_dhost[3],eth_hdr.ether_dhost[4],eth_hdr.ether_dhost[5] ); + + dsyslog("infosatepg: tid=%04i tbl=%04i stbl=%04i day=%02i month=%02i pktnr=%03i pktcnt=%03i len=%i", + ntohs(ishdr->technisatId),ishdr->tableId,ishdr->tablesubId,ishdr->day, diff --git a/multimedia/vdr-plugin-infosatepg/files/patch-filter.h b/multimedia/vdr-plugin-infosatepg/files/patch-filter.h new file mode 100644 index 000000000000..12eba25de4c9 --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/files/patch-filter.h @@ -0,0 +1,13 @@ +--- a/filter.h ++++ b/filter.h +@@ -33,8 +33,8 @@ private: + cGlobalInfosatepg *global; + u_long do_sum(u_long sum, u_char *buf, int nBytes); + u_short foldsum(u_long sum); +- u_short IPChecksum(iphdr *ipHeader); +- u_short UDPChecksum(iphdr *ipHeader, udphdr *udpHeader); ++ u_short IPChecksum(ip *ipHeader); ++ u_short UDPChecksum(ip *ipHeader, udphdr *udpHeader); + protected: + virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length); + public: diff --git a/multimedia/vdr-plugin-infosatepg/files/patch-global.cpp b/multimedia/vdr-plugin-infosatepg/files/patch-global.cpp new file mode 100644 index 000000000000..ef930518b315 --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/files/patch-global.cpp @@ -0,0 +1,40 @@ +--- a/global.cpp ++++ b/global.cpp +@@ -164,7 +164,11 @@ cGlobalInfosatepg::cGlobalInfosatepg() + MAC[3]=0x02; + MAC[4]=0x02; + WaitTime=10; // default 10 seconds ++#ifdef __FreeBSD__ ++ SetDirectory ("/var/cache/vdr/infosatepg"); ++#else + SetDirectory ("/tmp"); ++#endif + NoWakeup=false; + NoDeferredShutdown=false; + ActualMac=0; +@@ -194,17 +198,17 @@ bool cGlobalInfosatepg::SetDirectory(con + return true; + } + +-bool cGlobalInfosatepg::CheckMAC(struct ethhdr *eth_hdr) ++bool cGlobalInfosatepg::CheckMAC(ether_header *eth_hdr) + { + if (!eth_hdr) return false; +- if (eth_hdr->h_dest[0]!=MAC[0]) return false; +- if (eth_hdr->h_dest[1]!=MAC[1]) return false; +- if (eth_hdr->h_dest[2]!=MAC[2]) return false; +- if (eth_hdr->h_dest[3]!=MAC[3]) return false; +- if (eth_hdr->h_dest[4]!=MAC[4]) return false; ++ if (eth_hdr->ether_dhost[0]!=MAC[0]) return false; ++ if (eth_hdr->ether_dhost[1]!=MAC[1]) return false; ++ if (eth_hdr->ether_dhost[2]!=MAC[2]) return false; ++ if (eth_hdr->ether_dhost[3]!=MAC[3]) return false; ++ if (eth_hdr->ether_dhost[4]!=MAC[4]) return false; + +- if (eth_hdr->h_dest[5]<EPG_FIRST_DAY_MAC) return false; +- if (eth_hdr->h_dest[5]>EPG_LAST_DAY_MAC) return false; ++ if (eth_hdr->ether_dhost[5]<EPG_FIRST_DAY_MAC) return false; ++ if (eth_hdr->ether_dhost[5]>EPG_LAST_DAY_MAC) return false; + + return true; + } diff --git a/multimedia/vdr-plugin-infosatepg/files/patch-global.h b/multimedia/vdr-plugin-infosatepg/files/patch-global.h new file mode 100644 index 000000000000..3d2c418628a0 --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/files/patch-global.h @@ -0,0 +1,22 @@ +--- a/global.h ++++ b/global.h +@@ -9,8 +9,10 @@ + #ifndef __global_h_ + #define __global_h_ + ++#include <sys/socket.h> + #include <netinet/if_ether.h> + #include <sys/types.h> ++#include <ctype.h> + + #include <vdr/channels.h> + #include <vdr/timers.h> +@@ -162,7 +164,7 @@ public: + return directory; + } + bool SetDirectory (const char *Directory); +- bool CheckMAC (struct ethhdr *eth_hdr); ++ bool CheckMAC (ether_header *eth_hdr); + void SetWaitTimer() + { + timer=time (NULL); diff --git a/multimedia/vdr-plugin-infosatepg/files/patch-infosatepg.cpp b/multimedia/vdr-plugin-infosatepg/files/patch-infosatepg.cpp new file mode 100644 index 000000000000..620910c6656e --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/files/patch-infosatepg.cpp @@ -0,0 +1,11 @@ +--- a/infosatepg.cpp ++++ b/infosatepg.cpp +@@ -403,7 +403,7 @@ cString cPluginInfosatepg::SVDRPCommand( + cString head2; + head2="\n" \ + " | | missed | | | unlocated\n" \ +- " Day | Date | Packets | Received %% | Processed | Events\n" \ ++ " Day | Date | Packets | Received % | Processed | Events\n" \ + "------+--------+---------+------------+------------+----------\n"; + + cString mstr; diff --git a/multimedia/vdr-plugin-infosatepg/files/patch-process.cpp b/multimedia/vdr-plugin-infosatepg/files/patch-process.cpp new file mode 100644 index 000000000000..7abc929f0483 --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/files/patch-process.cpp @@ -0,0 +1,26 @@ +--- a/process.cpp ++++ b/process.cpp +@@ -1047,7 +1047,9 @@ bool cProcessInfosatepg::ParseInfosatepg + int ieventnr=1; + cChannel *chan=NULL; + cInfosatevent *ievent=NULL; +-#if VDRVERSNUM < 10701 ++// XXX don't default to assuming UTF-8 on FreeBSD (that's what the NULL does), ++// its still often used without. ++#if VDRVERSNUM < 10701 || defined(__FreeBSD__) + cCharSetConv *conv = new cCharSetConv("ISO-8859-1",cCharSetConv::SystemCharacterTable() ? + cCharSetConv::SystemCharacterTable() : "UTF-8"); + #else +@@ -1139,7 +1141,12 @@ bool cProcessInfosatepg::ParseInfosatepg + } + int shour,sminute; + char *title; ++#ifdef __FreeBSD__ ++ title = (char *)malloc(strlen(s)); ++ fields=sscanf(s,"%d:%d %[^^]",&shour,&sminute,title); ++#else + fields=sscanf(s,"%d:%d %a[^^]",&shour,&sminute,&title); ++#endif + if (fields==3) + { + if (!ievent) ievent = new cInfosatevent; diff --git a/multimedia/vdr-plugin-infosatepg/files/patch-readline.cpp b/multimedia/vdr-plugin-infosatepg/files/patch-readline.cpp new file mode 100644 index 000000000000..c16dbcdbb13a --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/files/patch-readline.cpp @@ -0,0 +1,50 @@ +--- a/readline.cpp ++++ b/readline.cpp +@@ -10,6 +10,15 @@ + #include <stdio.h> + #include "readline.h" + ++#ifdef __FreeBSD__ ++#include <string.h> ++#if __FreeBSD_version > 800000 ++#define HAVE_GETLINE ++#endif ++#else ++#define HAVE_GETLINE ++#endif ++ + extern char *strcatrealloc(char *dest, const char *src); + + // --- cReadLineInfosatepg --------------------------------------------------- +@@ -36,7 +45,31 @@ char *cReadLineInfosatepg::Read(FILE *f, + do + { + ext=false; ++#ifndef HAVE_GETLINE ++ size_t n; ++ ++ if (!tempbuffer) ++ { ++ if (!(tempbuffer = (char *)malloc(tempsize = 4096))) ++ return NULL; ++ } ++ if (!fgets(tempbuffer, tempsize, f)) ++ { ++ if (tempbuffer) free(tempbuffer); ++ return buffer; ++ } ++ while ((n = strlen(tempbuffer)) >= tempsize - 1 && ++ tempbuffer[n - 1] != '\n') ++ { ++ if (!(tempbuffer = (char *)realloc(tempbuffer, tempsize * 2))) ++ return NULL; ++ tempsize *= 2; ++ if (!fgets(tempbuffer + n, tempsize - n, f)) ++ break; ++ } ++#else + int n = getline(&tempbuffer, &tempsize, f); ++#endif + if (n > 0) + { + if (tempbuffer[n-1] == '\n') diff --git a/multimedia/vdr-plugin-infosatepg/pkg-descr b/multimedia/vdr-plugin-infosatepg/pkg-descr new file mode 100644 index 000000000000..909346f183c1 --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/pkg-descr @@ -0,0 +1,5 @@ +http://vdr-wiki.de/wiki/index.php/Infosatepg-plugin + +This plugin reads infosat EPG data from DVB-S. + +WWW: http://projects.vdr-developer.org/projects/show/plg-infosatepg diff --git a/multimedia/vdr-plugin-infosatepg/pkg-plist b/multimedia/vdr-plugin-infosatepg/pkg-plist new file mode 100644 index 000000000000..305b7f3f6ed5 --- /dev/null +++ b/multimedia/vdr-plugin-infosatepg/pkg-plist @@ -0,0 +1,4 @@ +lib/vdr/libvdr-infosatepg.so.1.7.17 +@exec /usr/bin/install -o %%VDR_USER%% -g %%VDR_GROUP%% -d /var/cache/vdr/infosatepg +%%NLS%%share/locale/de_DE/LC_MESSAGES/vdr-infosatepg.mo +%%NLS%%share/locale/it_IT/LC_MESSAGES/vdr-infosatepg.mo |