summaryrefslogtreecommitdiff
path: root/print/apsfilter6/scripts/configure
blob: f869602e210de7b5f51447192b1c494890732839 (plain) (blame)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#! /bin/sh

# $FreeBSD$

if [ "$BATCH" != "yes" ]; then

#
# configure - apsfilter package dependency configuration
#

/usr/bin/dialog --title "supported file types" --clear \
	--checklist "\n\
Select file types you want to print:" -1 -1 14	\
LETTER		"LETTER printing"		OFF	\
LETTERDJ	"LETTERDJ printing"		ON	\
A4		"A4 printing"			OFF	\
PS		"Postscript and PDF files"	ON	\
SAMBA		"Windows Remote-Print Support"	ON	\
ENCRYPTED_PDF	"Encrypted PDF files"		ON	\
ASCII		"ASCII/English Text/Scripts"	ON	\
MAIL		"Mail/News articles"		ON	\
DVI		"TeX DVI files"			OFF	\
HTML		"HTML documents"		OFF	\
TROFF		"Troff documents"		ON	\
JPEG		"JPEG pictures"			OFF	\
TIFF		"TIFF pictures"			OFF	\
PBM		"GIF/PNM/PBM/PPM/BMP pictures"	ON	\
FIG		"XFIG drawings"			OFF	\
FAXG3		"Fax Group 3 files"		OFF	\
2> /tmp/apsfilter-checklist.$$

retval=$?

if [ -s /tmp/apsfilter-checklist.$$ ]; then
	set `cat /tmp/apsfilter-checklist.$$`
fi
rm -f /tmp/apsfilter-checklist.$$

case $retval in
	0)	if [ -z "$*" ]; then
			echo "Nothing selected"
		fi
		;;
	1)	echo "Cancel pressed."
		exit 1
		;;
esac

/bin/mkdir -p ${WRKDIRPREFIX}${CURDIR}
exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc

while [ "$1" ]; do
    case $1 in
	\"LETTER\")
		PAPERSIZE=letter
		echo "PAPERSIZE=letter"
		;;
	\"LETTERDJ\")
		PAPERSIZE=letterdj
		echo "PAPERSIZE=letterdj"
		;;
	\"A4\")
		PAPERSIZE=a4
		echo "PAPERSIZE=a4"
		;;
	\"PS\")
		echo RUN_DEPENDS+=gs:${PORTSDIR}/print/ghostscript6
		;;
	\"SAMBA\")
		echo RUN_DEPENDS+=smbclient:${PORTSDIR}/net/samba
		;;
	\"ENCRYPTED_PDF\")
		echo RUN_DEPENDS+=gs:${PORTSDIR}/print/ghostscript6
		echo PDFENCRYPT=YES
		;;
	\"ASCII\")
		case $PAPERSIZE in
		    letter)
			echo RUN_DEPENDS+=a2ps:${PORTSDIR}/print/a2ps-letter
			;;
		    letterdj)
			echo RUN_DEPENDS+=a2ps:${PORTSDIR}/print/a2ps-letterdj
			;;
		    a4)
			echo RUN_DEPENDS+=a2ps:${PORTSDIR}/print/a2ps-a4
			;;
		esac
		;;
	\"MAIL\")
		case $PAPERSIZE in
		    letter)
			echo RUN_DEPENDS+=psnup:${PORTSDIR}/print/psutils-letter
			;;
		    letterdj)
			echo RUN_DEPENDS+=psnup:${PORTSDIR}/print/psutils-letter
			;;
		    a4)
			echo RUN_DEPENDS+=psnup:${PORTSDIR}/print/psutils-a4
			;;
		esac
		;;
	\"DVI\")
		echo RUN_DEPENDS+=dvips:${PORTSDIR}/print/teTeX
		;;
	\"HTML\")
		case $PAPERSIZE in
		    letter)
		      echo RUN_DEPENDS+=html2ps:${PORTSDIR}/print/html2ps-letter
		      ;;
		    letterdj)
		      echo RUN_DEPENDS+=html2ps:${PORTSDIR}/print/html2ps-letter
		      ;;
		    a4)
		      echo RUN_DEPENDS+=html2ps:${PORTSDIR}/print/html2ps-a4
		      ;;
		esac
		;;
	\"TROFF\")
		TROFF=YES
		;;
	\"JPEG\")
		echo RUN_DEPENDS+=cjpeg:${PORTSDIR}/graphics/jpeg
		;;
	\"TIFF\")
		echo LIB_DEPENDS+=tiff.4:${PORTSDIR}/graphics/tiff
		;;
	\"PBM\")
		echo RUN_DEPENDS+=anytopnm:${PORTSDIR}/graphics/netpbm
		;;
	\"FIG\")
		echo RUN_DEPENDS+=fig2dev:${PORTSDIR}/print/transfig
		;;
	\"FAXG3\")
		echo RUN_DEPENDS+=g3cat:${PORTSDIR}/comms/mgetty+sendfax
		;;
    esac
    shift
done

fi # if $BATCH

# if batch, then start creating Makefile.inc here
if [ "$BATCH" = "yes" ]; then
	/bin/mkdir -p ${WRKDIRPREFIX}${CURDIR}
	exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
fi
echo "post-install:"
echo "	@\${MKDIR} ${PREFIX}/apsfilter/filter"
echo "	@touch ${PREFIX}/apsfilter/filter/.keep_me"
 echo "	@\${ECHO} \"========================================================\""
 echo "	@\${ECHO} \"************ Post Installation Tasks *******************\""
 echo "	@\${ECHO} \"========================================================\""
if [ $TROFF ]
then
 echo "	@\${ECHO} \"If running FreeBSD < 4.0 and you want to print troff    \""
 echo "	@\${ECHO} \"files then you have to install the grog utility         \""
 echo "	@\${ECHO} \"from the groff sources:                                 \""
 echo "	@\${ECHO} \"    cp /usr/src/contrib/groff/grog/grog.sh /usr/bin/grog\""
 echo "	@\${ECHO} \"    chmod 555 /usr/bin/grog                             \""
 echo "	@\${ECHO} \"--------------------------------------------------------\""
fi
 echo "	@\${ECHO} \"*** Printer installation / apsfilter setup ***          \""
 echo "	@\${ECHO} \"    cd ${PREFIX}/apsfilter; ./SETUP        \""