summaryrefslogtreecommitdiff
path: root/sysutils/pciutils/patches/patch-aa
blob: 65aaa61fea7dc40630bf2a9470cfed97830d44a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
$NetBSD: patch-aa,v 1.28 2022/05/13 11:41:57 wiz Exp $

Adapt the Makefile to make it compliant with pkgsrc.

--- Makefile.orig	2022-04-18 16:47:28.000000000 +0000
+++ Makefile
@@ -1,8 +1,7 @@
 # Makefile for The PCI Utilities
 # (c) 1998--2022 Martin Mares <mj@ucw.cz>
 
-OPT=-O2
-CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes
+CFLAGS=-Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes
 
 VERSION=3.8.0
 DATE=2022-04-18
@@ -13,7 +12,7 @@ RELEASE=
 CROSS_COMPILE=
 
 # Support for compressed pci.ids (yes/no, default: detect)
-ZLIB=
+ZLIB=no
 
 # Support for resolving ID's by DNS (yes/no, default: detect)
 DNS=
@@ -32,25 +31,25 @@ HWDB=
 ABI_VERSION=.3
 
 # Installation directories
-PREFIX=/usr/local
+#PREFIX=/usr/local
 BINDIR=$(PREFIX)/bin
 SBINDIR=$(PREFIX)/sbin
-SHAREDIR=$(PREFIX)/share
+SHAREDIR=$(PREFIX)/share/pciutils
 IDSDIR=$(SHAREDIR)
-MANDIR:=$(shell if [ -d $(PREFIX)/share/man ] ; then echo $(PREFIX)/share/man ; else echo $(PREFIX)/man ; fi)
 INCDIR=$(PREFIX)/include
+MANDIR=$(PREFIX)/$(PKGMANDIR)
 LIBDIR=$(PREFIX)/lib
 PKGCFDIR=$(LIBDIR)/pkgconfig
 
 # Commands
-INSTALL=install
-DIRINSTALL=install -d
-STRIP=-s
-ifdef CROSS_COMPILE
-CC=$(CROSS_COMPILE)gcc
-else
-CC=cc
-endif
+#INSTALL=install
+#DIRINSTALL=install -d
+#STRIP=-s
+#ifdef CROSS_COMPILE
+#CC=$(CROSS_COMPILE)gcc
+#else
+#CC=cc
+#endif
 AR=$(CROSS_COMPILE)ar
 RANLIB=$(CROSS_COMPILE)ranlib
 
@@ -130,14 +129,21 @@ distclean: clean
 
 install: all
 # -c is ignored on Linux, but required on FreeBSD
-	$(DIRINSTALL) -m 755 $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man7 $(DESTDIR)/$(MANDIR)/man5
-	$(INSTALL) -c -m 755 $(STRIP) lspci$(EXEEXT) $(DESTDIR)$(LSPCIDIR)
-	$(INSTALL) -c -m 755 $(STRIP) setpci$(EXEEXT) $(DESTDIR)$(SBINDIR)
-	$(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR)
-	$(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR)
-	$(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8
-	$(INSTALL) -c -m 644 pcilib.7 $(DESTDIR)$(MANDIR)/man7
-	$(INSTALL) -c -m 644 pci.ids.5 $(DESTDIR)$(MANDIR)/man5
+	$(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(BINDIR)
+	$(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(SBINDIR)
+	$(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(IDSDIR)
+	$(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(MANDIR)/man8
+	$(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(MANDIR)/man7
+	$(BSD_INSTALL_MAN_DIR) $(DESTDIR)/$(MANDIR)/man5
+	$(BSD_INSTALL_PROGRAM) lspci $(DESTDIR)$(LSPCIDIR)
+	$(BSD_INSTALL_PROGRAM) setpci $(DESTDIR)$(SBINDIR)
+	$(BSD_INSTALL_SCRIPT) update-pciids $(DESTDIR)$(SBINDIR)
+	$(BSD_INSTALL_DATA) $(PCI_IDS) $(DESTDIR)$(IDSDIR)
+	for fn in lspci.8 setpci.8 update-pciids.8; do \
+		$(BSD_INSTALL_MAN) $$fn $(DESTDIR)$(MANDIR)/man8;       \
+	done
+	$(BSD_INSTALL_MAN) pcilib.7 $(DESTDIR)$(MANDIR)/man7
+	$(BSD_INSTALL_MAN) pci.ids.5 $(DESTDIR)$(MANDIR)/man5
 ifeq ($(SHARED),yes)
 ifeq ($(LIBEXT),dylib)
 	ln -sf $(PCILIB) $(DESTDIR)$(LIBDIR)/$(LIBNAME)$(ABI_VERSION).$(LIBEXT)
@@ -151,13 +157,14 @@ install: install-pcilib
 endif
 
 install-pcilib: lib/$(PCILIB)
-	$(DIRINSTALL) -m 755 $(DESTDIR)$(LIBDIR)
-	$(INSTALL) -c -m 644 lib/$(PCILIB) $(DESTDIR)$(LIBDIR)
+	$(BSD_INSTALL_LIB_DIR) $(DESTDIR)$(LIBDIR)
+	$(BSD_INSTALL_LIB) lib/$(PCILIB) $(DESTDIR)$(LIBDIR)
 
 install-lib: $(PCIINC_INS) install-pcilib
-	$(DIRINSTALL) -m 755 $(DESTDIR)$(INCDIR)/pci $(DESTDIR)$(PKGCFDIR)
-	$(INSTALL) -c -m 644 $(PCIINC_INS) $(DESTDIR)$(INCDIR)/pci
-	$(INSTALL) -c -m 644 lib/$(PCILIBPC) $(DESTDIR)$(PKGCFDIR)
+	$(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(INCDIR)/pci
+	$(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(PKGCFDIR)
+	$(BSD_INSTALL_DATA) $(PCIINC_INS) $(DESTDIR)$(INCDIR)/pci
+	$(BSD_INSTALL_DATA) lib/$(PCILIBPC) $(DESTDIR)$(PKGCFDIR)
 ifeq ($(SHARED),yes)
 ifeq ($(LIBEXT),dylib)
 	ln -sf $(PCILIB) $(DESTDIR)$(LIBDIR)/$(LIBNAME)$(ABI_VERSION).$(LIBEXT)