Blame SOURCES/arptables-0.0.4-man-install.patch

2070a3
commit 9ce0571805f97 + f43b499751a79
2070a3
Author: Jesper Dangaard Brouer <brouer@redhat.com>
2070a3
Date:   Thu Nov 14 13:37:39 2013 +0100
2070a3
2070a3
    arptables: Add man pages for arptables-{save,restore}
2070a3
    
2070a3
    Also fixed up the Makefile to install these man pages.
2070a3
    
2070a3
    Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2070a3
    
2070a3
2070a3
diff --git a/userspace/arptables/Makefile b/userspace/arptables/Makefile
2070a3
index 38158d9..7bead0d 100644
2070a3
--- a/userspace/arptables/Makefile
2070a3
+++ b/userspace/arptables/Makefile
2070a3
@@ -6,10 +6,13 @@ PREFIX:=/usr/local
2070a3
 LIBDIR:=$(PREFIX)/lib
2070a3
 BINDIR:=$(PREFIX)/sbin
2070a3
 MANDIR:=$(PREFIX)/man
2070a3
+man8dir=$(MANDIR)/man8
2070a3
 INITDIR:=/etc/rc.d/init.d
2070a3
 SYSCONFIGDIR:=/etc/sysconfig
2070a3
 DESTDIR:=
2070a3
 
2070a3
+MANS = arptables.8 arptables-save.8 arptables-restore.8
2070a3
+
2070a3
 COPT_FLAGS:=-O2
2070a3
 CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG
2070a3
 
2070a3
@@ -36,10 +39,6 @@ libarptc/libarptc.a: libarptc/libarptc.o
2070a3
 arptables: arptables-standalone.o arptables.o libarptc/libarptc.o $(EXT_OBJS)
2070a3
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
2070a3
 
2070a3
-$(DESTDIR)$(MANDIR)/man8/arptables.8: arptables.8
2070a3
-	mkdir -p $(@D)
2070a3
-	install -m 0644 $< $@
2070a3
-
2070a3
 $(DESTDIR)$(BINDIR)/arptables: arptables
2070a3
 	mkdir -p $(DESTDIR)$(BINDIR)
2070a3
 	install -m 0755 $< $@
2070a3
@@ -57,8 +56,13 @@ scripts: arptables-save arptables-restore arptables.sysv
2070a3
 	if test -d $(DESTDIR)$(INITDIR); then install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi
2070a3
 	rm -f arptables-save_ arptables-restore_ arptables.sysv_
2070a3
 
2070a3
+.PHONY: install-man
2070a3
+install-man: $(MANS)
2070a3
+	[ -d "$(DESTDIR)$(man8dir)" ] || mkdir -p "$(DESTDIR)$(man8dir)"
2070a3
+	install -m 0644 $^ $(DESTDIR)$(man8dir)/
2070a3
+
2070a3
 .PHONY: install
2070a3
-install: $(DESTDIR)$(MANDIR)/man8/arptables.8 $(DESTDIR)$(BINDIR)/arptables scripts
2070a3
+install: install-man $(DESTDIR)$(BINDIR)/arptables scripts
2070a3
 
2070a3
 .PHONY: clean
2070a3
 clean: