summaryrefslogtreecommitdiff
path: root/cad/pcb/Makefile
blob: 284f3ae6d3f71ac08535c2dc45d76eaba79d5a63 (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
# $NetBSD: Makefile,v 1.14 2002/06/27 16:46:30 agc Exp $
# FreeBSD Id: Makefile,v 1.19 1998/10/31 18:05:31 jseger Exp
#

DISTNAME=	pcb-1.6.3
PKGREVISION=	2
CATEGORIES=	cad
MASTER_SITES=	ftp://ftp.linuxppc.org/pub/linuxppc/users/harry/PCB/ \
		ftp://ftp.uni-ulm.de/pub/pcb/mirror/
EXTRACT_SUFX=	.tgz
DISTFILES=	pcb-1.6.3.tgz \
		pcb-docs-1.6.3.tar.gz

MAINTAINER=	dmcmahill@netbsd.org
HOMEPAGE=	http://bach.ece.jhu.edu/~haceaton/pcb/
COMMENT=	X11 interactive printed circuit board layout system

DEPENDS+=	m4-1.4:../../devel/m4

USE_IMAKE=	yes

INFO_FILES=	pcb.info

DEINSTALL_FILE=	${WRKDIR}/DEINSTALL

PCB_CONFDIR=	${PKG_SYSCONFDIR}/pcb
MESSAGE_SUBST+=	PCB_CONFDIR=${PCB_CONFDIR}
# avoid picking up any user config files during the build
MAKE_ENV+=	HOME=${WRKSRC}

post-patch:
	${MV} -f ${WRKSRC}/config.h  ${WRKSRC}/config.h.bak
	${SED} 's;@pkg_sysconfdir@;${PCB_CONFDIR};g' ${WRKSRC}/config.h.bak > ${WRKSRC}/config.h

pre-install:
	${SED} 's;@pkg_sysconfdir@;${PKG_SYSCONFDIR};g' ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}

post-install:
	${INSTALL_MAN_DIR} ${PREFIX}/share/doc/pcb/
	${INSTALL_MAN} ${WRKSRC}/doc/index.html ${PREFIX}/share/doc/pcb/
	${INSTALL_MAN} ${WRKSRC}/doc/pcb.html ${PREFIX}/share/doc/pcb/
	${INSTALL_MAN} ${WRKSRC}/doc/pcb.info ${PREFIX}/info/
	${INSTALL_MAN} ${WRKSRC}/doc/pcb.ps ${PREFIX}/share/doc/pcb/
	${INSTALL_MAN} ${WRKSRC}/doc/refcard.ps ${PREFIX}/share/doc/pcb/
	${INSTALL_DATA_DIR} ${PCB_CONFDIR}
	if [ ! -f "${PCB_CONFDIR}/local.inc" ]; then \
		${ECHO} "# list your local includes here" > ${PCB_CONFDIR}/local.inc ; \
	fi
	${MV} -f ${X11PREFIX}/lib/X11/pcb/m4/common.m4 ${X11PREFIX}/lib/X11/pcb/m4/common.m4.bak
	${AWK} '/^divert\(0\)dnl/ { \
			printf("include(${PCB_CONFDIR}/local.inc)\n"); \
			printf("sinclude(site-config.inc)\n"); \
			printf("sinclude(user-config.inc)\n"); \
			printf("sinclude(proj-config.inc)\n"); \
			} \
		{gsub(/^include\(/,"include(${X11PREFIX}/lib/X11/pcb/m4/"); print } ' \
		${X11PREFIX}/lib/X11/pcb/m4/common.m4.bak > ${X11PREFIX}/lib/X11/pcb/m4/common.m4
	${RM} -f ${X11PREFIX}/lib/X11/pcb/m4/common.m4.bak

.include "../../mk/texinfo.mk"
.include "../../mk/x11.buildlink.mk"
.include "../../mk/bsd.pkg.mk"