aboutsummaryrefslogtreecommitdiff
path: root/print/apsfilter/scripts/configure
blob: 6cf3906f69edf88b9460cf9464028d74c5e79107 (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
164
165
166
167
168
169
#! /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	\
A4		"A4 papersize"					ON	\
LETTER		"letter papersize"				OFF	\
LETTERDJ	"letter + special DeskJet adjustements"		OFF	\
GS		"Postscript for non-PS printer, needs X11"	ON	\
GS_NO_X11	"Postscript for non-PS printer, no X11"		OFF	\
GS_PDF_CRYPT	"print encrypted PDF files using gs"		ON	\
PSUTILS		"for pseudo duplex printing + paper handling"	ON	\
A2PS		"ASCII files in different styles/orientation"	ON	\
CONVERT		"support for lots of graphic file formats"	ON	\
DVIPS		"TeX DVI files"					OFF	\
FIG2DEV		"XFIG drawings"					OFF	\
HTML2PS		"HTML documents"				OFF	\
TROFF		"Troff documents"				OFF	\
ATALK		"remote printing on AppleTalk remote printer"	OFF	\
SAMBA		"remote printing on Windows remote printer"	OFF	\
BZIP2		"print bunzip2 compressed documents"		OFF	\
FREEZE		"print freeze compressed documents"		OFF	\
MP3		"play MP3 audio files on local or remote queue"	OFF	\
OGG		"play Ogg audio files on local or remote queue"	OFF	\
WAV		"play wav audio files on local or remote queue"	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
	\"A4\")
		PAPERSIZE=a4
		echo "PAPERSIZE=a4"
		;;
	\"LETTER\")
		PAPERSIZE=letter
		echo "PAPERSIZE=letter"
		;;
	\"LETTERDJ\")
		PAPERSIZE=letterdj
		echo "PAPERSIZE=letterdj"
		;;
	\"GS\")
		echo RUN_DEPENDS+=gs:${PORTSDIR}/${GHOSTSCRIPT_PORT}
		;;
	\"GS_NO_X11\")
		echo WITHOUT_X11=yes
		case ${GHOSTSCRIPT_PORT} in
		    *-nox11)
			_GSSUF=""
			;;
		    *)
			_GSSUF=-nox11
			;;
		esac
		echo RUN_DEPENDS+=gs:${PORTSDIR}/${GHOSTSCRIPT_PORT}${_GSSUF}
		;;
	\"GS_PDF_CRYPT\")
		echo PDFENCRYPT=YES
		;;
	\"PSUTILS\")
		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
		;;
	\"A2PS\")
		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
		;;
	\"CONVERT\")
		echo RUN_DEPENDS+=convert:${PORTSDIR}/graphics/ImageMagick
		;;
	\"DVIPS\")
		echo RUN_DEPENDS+=dvips:${PORTSDIR}/print/dvipsk-tetex
		;;
	\"FIG2DEV\")
		echo RUN_DEPENDS+=fig2dev:${PORTSDIR}/print/transfig
		;;
	\"HTML2PS\")
		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
		;;
	\"ATALK\")
		echo RUN_DEPENDS+=pap:${PORTSDIR}/net/netatalk
		;;
	\"SAMBA\")
		echo RUN_DEPENDS+=smbclient:${PORTSDIR}/net/samba3
		;;
	\"BZIP2\")
		;;
	\"FREEZE\")
		echo RUN_DEPENDS+=melt:${PORTSDIR}/archivers/freeze
		;;
	\"MP3\")
		echo RUN_DEPENDS+=mpg321:${PORTSDIR}/audio/mpg321
		;;
	\"OGG\")
		echo RUN_DEPENDS+=ogg123:${PORTSDIR}/audio/vorbis-tools
		;;
	\"WAV\")
		echo RUN_DEPENDS+=wavplay:${PORTSDIR}/audio/wavplay
		;;
    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