summaryrefslogtreecommitdiff
path: root/cad/pcb/Makefile
blob: 16bd1d1a95516899477fdaa295216a46856f154e (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
# $NetBSD: Makefile,v 1.25 2005/03/24 21:12:51 wiz Exp $

DISTNAME=	pcb-1.6.3
PKGREVISION=	3
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

CONFLICTS+=	pcb-current-[0-9]*

USE_BUILDLINK3=	yes
USE_PKGINSTALL=	yes
USE_IMAKE=	yes

PKG_SYSCONFSUBDIR=	pcb
DOCDIR=			${PREFIX}/share/doc/pcb
EGDIR=			${PREFIX}/share/examples/pcb
INFODIR=		${PREFIX}/info
M4DIR=			${PREFIX}/lib/X11/pcb/m4

INFO_FILES=	pcb.info
CONF_FILES=	${EGDIR}/local.inc ${PKG_SYSCONFDIR}/local.inc

# avoid picking up any user config files during the build
MAKE_ENV+=	HOME=${WRKSRC}

post-patch:
	for file in ${WRKSRC}/config.h; do				\
		${SED}	-e "s|@sysconfdir@|${PKG_SYSCONFDIR}|g"		\
			$${file} > $${file}.fixed;			\
		${MV} -f $${file}.fixed $${file};			\
	done

post-install:
	${INSTALL_DATA_DIR} ${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/index.html ${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/pcb.html ${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/pcb.info ${INFODIR}
	${INSTALL_DATA} ${WRKSRC}/doc/pcb.ps ${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/refcard.ps ${DOCDIR}
	for file in ${M4DIR}/common.m4; do				\
		${AWK} '						\
		/^divert\(0\)dnl/ {					\
			printf("include(${PKG_SYSCONFDIR}/local.inc)\n"); \
			printf("sinclude(site-config.inc)\n");		\
			printf("sinclude(user-config.inc)\n");		\
			printf("sinclude(proj-config.inc)\n");		\
		}							\
		{							\
			gsub(/^include\(/,"include(${M4DIR}/");		\
			print;						\
		}'							\
		$${file} > $${file}.fixed;				\
		${MV} -f $${file}.fixed $${file};			\
	done
	${INSTALL_DATA_DIR} ${EGDIR}
	${ECHO} "# list your local includes here" > ${EGDIR}/local.inc

.include "../../mk/bsd.pkg.mk"