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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
$NetBSD: patch-aa,v 1.10 2005/09/02 19:29:56 reed Exp $
--- Makefile.orig 1994-01-26 11:32:33.000000000 -0600
+++ Makefile
@@ -20,13 +20,13 @@ RM = rm
# RM = rm -f
# How to run Make
-MAKE = make
+#MAKE = make
# How to copy files
CP = cp
# How to compile C programs
-CC = cc
+#CC = cc
# You may also want to change the CFLAGS variable, which will be passed on
# to all subdirectories. If you do that, the changes will only work right if you
@@ -38,7 +38,7 @@ FOOBAR-sun4=-Bstatic
STATICFLAG=FOOBAR${HOST_ARCH}
-CFLAGS = -g -I. ${$(STATICFLAG)}
+CFLAGS += -I. ${$(STATICFLAG)}
# The following is better if you want to make sure you run with SYSV defined
# CFLAGS = -g -I. ${$(STATICFLAG)} -DSYSV
# Also, for SGI Irix, compile in K&R mode
@@ -49,9 +49,12 @@ CFLAGS = -g -I. ${$(STATICFLAG)}
# LDLIBS variable.
#
# For Sun and BSD systems, the following should work...
-LDLIBS =
+# LDLIBS =
# On BSD 4.4 systems, you will need the following
-# LDLIBS = -lcompat
+OPSYS!= uname -s
+.if ${OPSYS} == "NetBSD" || ${OPSYS} == "FreeBSD" || ${OPSYS} == "DragonFly"
+LDLIBS = -s -lcompat
+.endif
# On SGI machines, we need -lsun for getpw...(), and -lc_s saves some space.
# LDLIBS = -lsun -lc_s
# ISC SysVr3.2.2 has a shared C library and requires libinet.a to resolve
@@ -72,10 +75,10 @@ CONFIGDIR = .
# install -s -c $(LOCALBINDIR) $$file
#
#INSTALL = cp
-INSTALL = install -c -s
+#INSTALL = install -c -s
# Root of installation tree
-INSTROOT = /usr/local
+INSTROOT = ${PREFIX}
#
# This is where binaries should be copied
LOCALBINDIR = ${INSTROOT}/bin
@@ -91,23 +94,27 @@ MAN4EXT = 4
FONTSUFFIX=pcf
# This is where the mailcap file should be put
-MAILCAPDIR = ${INSTROOT}/etc
+MAILCAPDIR = ${INSTROOT}/share/examples/metamail
# This helps with the "for" constructs below on some platforms:
SHELL=/bin/sh
-install: basics
+BINARIES= mailto metamail mmencode richtext richtoatk \
+ splitmail
+SCRIPTS= audiocompose audiosend extcompose getfilename mailserver \
+ mailto-hebrew metasend patch-metamail rcvAppleSingle \
+ showaudio showexternal shownonascii showpartial \
+ showpicture sndAppleSingle sun-audio-file sun-message.csh \
+ sun-to-mime sun2mime
-basics::
+install: install-all
+
+all basics::
(cd metamail ; $(MAKE) CONFIGDIR=../${CONFIGDIR} CFLAGS="${CFLAGS}" CC="${CC}" LDLIBS="${LDLIBS}")
-${RM} bin/metamail
(cd bin; ${LN} ../metamail/metamail metamail)
-${RM} bin/mmencode
(cd bin; ${LN} ../metamail/mmencode mmencode)
- -${RM} bin/mimencode
- (cd bin; ${LN} ../metamail/mmencode mimencode)
- -${RM} man/mimencode.1
- (cd man; ${LN} ../man/mmencode.1 mimencode.1)
-${RM} bin/mailto
(cd bin; ${LN} ../metamail/mailto mailto)
-${RM} bin/splitmail
@@ -117,7 +124,7 @@ basics::
(cd bin; ${LN} ../richmail/richtext richtext)
-${RM} bin/richtoatk
(cd bin; ${LN} ../richmail/richtoatk richtoatk)
- (cd fonts ; $(MAKE) CONFIGDIR=../${CONFIGDIR} CFLAGS="${CFLAGS}" CC="${CC}" LDLIBS="${LDLIBS}" FONTSUFFIX="${FONTSUFFIX}")
+ (cd fonts ; $(MAKE) PREFIX=${PREFIX} CONFIGDIR=../${CONFIGDIR} CFLAGS="${CFLAGS}" CC="${CC}" LDLIBS="${LDLIBS}" FONTSUFFIX="${FONTSUFFIX}")
-${RM} bin/shownonascii
(cd bin; ${LN} ../fonts/shownonascii shownonascii)
-${RM} bin/mailto-hebrew
@@ -125,30 +132,39 @@ basics::
install-all: basics
@(cd bin; \
- for file in *; \
+ for file in $(BINARIES); \
+ do \
+ target=$(LOCALBINDIR)/$$file; \
+ echo "installing binary $$target"; \
+ ${BSD_INSTALL_PROGRAM} $$file $$target; \
+ done; \
+ for file in $(SCRIPTS); \
do \
target=$(LOCALBINDIR)/$$file; \
echo "installing binary $$target"; \
- ${INSTALL} $$file $$target; \
+ ${BSD_INSTALL_SCRIPT} $$file $$target; \
done)
+ ${LN} -s mmencode ${LOCALBINDIR}/mimencode
@(cd man; \
for file in *.1; \
do \
target=$(MAN1DIR)/`basename $$file .1`.$(MAN1EXT); \
echo "installing man page $$target";\
- ${CP} $$file $$target; \
+ ${BSD_INSTALL_MAN} $$file $$target; \
done)
+ ${LN} -s mmencode.1 ${MAN1DIR}/mimencode.1
@(cd man; \
for file in *.4; \
do \
target=$(MAN4DIR)/`basename $$file .4`.$(MAN4EXT); \
echo "installing man page $$target";\
- ${CP} $$file $$target; \
+ ${BSD_INSTALL_MAN} $$file $$target; \
done)
@echo "Renaming old mailcap file to $(MAILCAPDIR)/mailcap.old
-mv $(MAILCAPDIR)/mailcap $(MAILCAPDIR)/mailcap.old
@echo "installing file $(MAILCAPDIR)/mailcap"
- ${CP} mailcap $(MAILCAPDIR)
+ ${BSD_INSTALL_DATA} mailcap $(MAILCAPDIR)
+ (cd fonts ; $(MAKE) PREFIX=${PREFIX} CONFIGDIR=../${CONFIGDIR} CFLAGS="${CFLAGS}" CC="${CC}" LDLIBS="${LDLIBS}" FONTSUFFIX="${FONTSUFFIX}" install)
uninstall-all:
@(cd bin; \
|