aboutsummaryrefslogtreecommitdiffstats
path: root/print/ghostscript-gnu-commfont/Makefile.common
blob: 025a7b0dfc23e629457269ad890c88a664ce43eb (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
PORTNAME=   ghostscript
PORTVERSION=    ${GS_VERSION}
CATEGORIES= print
MASTER_SITES=   # nonexistent
PKGNAMESUFFIX=  -gnu
DISTNAME=   # nonexistent
DISTFILES=  # empty

MAINTAINER?=    mita@FreeBSD.org
COMMENT?=   GNU ghostscript with CJK font support

RUN_DEPENDS=    gs:${PORTSDIR}/print/ghostscript-gnu \
        ${LOCALBASE}/share/ghostscript/Resource/ai0/CMap/Identity-H:${PORTSDIR}/print/adobe-cmaps

NO_BUILD=   yes
NO_WRKSUBDIR=   yes

GSLIB_DIR=  ${PREFIX}/share/ghostscript/${PORTVERSION}/lib
PLIST_SUB=  GS_VERSION=${PORTVERSION}

.if defined(COMMFONT)
PKGNAMESUFFIX:= ${PKGNAMESUFFIX}-commfont
PLIST=      ${PKGDIR}/pkg-plist.common
.else
RUN_DEPENDS+=   ${LOCALBASE}/share/ghostscript/${PORTVERSION}/lib/gs_init.ps.pre_sed:${PORTSDIR}/print/ghostscript-gnu-commfont
PLIST_SUB+= CIDFNMAP="${CIDFNMAP}"
.if defined(JPNFONT)
CATEGORIES:=    japanese ${CATEGORIES}
COMMENT=    GNU ghostscript with Japanese font support
PKGNAMEPREFIX=  ja-
PKGNAMESUFFIX:= ${PKGNAMESUFFIX}-jpnfont
RUN_DEPENDS+=   ${X11BASE}/lib/X11/fonts/TrueType/kochi-mincho-subst.ttf:${PORTSDIR}/japanese/kochi-ttfonts
CIDFNMAP=   CIDFnmap.jp
.elif defined(KORFONT)
CATEGORIES:=    korean ${CATEGORIES}
COMMENT=    GNU ghostscript with Korean font support
PKGNAMEPREFIX=  ko-
PKGNAMESUFFIX:= ${PKGNAMESUFFIX}-korfont
RUN_DEPENDS+=   ${LOCALBASE}/share/ghostscript/fonts/Munhwa-Bold:${PORTSDIR}/korean/munhwafonts-cid
CIDFNMAP=   CIDFnmap.ko
.endif
.endif

.include <bsd.port.pre.mk>
do-configure:
.if !defined(COMMFONT)
    ${SED} -e 's:%%LOCALBASE%%:${LOCALBASE}:g' \
           -e 's:%%X11BASE%%:${X11BASE}:g' \
        ${FILESDIR}/${CIDFNMAP} > ${WRKSRC}/${CIDFNMAP}
.endif

do-install:
.if defined(COMMFONT)
    ${MV} ${GSLIB_DIR}/gs_init.ps  ${GSLIB_DIR}/gs_init.ps.pre_sed
    ${SED} -e "s:^%.*(a4):(a4):" ${GSLIB_DIR}/gs_init.ps.pre_sed > \
        ${GSLIB_DIR}/gs_init.ps
.else
    ${INSTALL_DATA} ${WRKSRC}/${CIDFNMAP} ${GSLIB_DIR}
    ${MV} ${GSLIB_DIR}/CIDFnmap  ${GSLIB_DIR}/CIDFnmap.orig
    ${GREP} -v -e "${CIDFNMAP}" ${GSLIB_DIR}/CIDFnmap.orig > \
        ${GSLIB_DIR}/CIDFnmap
    ${ECHO_CMD} '(${CIDFNMAP}) .runlibfile' >> ${GSLIB_DIR}/CIDFnmap
.endif

post-install:
.if defined(KORFONT)
.for i in Munhwa-Bold Munhwa-Regular MunhwaGothic-Bold MunhwaGothic-Regular
    ${LN} -sf ${PREFIX}/share/ghostscript/fonts/${i} \
        ${PREFIX}/share/ghostscript/Resource/CIDFont/${i}
    ${ECHO_CMD} "share/ghostscript/Resource/CIDFont/${i}" >> ${TMPPLIST}
.endfor
.endif

.include "${PORTSDIR}/print/ghostscript-gnu/Makefile.inc"
.include <bsd.port.post.mk>