summaryrefslogtreecommitdiff
path: root/devel/cscope/Makefile
blob: 7309c53c5081afae88cc9d6dd4c847154ec27b99 (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
# ports collection makefile for:	cscope
# Version required:	13.7
# Date created:		1998-11-21
# Whom:			Castor Fu
#
# $Id: Makefile,v 1.1.1.1 1999/04/13 17:15:54 taoka Exp $
#

DISTNAME=	cscope-13.7
CATEGORIES=	devel

MAINTAINER=	castor@alumni.caltech.edu

NO_WRKSUBDIR=yes
NO_CHECKSUM=yes
RESTRICTED="Redistribution license from Lucent Technologies required."
MAKEFILE=makefile

# Location of the Cscope sources as distributed on Toolchest disk
CDROMDIR=/cdrom/cscope
TESTFILE=cscope.1

MAN1=	cscope.1

TRUNCATED_NAMES=fixkeypad.c constants.h

do-fetch:
	@${DO_NADA}

#
# Introduce the ability to get things from a fixed distribution filesystem.
#
pre-extract:
	@${MKDIR} ${_DISTDIR}
	@(cd ${_DISTDIR}; \
	 for file in ${DISTFILES}; do \
		if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
			if [ -h $$file -o -h `${BASENAME} $$file` ]; then \
				${ECHO_MSG} ">> ${_DISTDIR}/$$file is a broken symlink."; \
				${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \
				${ECHO_MSG} ">> Please correct this problem and try again."; \
				exit 1; \
			fi ; \
			${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
			if [ ! -d ${CDROMDIR} -a ! -f ${CDROMDIR}/${TESTFILE} ] ; then \
				${ECHO_MSG} ">> ${CDROMDIR}/${TESTFILE} not found.  Perhaps the AT&T CD isn't mounted?"; \
				${ECHO_MSG} ">> See <http://www.lucent.com/ssg/html/toolchest.html>."; \
				exit 1; \
			else \
				(cd ${CDROMDIR}; tar czf ${_DISTDIR}/$$file .); \
			fi; \
		fi \
	 done)

#
# Get rid of any <CR>'s in the files and expand out file names which may have been truncated.
#

post-extract:
	@(${CHMOD} +w ${WRKSRC})
	@(for file in ${WRKSRC}/* ; do ${TR} -d '\015' < $$file > $$file.x ; ${MV} -f $$file.x $$file ; done)
	@(for file in ${TRUNCATED_NAMES} ; do \
		x=`echo $$file | ${SED} -e 's/^\(......\).*/\1/'` ; \
		y=$${file#*.} ; \
		${MV} ${WRKSRC}/$${x}*.$${y} ${WRKSRC}/$$file; \
	done)

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/cscope ${PREFIX}/bin
	${INSTALL_MAN}	${WRKSRC}/cscope.1 ${PREFIX}/man/man1

.include <bsd.port.mk>