summaryrefslogtreecommitdiff
path: root/sysutils/powerman/files/patch-Makefile
blob: 4ca481a7ee72d04c4937456e08fd43a23353b6c6 (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
$FreeBSD$

--- Makefile.orig	Fri Dec 19 09:39:10 2003
+++ Makefile	Thu Aug  5 14:57:44 2004
@@ -1,20 +1,19 @@
 PROJECT = powerman
 VERSION = $(shell perl -ne 'print,exit if s/^\s*VERSION:\s*(\S*).*/\1/i' META)
 RELEASE = $(shell perl -ne 'print,exit if s/^\s*RELEASE:\s*(\S*).*/\1/i' META)
-SHELL=   /bin/sh
-MAKE=    /usr/bin/make
-CC=      gcc
-INSTALL= /usr/bin/install -c
+SHELL?=  /bin/sh
+CC?=      gcc
+INSTALL?=/usr/bin/install -c
 mkinstalldirs=	 $(SHELL) $(top_srcdir)/aux/mkinstalldirs
-CFLAGS=   -g -O2 -Wall
+CFLAGS?=   -g -O2 -Wall
 
 top_srcdir	=	.
-prefix		=	/usr
+prefix		=	${PREFIX}
 exec_prefix	=	${prefix}
 bindir		=	${exec_prefix}/bin
-sbindir		= 	${exec_prefix}/sbin
-mandir		=	$(prefix)/man
-etcdir		=	/etc
+sbindir		=	${exec_prefix}/sbin
+mandir		=	${prefix}/man
+etcdir		=	${prefix}/etc
 packagedir	=	${etcdir}/${PROJECT}
 
 all: progs tests
@@ -26,38 +25,38 @@
 	$(MAKE) -C test
 
 install: all
-	$(mkinstalldirs) 			$(DESTDIR)$(bindir)
-	$(INSTALL) src/powerman			$(DESTDIR)$(bindir)/
-	ln -s $(bindir)/powerman		$(DESTDIR)$(bindir)/pm
-	$(mkinstalldirs) 			$(DESTDIR)$(sbindir)
-	$(INSTALL) src/powermand		$(DESTDIR)$(sbindir)/
-	$(mkinstalldirs)			$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/baytech.dev		$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/baytech-rpc28-nc.dev	$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/baytech-rpc3-nc.dev	$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/icebox.dev		$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/icebox3.dev		$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/wti.dev			$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/wti-rps10.dev		$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/apc.dev			$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/apcnew.dev		$(DESTDIR)$(packagedir)
-#	$(INSTALL) etc/vicebox.dev		$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/vpc.dev			$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/ibmh8.dev		$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/phantom.dev		$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/phantom4.dev		$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/ipmi.dev			$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/cyclades-pm8.dev		$(DESTDIR)$(packagedir)
-	$(INSTALL) etc/ipmipower.dev            $(DESTDIR)$(packagedir)
-	$(mkinstalldirs)			$(DESTDIR)$(mandir)/man1
-	$(INSTALL) -m 644 man/powerman.1	$(DESTDIR)$(mandir)/man1
-	$(INSTALL) -m 644 man/powermand.1	$(DESTDIR)$(mandir)/man1
-	$(mkinstalldirs) 			$(DESTDIR)$(mandir)/man5
-	$(INSTALL) -m 644 man/powerman.conf.5  	$(DESTDIR)$(mandir)/man5
-	$(mkinstalldirs) 			$(DESTDIR)$(mandir)/man7
-	$(INSTALL) -m 644 man/powerman-devices.7 $(DESTDIR)$(mandir)/man7
-	$(mkinstalldirs) 			$(DESTDIR)/etc/rc.d/init.d
-	$(INSTALL) -m 755 scripts/powerman.init $(DESTDIR)/etc/rc.d/init.d/powerman
+	$(mkinstalldirs)				$(bindir)
+	${BSD_INSTALL_PROGRAM} src/powerman		$(bindir)/
+	ln -s $(bindir)/powerman			$(bindir)/pm
+	$(mkinstalldirs)				$(sbindir)
+	${BSD_INSTALL_PROGRAM} src/powermand		$(sbindir)/
+	$(mkinstalldirs)				$(packagedir)
+	${BSD_INSTALL_DATA} etc/baytech.dev		$(packagedir)
+	${BSD_INSTALL_DATA} etc/baytech-rpc28-nc.dev	$(packagedir)
+	${BSD_INSTALL_DATA} etc/baytech-rpc3-nc.dev	$(packagedir)
+	${BSD_INSTALL_DATA} etc/icebox.dev		$(packagedir)
+	${BSD_INSTALL_DATA} etc/icebox3.dev		$(packagedir)
+	${BSD_INSTALL_DATA} etc/wti.dev			$(packagedir)
+	${BSD_INSTALL_DATA} etc/wti-rps10.dev		$(packagedir)
+	${BSD_INSTALL_DATA} etc/apc.dev			$(packagedir)
+	${BSD_INSTALL_DATA} etc/apcnew.dev		$(packagedir)
+#	${BSD_INSTALL_DATA} etc/vicebox.dev		$(packagedir)
+	${BSD_INSTALL_DATA} etc/vpc.dev			$(packagedir)
+	${BSD_INSTALL_DATA} etc/ibmh8.dev		$(packagedir)
+	${BSD_INSTALL_DATA} etc/phantom.dev		$(packagedir)
+	${BSD_INSTALL_DATA} etc/phantom4.dev		$(packagedir)
+	${BSD_INSTALL_DATA} etc/ipmi.dev		$(packagedir)
+	${BSD_INSTALL_DATA} etc/cyclades-pm8.dev	$(packagedir)
+	${BSD_INSTALL_DATA} etc/ipmipower.dev		$(packagedir)
+	$(mkinstalldirs)				$(mandir)/man1
+	${BSD_INSTALL_DATA} man/powerman.1		$(mandir)/man1
+	$(mkinstalldirs)				$(mandir)/man8
+	${BSD_INSTALL_DATA} man/powermand.1		$(mandir)/man8/powermand.8
+	$(mkinstalldirs)				$(mandir)/man5
+	${BSD_INSTALL_DATA} man/powerman.conf.5		$(mandir)/man5
+	$(mkinstalldirs)				$(mandir)/man7
+	${BSD_INSTALL_DATA} man/powerman-devices.7	$(mandir)/man7
+	${BSD_INSTALL_SCRIPT} scripts/powerman.init	$(etcdir)/rc.d/powermand.sh
 
 clean:
 	make -C src clean