summaryrefslogtreecommitdiff
path: root/x11-servers/XFree86-4-Server-snap/Makefile
blob: d4e909ee9c923641b698464175467ecf669db753 (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
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
# New ports collection makefile for:    XFree86
# Version required:     4.0
# Date created:         5 January 1995
# Whom:                 jmz
#
# $FreeBSD$
#

DISTNAME=	xc
PKGNAME= 	XFree86-4.0
CATEGORIES=	x11
MASTER_SITES=	ftp://ftp.xfree86.org/pub/XFree86/4.0/source/ \
		ftp://ftp.freesoftware.com/pub/XFree86/4.0/source/ \
		ftp://ftp.lip6.fr/pub/X11/XFree86/XFree86-4.0/source/ \
		ftp://ftp.cs.tu-berlin.de/pub/X/XFree86/4.0/source/ \
		ftp://sunsite.doc.ic.ac.uk/packages/XFree86/4.0/source/
DISTFILES=	X400src-1.tgz X400src-2.tgz

MAINTAINER=	jmz@FreeBSD.org

.if (${MACHINE} != "alpha")
#NO_PACKAGE=	package available from XFree86
.endif
ALL_TARGET=	World
INSTALL_TARGET=	install install.man
DIST_SUBDIR=	xc
PATCH_DIST_ARGS=-p0 -E -d ${WRKDIR} --quiet
SCRIPTS_ENV=	OSVERSION=${OSVERSION}
.ifdef DISTRIB
DESTDIR=	${WRKDIR}/distrib
MAKE_ENV+=	DESTDIR=${DESTDIR}
NO_PKG_REGISTER=yes
SCRIPTS_ENV+=	NO_INPUT=yes
.endif
# can't use USE_X_PREFIX here -- it will cause a circular dependency
PREFIX=		${X11BASE}
.if defined(DISTRIB) || defined(PACKAGE_BUILDING)
#IS_INTERACTIVE is boolean -- "no" is the same as defining it "yes"!
#IS_INTERACTIVE=	no
.else
IS_INTERACTIVE=	yes	# configure script asks questions
.endif
MTREE_FILE=	/etc/mtree/BSD.x11.dist
.if (${MACHINE} == "pc98")
SCRIPTS_ENV+=	MACHINE=pc98
PLIST=		${PKGDIR}/PLIST.pc98
.endif
.if (${MACHINE} == "alpha")
SCRIPTS_ENV+=	MACHINE=alpha
PLIST=		${PKGDIR}/PLIST.alpha
.endif

.if defined(XDM_DES) && (${USA_RESIDENT} != YES && ${USA_RESIDENT} != NO)
pre-fetch:
	@${ECHO}
	@${ECHO} You must set variable USA_RESIDENT to YES or NO.
	@${FALSE}
.elif defined(USA_RESIDENT)
.if ${USA_RESIDENT} == NO
pre-fetch:
MASTER_SITES+=	ftp://psych.psy.uq.oz.au/pub/X11R5/ \
		ftp://ftp.internat.freebsd.org/pub/FreeBSD/X11-Crypto/ \
		ftp://ftp3.za.freebsd.org/pub/FreeBSD/X11-Crypto/
EXTRACT_ONLY=	X400src-1.tgz X400src-2.tgz
DISTFILES+=	Wraphelp.c
IGNOREFILES=	Wraphelp.c
.endif
.if ${USA_RESIDENT} == YES
pre-fetch:
	@${ECHO}
	@${ECHO} Assuming that you have fetched a USA-Legal Wraphelp.c.
.endif
.endif

.include <bsd.port.pre.mk>

pre-install:
	${MKDIR} ${PREFIX}

post-install:
.if ${PORTOBJFORMAT} == "aout"
.for lib in psres dps dpstk Xfont GL
	${LN} -sf lib${lib}.so.1.0 ${DESTDIR}/${PREFIX}/lib/lib${lib}.so
.endfor
.for lib in Xpm
	${LN} -sf lib${lib}.so.4.0 ${DESTDIR}/${PREFIX}/lib/lib${lib}.so
.endfor
.for lib in PEX5 SM XIE Xi Xmu Xt oldX xrx
	${LN} -sf lib${lib}.so.6.0 ${DESTDIR}/${PREFIX}/lib/lib${lib}.so
.endfor
.for lib in X11 Xtst
	${LN} -sf lib${lib}.so.6.1 ${DESTDIR}/${PREFIX}/lib/lib${lib}.so
.endfor
.for lib in Xp
	${LN} -sf lib${lib}.so.6.2 ${DESTDIR}/${PREFIX}/lib/lib${lib}.so
.endfor
.for lib in ICE Xext
	${LN} -sf lib${lib}.so.6.3 ${DESTDIR}/${PREFIX}/lib/lib${lib}.so
.endfor
.for lib in Xaw
	${LN} -sf lib${lib}.so.7.0 ${DESTDIR}/${PREFIX}/lib/lib${lib}.so
.endfor
.endif
.ifndef DISTRIB
	${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ${PREFIX}/lib
.endif

.ifdef DISTRIB
distrib: all install
	@cd ../XFree86-contrib && \
	    ${MAKE} NO_PKG_REGISTER=yes WRKDIR=${WRKDIR}/contrib-work \
	    PREFIX=${X11BASE} PREFIX=${DESTDIR}/${PREFIX} all install
	@${MKDIR} ${WRKDIR}/bindist
	@${CP} ${WRKSRC}/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-ELF/* \
	    ${WRKDIR}/bindist
	@${SED} -e 's:TAR="gnu-tar":TAR="${TAR}":g' \
	    -e 's/EXTRACTLOPTS="-t -v"/TARLOPTS="-t -v -z"/g' \
	    -e 's/\(#\)\(      echo $$i >> $$LISTFILE\)/\2/g' \
	    -e 's/\(#\)\(      echo "------------" >> $$LISTFILE\)/\2/g' \
	    -e 's/\(#\)\(      $$TAR $$TARLOPTS -f $$i >> $$LISTFILE\)/\2/g' \
	    -e 's/\(#\)\(      echo "" >> $$LISTFILE\)/\2/g' \
	    -e 's/\(      $$EXTRACT $$EXTRACTLOPTS $$i >> $$LISTFILE\)/#\1/g' \
	    < ${WRKSRC}/programs/Xserver/hw/xfree86/etc/bindist/build-bindist \
	    > ${WRKDIR}/build-bindist
	@${CHMOD} 0555 ${WRKDIR}/build-bindist
	@${WRKDIR}/build-bindist X ${WRKDIR}/distrib ${WRKDIR}/bindist
.else
distrib:
	@${ECHO_MSG} '>> The DISTRIB variable must be set when building ' \
	    '"distrib".'
	@exit 1
.endif

.include <bsd.port.post.mk>