diff options
-rw-r--r-- | CHANGELOG | 7 | ||||
-rw-r--r-- | Makefile | 126 | ||||
-rw-r--r-- | ffnetdev.c | 9 | ||||
-rw-r--r-- | i18n.c | 60 | ||||
-rw-r--r-- | i18n.h | 15 | ||||
-rw-r--r-- | po/de_DE.po | 31 | ||||
-rw-r--r-- | tableinitcmtemplate.c | 2 | ||||
-rw-r--r-- | tools/select.h | 2 | ||||
-rw-r--r-- | tools/socket.h | 4 | ||||
-rw-r--r-- | tools/source.h | 2 |
10 files changed, 114 insertions, 144 deletions
@@ -97,4 +97,9 @@ Changelog 2012-01-06: ffnetdev-0.1.2 - fixed two bugs: bug#741 (video freeze) and bug#742 (buffer overflow in - osdworker) + osdworker) + + 2013-09-10 ffnetdev-0.1.3 + - completely rewrite Makefile based on VDR 2.x Plugin Makefile + - Migrated to new Internalization: po/de_DE as german translation + - other languages still missing @@ -1,117 +1,125 @@ # # Makefile for a Video Disk Recorder plugin # +# $Id: Makefile 2.18 2013/01/12 13:45:01 kls Exp $ # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. # By default the main source file also carries this name. -# -PLUGIN = ffnetdev - -# Debugging on/off -FFNETDEV_DEBUG = 1 +PLUGIN = ffnetdev ### The version number of this plugin (taken from the main source file): -VERSION = $(shell grep 'const char .*VERSION *=' ffnetdev.c | awk '{ print $$5 }' | sed -e 's/[";]//g') +VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') -### The C++ compiler and options: +### The directory environment: -CXX ?= g++ -CXXFLAGS ?= -W -Woverloaded-virtual +# Use package data if installed...otherwise assume we're under the VDR source directory: +PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) +LIBDIR = $(call PKGCFG,libdir) +LOCDIR = $(call PKGCFG,locdir) +PLGCFG = $(call PKGCFG,plgcfg) +# +TMPDIR ?= /tmp -### The directory environment: +### The compiler options: -DVBDIR = ../../../../DVB -VDRDIR = ../../.. -LIBDIR = ../../lib -TMPDIR = /tmp +export CFLAGS = $(call PKGCFG,cflags) +export CXXFLAGS = $(call PKGCFG,cxxflags) -### Allow user defined options to overwrite defaults: +### The version number of VDR's plugin API: --include $(VDRDIR)/Make.config +APIVERSION = $(call PKGCFG,apiversion) -### The version number of VDR (taken from VDR's "config.h"): +### Allow user defined options to overwrite defaults: -APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') +-include $(PLGCFG) ### The name of the distribution archive: ARCHIVE = $(PLUGIN)-$(VERSION) PACKAGE = vdr-$(ARCHIVE) -### Includes and Defines (add further entries here): +### The name of the shared object file: -INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include -I. +SOFILE = libvdr-$(PLUGIN).so -DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +### Includes and Defines (add further entries here): +INCLUDES += -### The object files (add further files here): - -COMMONOBJS = i18n.o \ - \ - tools/source.o tools/select.o tools/socket.o tools/tools.o +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +### The object files (add further files here): -SERVEROBJS = $(PLUGIN).o \ - \ - ffnetdev.o ffnetdevsetup.o osdworker.o tsworker.o clientcontrol.o netosd.o streamdevice.o \ +OBJS = $(PLUGIN).o \ + ffnetdevsetup.o osdworker.o tsworker.o clientcontrol.o netosd.o streamdevice.o \ pes2ts.o remote.o vncEncodeRRE.o vncEncodeCoRRE.o vncEncodeHexT.o \ vncEncoder.o translate.o \ -ifdef DEBUG - FFNETDEV_DEBUG = 1 -endif +### The main target: -ifdef FFNETDEV_DEBUG - DEFINES += -DDEBUG - CXXFLAGS += -g -else - CXXFLAGS += -O2 -endif +all: $(SOFILE) i18n ### Implicit rules: %.o: %.c $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< -# Dependencies: +### Dependencies: -MAKEDEP = g++ -MM -MG +MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies -ifdef GCC3 -$(DEPFILE): Makefile - @rm -f $@ - @for i in $(SERVEROBJS:%.o=%.c) $(COMMONOBJS:%.o=%.c) ; do \ - $(MAKEDEP) $(DEFINES) $(INCLUDES) -MT "`dirname $$i`/`basename $$i .c`.o" $$i >>$@ ; \ - done -else $(DEPFILE): Makefile - @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(SERVEROBJS:%.o=%.c) \ - $(COMMONOBJS:%.o=%.c) > $@ -endif + @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ -include $(DEPFILE) +### Internationalization (I18N): + +PODIR = po +I18Npo = $(wildcard $(PODIR)/*.po) +I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) +I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Npot = $(PODIR)/$(PLUGIN).pot + +%.mo: %.po + msgfmt -c -o $@ $< + +$(I18Npot): $(wildcard *.c) + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^` + +%.po: $(I18Npot) + msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< + @touch $@ + +$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + install -D -m644 $< $@ + +.PHONY: i18n +i18n: $(I18Nmo) $(I18Npot) + +install-i18n: $(I18Nmsgs) + ### Targets: -all: libvdr-$(PLUGIN).so +$(SOFILE): $(OBJS) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@ -libvdr-$(PLUGIN).so: $(SERVEROBJS) $(COMMONOBJS) +install-lib: $(SOFILE) + install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION) -%.so: - $(CXX) $(CXXFLAGS) -shared $^ -o $@ - @cp $@ $(LIBDIR)/$@.$(APIVERSION) +install: install-lib install-i18n -dist: clean +dist: $(I18Npo) clean @-rm -rf $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE) - @tar cjf $(PACKAGE).tar.bz2 --exclude SCCS -C $(TMPDIR) $(ARCHIVE) + @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE) - @echo Distribution package created as $(PACKAGE).tar.bz2 + @echo Distribution package created as $(PACKAGE).tgz clean: - @-rm -f $(COMMONOBJS) $(SERVEROBJS) $(DEPFILE) *.so *.tar.bz2 core* *~ *.bak + @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot + @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ @@ -10,7 +10,7 @@ #include <vdr/tools.h> -#include "i18n.h" +//#include "i18n.h" #include "tsworker.h" #include "netosd.h" #include "ffnetdev.h" @@ -21,8 +21,9 @@ #include "ffnetdevsetup.h" -const char *cPluginFFNetDev::VERSION = "0.1.2"; -const char *cPluginFFNetDev::DESCRIPTION = "Full Featured Network Device for Streaming"; +static const char *VERSION = "0.1.3"; +const char *cPluginFFNetDev::VERSION = VERSION; +const char *cPluginFFNetDev::DESCRIPTION = trNOOP("Full Featured Network Device for Streaming"); //const char *cOSDWorker::MAINMENUENTRY = "FFNetDev"; // --- cNetOSDProvider ----------------------------------------------- @@ -163,7 +164,7 @@ bool cPluginFFNetDev::Active(void) { bool cPluginFFNetDev::Start(void) { // Start any background activities the plugin shall perform. - RegisterI18n(Phrases); +// RegisterI18n(Phrases); cOSDWorker::Init(OSDPort, this); @@ -1,60 +0,0 @@ -/* - * i18n.c: Internationalization - * - * See the README file for copyright information and how to reach the author. - * - */ - -#include "i18n.h" - -const tI18nPhrase Phrases[] = { - { "Full Featured Network Device for Streaming", - "Full Featured Network Device for Streaming", - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - }, - { "auto set as primary device", - "auto set as primary device", - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - }, - { "ffnetdev is running", - "ffnetdev läuft gerade", - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - }, - { NULL } - }; @@ -1,15 +0,0 @@ -/* - * i18n.h: Internationalization - * - * See the README file for copyright information and how to reach the author. - * - */ - -#ifndef _I18N__H -#define _I18N__H - -#include <vdr/i18n.h> - -extern const tI18nPhrase Phrases[]; - -#endif //_I18N__H diff --git a/po/de_DE.po b/po/de_DE.po new file mode 100644 index 0000000..0cb70bd --- /dev/null +++ b/po/de_DE.po @@ -0,0 +1,31 @@ +# VDR plugin language source file. +# +# See the README file for copyright information and how to reach the auhor. +# +msgid "" +msgstr "" +"Project-Id-Version: vdr-plugin-ffnetdev \n" +"Report-Msgid-Bugs-To: <see README>\n" +"POT-Creation-Date: 2013-09-10 23:05+0200\n" +"PO-Revision-Date: 2007-08-11 12:34+0200\n" +"Last-Translator: Stefan Schallenberg <infos@nafets.de>\n" +"Language-Team: German \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "Full Featured Network Device for Streaming" +msgstr "" + +msgid "ffnetdev is running" +msgstr "ffnetdev läuft" + +msgid "auto set as primary device" +msgstr "automatisch als primäres device definieren" + +msgid "no" +msgstr "nein" + +msgid "yes" +msgstr "ja" diff --git a/tableinitcmtemplate.c b/tableinitcmtemplate.c index e31b5b4..88b7132 100644 --- a/tableinitcmtemplate.c +++ b/tableinitcmtemplate.c @@ -22,7 +22,7 @@ CONCAT2E(rfbInitColourMapSingleTable,OUTBPP) #include <vdr/plugin.h> -#include <osdworker.h> +#include "osdworker.h" // THIS CODE HAS BEEN MODIFIED FROM THE ORIGINAL UNIX SOURCE // TO WORK FOR WINVNC. THE PALETTE SHOULD REALLY BE RETRIEVED diff --git a/tools/select.h b/tools/select.h index 7e873e2..7071718 100644 --- a/tools/select.h +++ b/tools/select.h @@ -1,7 +1,7 @@ #ifndef TOOLBOX_SELECT_H #define TOOLBOX_SELECT_H -#include "tools/tools.h" +#include "tools.h" #include <sys/types.h> diff --git a/tools/socket.h b/tools/socket.h index ee9c632..ceaad78 100644 --- a/tools/socket.h +++ b/tools/socket.h @@ -1,8 +1,8 @@ #ifndef TOOLBOX_SOCKET_H #define TOOLBOX_SOCKET_H -#include "tools/tools.h" -#include "tools/source.h" +#include "tools.h" +#include "source.h" #include <sys/socket.h> #include <netinet/in.h> diff --git a/tools/source.h b/tools/source.h index 09c4bf3..0e001b7 100644 --- a/tools/source.h +++ b/tools/source.h @@ -1,7 +1,7 @@ #ifndef TOOLBOX_SOURCE_H #define TOOLBOX_SOURCE_H -#include "tools/tools.h" +#include "tools.h" #include <sys/types.h> #include <string> |