summaryrefslogtreecommitdiffstats
path: root/print/pips800/Makefile.pips
blob: 85380a16e52fe8dcba992cf356f95682a42103fb (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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# makefile for use of:	PIPS
# Date created:		26 Aug 2004
# Whom:			Hajimu UMEMOTO <ume@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	pips${PRTYPE}
PORTVERSION?=	1.3.2
#PORTREVISION=	1
CATEGORIES?=	print
MASTER_SITES=	http://www.epkowa3.on.arena.ne.jp/pips/data/%SUBDIR%/

.if ${PORTVERSION} == 2.1.2
DIST_TYPE=	lpr
.else
DIST_TYPE?=	lpr_and_caps
.endif

.if ${PRTYPE} == "750_2000"
MASTER_SITE_SUBDIR=	pm750c_2000clpr
.elif ${PRTYPE} == 780 || ${PRTYPE} == 880
MASTER_SITE_SUBDIR=	${PRTYPE}_20
.elif ${PRTYPE} == 970
MASTER_SITE_SUBDIR=	PM${PRTYPE}C
.elif ${PRTYPE} == 3500
MASTER_SITE_SUBDIR=	pm${PRTYPE}c
.elif ${PRTYPE} == 4000
MASTER_SITE_SUBDIR=	pm${PRTYPE}pxlpr
.elif ${PRTYPE} == v500 || ${PRTYPE} == v600
MASTER_SITE_SUBDIR=	px${PRTYPE}lpr
.elif ${PORTVERSION} == 2.1.2
MASTER_SITE_SUBDIR=	${PRTYPE}_21
#.elif ${PRTYPE} == 740 || ${PRTYPE} == 870
.elif ${DIST_TYPE} == cups
MASTER_SITE_SUBDIR=	${PRTYPE}Ccups
.elif ${DIST_TYPE} == lpr
MASTER_SITE_SUBDIR=	${PRTYPE}Clpr
.else
MASTER_SITE_SUBDIR=	pm${PRTYPE}clpr
.endif

MAINTAINER=	ume@FreeBSD.org

LIB_DEPENDS=	png.5:${PORTSDIR}/graphics/png
RUN_DEPENDS=	gs:${PORTSDIR}/print/ghostscript-gnu \
		pstops:${PORTSDIR}/print/psutils-${PAPERSIZE} \
		${LOCALBASE}/lib/pluginwrapper/pips.so:${PORTSDIR}/www/linuxpluginwrapper

USE_REINPLACE=	yes
USE_GMAKE=	yes
USE_GNOME=	glib12 gtk12
USE_GETTEXT=	yes

ONLY_FOR_ARCHS= i386
.if ${DIST_TYPE} == cups
PKGNAMESUFFIX=	-cups
.endif
DISTNAME=	${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}
MD5_FILE=	${.CURDIR}/distinfo
DESCR=		${.CURDIR}/pkg-descr

GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--libdir=${PREFIX}/lib/pips

PLIST_SUB=	PRTYPE=${PRTYPE} \
		PRT_MODEL=${PRT_MODEL} \
		LIB_README=${LIB_README} \
		MODEL_FILE=${MODEL_FILE} \
		CUPSOPT_FILE=${CUPSOPT_FILE} \
		PIPS=${PIPS} \
		CUPS=${CUPS} \
		EKPNAVI=${EKPNAVI} \
		EKPNAVI_MO=${EKPNAVI_MO} \
		EKPSTM_MO=${EKPSTM_MO} \
		DTRFILTER=${DTRFILTER} \
		GSCONFIG=${GSCONFIG} \
		PAPER_LIST=${PAPER_LIST}

.include <bsd.port.pre.mk>

CPPFLAGS=	-I${LOCALBASE}/include
LDFLAGS=	-L${LOCALBASE}/lib
.if ${PORTVERSION} == 2.1.2 || ${PORTVERSION} == 2.6.2
CONFLICTS=	pips*-2.*
USE_RC_SUBR=	yes
EXTRA_PATCHES=	${FILESDIR}/extra-patch-2.6.2
.if ${PORTVERSION} != 2.1.2 && ${DIST_TYPE} != cups
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-2.6.2-dtrfilter
.endif
.if ${DIST_TYPE} == lpr
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-2.6.2-ekpstm \
		${FILESDIR}/extra-patch-2.6.2-ekpnavi \
		${FILESDIR}/extra-patch-2.6.2-src \
		${FILESDIR}/extra-patch-2.6.2-src-lpr
.elif ${DIST_TYPE} == cups
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-2.6.2-ekpstm \
		${FILESDIR}/extra-patch-2.6.2-src-cups
LIB_DEPENDS+=	cups.2:${PORTSDIR}/print/cups-base \
		iconv.3:${PORTSDIR}/converters/libiconv
.else
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-2.6.2-common \
		${FILESDIR}/extra-patch-2.6.2-src \
		${FILESDIR}/extra-patch-2.6.2-src-cups
BUILD_DEPEND+=	${LOCALBASE}/bin/autoconf253:${PORTSDIR}/devel/autoconf253
LIB_DEPENDS+=	cups.2:${PORTSDIR}/print/cups-base \
		iconv.3:${PORTSDIR}/converters/libiconv
.endif
.if ${OSVERSION} < 500000
LIB_DEPENDS+=	gnugetopt.1:${PORTSDIR}/devel/libgnugetopt \
		lthread.2:${PORTSDIR}/devel/linuxthreads
CPPFLAGS+=	-I${LOCALBASE}/include/pthread/linuxthreads
LDFLAGS+=	-lgnugetopt -llthread
.else
LDFLAGS+=	${PTHREAD_LIBS}
.endif
CPPFLAGS+=	${PTHREAD_CFLAGS}
.endif
CONFIGURE_ENV+=	CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
MAKE_ENV+=	SED="${SED}"

.if defined(INTERNATIONAL_PRODUCTS)
LIB_FILE=	lib${PRTYPE:S/^-//}.so
MODEL_FILE=	ekpm${PRTYPE:S/^-//}.ppd
PRT_MODEL=	${PRTYPE:U:S/^-//}
.else
.if ${PRTYPE} == 790
LIB_FILE=	libpm${PRTYPE}pt.so
MODEL_FILE=	ekpm${PRTYPE}pt.ppd
PRT_MODEL=	PM${PRTYPE}PT
.elif ${PRTYPE} == "780cs"
LIB_FILE=	libpm${PRTYPE}.so
MODEL_FILE=	ekpm${PRTYPE}.ppd
PRT_MODEL=	PM${PRTYPE:U}
.elif ${PRTYPE} == "820ug"
LIB_FILE=	libpm820cug.so
MODEL_FILE=	ekpm${PRTYPE}cug.ppd
PRT_MODEL=	PM820CUG
.elif ${PRTYPE} == 4000
LIB_FILE=	libpm${PRTYPE}px.so
MODEL_FILE=	ekpm${PRTYPE}px.ppd
PRT_MODEL=	PM${PRTYPE}PX
.elif ${PRTYPE} == v500 || ${PRTYPE} == v600
LIB_FILE=	libpx${PRTYPE}.so
MODEL_FILE=	ekpx${PRTYPE}.ppd
PRT_MODEL=	PX${PRTYPE:U}
.else
LIB_FILE=	libpm${PRTYPE}c.so
MODEL_FILE=	ekpm${PRTYPE}c.ppd
PRT_MODEL=	PM${PRTYPE}C
.endif
.endif

EKPNAVI_VER=	1.1.2
.if ${PRTYPE} == 970
EKPSTM_VER=	1.1.2
.else
EKPSTM_VER=	1.0.2
.endif

.if ${DIST_TYPE} == cups
CUPSOPT_FILE=	cupsopt_pm${PRTYPE}c.csv
.else
CUPSOPT_FILE=	cupsopt.csv
.endif
LIB_README=	${LIB_FILE:S/.so$//}.readme
PAPERSIZE?=	a4
.if ${PORTVERSION} == 2.1.2 || ${PORTVERSION} == 2.6.2
FILTER_SRC=	filter.tmp
.if ${PORTVERSION} == 2.1.2
PIPS=		""
CUPS=		"@comment "
EKPNAVI=	""
EKPNAVI_MO=	""
EKPSTM_MO=	""
DTRFILTER=	"@comment "
GSCONFIG=	""
PAPER_LIST=	"@comment "
.else
.if ${DIST_TYPE} == lpr
PIPS=		""
CUPS=		"@comment "
EKPNAVI=	""
EKPNAVI_MO=	""
EKPSTM_MO=	""
DTRFILTER=	""
.elif ${DIST_TYPE} == cups
PIPS=		"@comment "
CUPS=		""
EKPNAVI=	"@comment "
EKPNAVI_MO=	"@comment "
EKPSTM_MO=	""
DTRFILTER=	"@comment "
.else
PIPS=		""
CUPS=		""
EKPNAVI=	""
EKPNAVI_MO=	"@comment "
EKPSTM_MO=	"@comment "
DTRFILTER=	""
.endif
GSCONFIG=	"@comment "
PAPER_LIST=	""
.endif
RC_SCRIPTS_SUB=	PREFIX=${PREFIX} \
		RC_SUBR=${RC_SUBR} \
		PRT_MODEL=${PRT_MODEL}
WITH_EKPD?=	yes
.elif ${PORTVERSION} == 1.3.2
FILTER_SRC=	filter.org
PLIST=		${MASTERDIR}/pkg-plist132
.endif
PKGMESSAGE=	${WRKDIR}/pkg-message

DOCS=		COPYING COPYING.KOWA COPYING.KOWA.ja COPYING.LIB

post-extract:
.if ${PORTVERSION} == 2.1.2 || \
	(${PORTVERSION} == 2.6.2 && ${DIST_TYPE} == lpr)
	cd ${WRKSRC}/ekpnavi && ${TAR} xf ekpnavi-${EKPNAVI_VER}.tar.gz
.endif
.if ${PORTVERSION} == 2.1.2 || \
	(${PORTVERSION} == 2.6.2 && ${DIST_TYPE} == lpr) || \
	${DIST_TYPE} == cups
	cd ${WRKSRC}/ekpstm && ${TAR} xf ekpstm-${EKPSTM_VER}.tar.gz
.endif

post-patch:
.if ${PORTVERSION} == 2.1.2 || \
	(${PORTVERSION} == 2.6.2 && ${DIST_TYPE} == lpr)
	cd ${WRKSRC}/ekpnavi/ekpnavi-${EKPNAVI_VER} && \
		patch -p < ${FILESDIR}/ekpnavi-${EKPNAVI_VER}.diff
.endif
.if ${PORTVERSION} == 2.1.2 || \
	(${PORTVERSION} == 2.6.2 && ${DIST_TYPE} == lpr) || \
	${DIST_TYPE} == cups
	cd ${WRKSRC}/ekpstm/ekpstm-${EKPSTM_VER} && \
		patch -p < ${FILESDIR}/ekpstm-${EKPSTM_VER}.diff
.endif
	${REINPLACE_CMD} -e 's,setup redhat,redhat,' \
		-e '/inst-post.sh/s/^/#/' \
		${WRKSRC}/Makefile.in
	${REINPLACE_CMD} -e 's,^prefix=/usr$$,,' -e 's,^sysconfdir=/etc$$,,' \
	    -e 's,/usr/local/EPKowa,${PREFIX}/libexec/pips,' \
	    -e 's,_nl_domain_bindings,libintl_nl_domain_bindings,' \
		${WRKSRC}/configure
	${REINPLACE_CMD} -e 's,^pkgdatadir.*$$,pkgdatadir = ${DOCSDIR},' \
		${WRKSRC}/doc/Makefile.in
.if ${DIST_TYPE} != cups
	${REINPLACE_CMD} -e 's,^EKPSTM.*$$,EKPSTM=${PREFIX}/bin/ekpstm,' \
	    -e 's,/usr/local/EPKowa,${PREFIX}/libexec/pips,' \
		-e 's,/usr/bin/pips,${PREFIX}/bin/pips,' \
		-e 's,:/usr/local/bin$$,:${PREFIX}/bin,' \
		-e 's,^GSCONF=%gsconfig_name%$$,GSCONF=${PREFIX}/bin/%gsconfig_name%,' \
		${WRKSRC}/src/${FILTER_SRC}
.endif
.if ${PORTVERSION} == 1.3.2
	${REINPLACE_CMD} -e 's,^PREFIX.*$$,PREFIX=${PREFIX},' \
		-e 's,^ETCDIR.*$$,ETCDIR=${PREFIX}/etc,' \
		-e 's,/dev/lp0,/dev/lpt0,' \
		-e 's,/usr/local/EPKowa,${PREFIX}/libexec/pips,' \
		-e 's,/usr/bin/pips,${PREFIX}/bin/pips,' \
		-e 's,:/usr/local/bin$$,:${PREFIX}/bin,' \
		${WRKSRC}/setup/inst-post.sh
.endif
.if ${PORTVERSION} == 2.6.2 && ${DIST_TYPE} != cups
	${REINPLACE_CMD} -e 's,dtrfilter_LDADD = -ldl,dtrfilter_LDADD =,' \
		${WRKSRC}/dtrfilter/Makefile.in
	${REINPLACE_CMD} -e 's,/etc/pipsrc,${PREFIX}/etc/pipsrc,' \
		-e 's,/usr/local/EPKowa,${PREFIX}/libexec/pips,' \
		${WRKSRC}/layout_script/gsconfig
.endif
.if ${PORTVERSION} == 2.1.2 || ${PORTVERSION} == 2.6.2
	${REINPLACE_CMD} -e 's,/etc/ekpdrc,${PREFIX}/etc/ekpdrc,' \
		${WRKSRC}/ekpd/cbtd_setup.c
	${REINPLACE_CMD} -e 's,/dev/lp0,/dev/ulpt0,' \
		-e 's,^SUBDIRS = rc$$,#SUBDIRS = rc,' \
		${WRKSRC}/ekpd/Makefile.in
.if ${DIST_TYPE} != cups
	${REINPLACE_CMD} -e 's,/etc/ekpdrc,${PREFIX}/etc/ekpdrc,' \
		${WRKSRC}/src/setup.c
.endif
.if ${PORTVERSION} == 2.6.2 || ${DIST_TYPE} == lpr
	${REINPLACE_CMD} -e 's,@CUPS_LIBS@,@CUPS_LIBS@ -lintl,' \
		-e 's,^INCLUDES =  @GTK_CFLAGS@ $$,INCLUDES =  @GTK_CFLAGS@ $(INCLTDL),' \
		${WRKSRC}/src/Makefile.in
.endif
.endif

.if ${PORTVERSION} == 2.6.2 && ${DIST_TYPE} != lpr && ${DIST_TYPE} != cups
pre-configure:
	cd ${WRKSRC}/libltdl && ${LOCALBASE}/bin/autoconf253
.endif

post-build:
.if ${PORTVERSION} == 1.3.2
	${SED}	-e 's,$$GSCONF | $$PIPS -ui C,TMP=/tmp/pips.$$$$;\
trap "rm -rf $$TMP; exit" 0 2 3 4 6 7 8 10 11 12 13 15;\
psselect -r > $$TMP;\
$${GSCONF} < $$TMP | $${PIPS} -ui C,' \
		-e 's,$${GSCONF} | $${PIPS} -ui C,TMP=/tmp/pips.$$$$;\
trap "rm -rf $$TMP; exit" 0 2 3 4 6 7 8 10 11 12 13 15;\
psselect -r > $$TMP;\
$${GSCONF} < $$TMP | $${PIPS} -ui C,' \
		${WRKSRC}/src/filter${PRTYPE} > ${WRKSRC}/src/filter${PRTYPE}.rev
.endif
	${SED}	-e 's,%%PRTYPE%%,${PRTYPE},g' \
		-e 's,%%PRT_MODEL%%,${PRT_MODEL},g' \
		-e 's,%%VERSION%%,${PORTVERSION},'g \
		-e 's,%%PREFIX%%,${PREFIX},g' \
		-e 's,%%WITH_EKPD%%,${WITH_EKPD},g' \
			${FILESDIR}/setup > ${WRKDIR}/setup.freebsd
.if ${PORTVERSION} == 2.1.2 || ${PORTVERSION} == 2.6.2
	${REINPLACE_CMD} -e 's,.rev$$,,' ${WRKDIR}/setup.freebsd
	@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		${FILESDIR}/ekpd.sh > ${WRKDIR}/ekpd.sh
	@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
		${FILESDIR}/pips.sh > ${WRKDIR}/pips.sh
.endif
	${SED}	-e 's,%%LIB_FILE%%,${LIB_FILE},g' \
		-e 's,%%PRT_MODEL%%,${PRT_MODEL},g' \
		${MASTERDIR}/pkg-message > ${PKGMESSAGE}

post-install:
.if ${DIST_TYPE} != cups
	${RM} -f ${PREFIX}/etc/pipsrc
	${TOUCH} ${PREFIX}/etc/pipsrc
	${CHMOD} 666 ${PREFIX}/etc/pipsrc
.endif
	${INSTALL_SCRIPT} ${WRKDIR}/setup.freebsd \
		${PREFIX}/libexec/pips/${PRT_MODEL}/setup
	${MKDIR} ${PREFIX}/libexec/pips/${PRT_MODEL}/scripts
	${INSTALL_DATA} ${FILESDIR}/en.lc \
		${PREFIX}/libexec/pips/${PRT_MODEL}/scripts
	${INSTALL_DATA} ${FILESDIR}/ja.lc \
		${PREFIX}/libexec/pips/${PRT_MODEL}/scripts
.if ${PORTVERSION} == 1.3.2
	${INSTALL_SCRIPT} ${WRKSRC}/src/filter${PRTYPE}.rev \
		${PREFIX}/libexec/pips/${PRT_MODEL}
.endif
.if !defined(NOPORTDOCS)
.for f in ${DOCS}
	${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
.endfor
.endif
	@${ECHO_CMD} "lib/pips/${LIB_FILE}" >>${TMPPLIST}
.if ${PRTYPE} == 970 || ${PRTYPE} == 980 || ${PRTYPE} == 4000
	@${ECHO_CMD} "lib/pips/${LIB_FILE:S/.so/R1.so/}" >>${TMPPLIST}
	@${ECHO_CMD} "lib/pips/${LIB_FILE:S/.so/R2.so/}" >>${TMPPLIST}
	${INSTALL_SCRIPT} ${WRKDIR}/pips.sh ${PREFIX}/etc/rc.d
	@${ECHO_CMD} "etc/rc.d/pips.sh" >>${TMPPLIST}
	${PREFIX}/etc/rc.d/pips.sh start
.endif
	@${ECHO_CMD} "@dirrm lib/pips" >>${TMPPLIST}
.for f in ${PATCH_PRN}
	@${ECHO_CMD} "libexec/pips/${PRT_MODEL}/${f}" >>${TMPPLIST}
.endfor
	@${ECHO_CMD} "@dirrm libexec/pips/${PRT_MODEL}" >>${TMPPLIST}
	@${ECHO_CMD} "@dirrm libexec/pips" >>${TMPPLIST}
.if ${PORTVERSION} == 2.1.2 || ${PORTVERSION} == 2.6.2
	${INSTALL_SCRIPT} ${WRKDIR}/ekpd.sh ${PREFIX}/etc/rc.d
.endif
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud