From c87f52c52b81748cdf50153e72aabfcc2a1fcfa4 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 7 Sep 2024 21:00:25 -0400 Subject: [PATCH] misc/lppf: Add missing patches. Signed-off-by: B. Watson Signed-off-by: Willy Sudiarto Raharjo --- misc/lppf/Makefile.diff | 45 +++++++++++++++++++++++++++++++++++++++++ misc/lppf/braces.diff | 17 ++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 misc/lppf/Makefile.diff create mode 100644 misc/lppf/braces.diff diff --git a/misc/lppf/Makefile.diff b/misc/lppf/Makefile.diff new file mode 100644 index 0000000000..14edb1f202 --- /dev/null +++ b/misc/lppf/Makefile.diff @@ -0,0 +1,45 @@ +diff -Naur lppf-0.1-rc1/Makefile lppf-0.1-rc1.patched/Makefile +--- lppf-0.1-rc1/Makefile 2008-01-11 12:07:27.000000000 -0500 ++++ lppf-0.1-rc1.patched/Makefile 2024-09-01 15:40:45.029466905 -0400 +@@ -4,13 +4,17 @@ + TARGET = lppf + OBJS = libppf.o lppf.o ppf.o + CC = g++ +-CFLAGS=-Wall -ansi -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ++MAINT_CFLAGS = -Wall -ansi -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 + LINK = $(CC) -lm -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 + VPATH = ./src + ++PREFIX ?= /usr/local ++BINDIR ?= $(PREFIX)/bin ++DOCDIR ?= $(PREFIX)/share/doc/$(TARGET) ++ + .SUFFIXES: + .SUFFIXES: .d .o .hh .cc +-.cc.o: ; $(CC) $(CFLAGS) -c $(VPATH)/$*.cc ++.cc.o: ; $(CC) $(CFLAGS) $(MAINT_CFLAGS) -c $(VPATH)/$*.cc + + %.d: %.hh %.cc + touch $@ +@@ -22,6 +26,21 @@ + $(TARGET): $(OBJS) + $(LINK) -o $(TARGET) $(OBJS) $(LFLAGS) + ++install: ++ -mkdir -p $(DESTDIR)$(BINDIR) ++ -mkdir -p $(DESTDIR)$(DOCDIR) ++ -install -m 0755 $(TARGET) $(DESTDIR)$(BINDIR) ++ -install -m 0644 AUTHORS $(DESTDIR)$(DOCDIR) ++ -install -m 0644 COPYING $(DESTDIR)$(DOCDIR) ++ -install -m 0644 README $(DESTDIR)$(DOCDIR) ++ ++uninstall: ++ -rm -f $(DESTDIR)$(BINDIR)/$(TARGET) ++ -rm -f $(DESTDIR)$(DOCDIR)/AUTHORS ++ -rm -f $(DESTDIR)$(DOCDIR)/COPYING ++ -rm -f $(DESTDIR)$(DOCDIR)/README ++ -rm -rf $(DESTDIR)$(DOCDIR) ++ + clean: + -rm -f $(TARGET) $(OBJS) $(DEPENDENCIES) make.dep + diff --git a/misc/lppf/braces.diff b/misc/lppf/braces.diff new file mode 100644 index 0000000000..de3367923a --- /dev/null +++ b/misc/lppf/braces.diff @@ -0,0 +1,17 @@ +diff -ur lppf-0.1-rc1/src/libppf.cc lppf-0.1-rc1/src/libppf.cc +--- lppf-0.1-rc1/src/libppf.cc 2008-01-11 09:14:56.000000000 -0800 ++++ lppf-0.1-rc1/src/libppf.cc 2016-12-15 21:40:03.440589358 -0800 +@@ -122,11 +122,12 @@ + // Read and add chunk data. If chunkSize is 0, the first byte is the + // data and the second is number of repetitions. This is only valid + // for PPFv1 patches +- if (chunkSize == 0) ++ if (chunkSize == 0) { + if (version == 1) + return ERROR_PPF_FORMAT; + else if (version == 3) + chunkSize = 2; ++ } + + if ((signed)fread(buf, 1, chunkSize, file) != chunkSize) + return ERROR_PPF_READ;