Merge from vendor branch OPENSSL:
[dragonfly.git] / share / mk / bsd.port.mk
1 # $FreeBSD: src/share/mk/bsd.port.mk,v 1.303.2.2 2002/07/17 19:08:23 ru Exp $
2 # $DragonFly: src/share/mk/Attic/bsd.port.mk,v 1.17 2004/08/14 13:49:41 joerg Exp $
3
4 PORTSDIR?=      /usr/ports
5 DFPORTSDIR?=    /usr/dfports
6 PORTPATH!=      /usr/bin/relpath ${PORTSDIR} ${.CURDIR}
7
8 .if !defined(DFOSVERSION)
9 DFOSVERSION!=   /sbin/sysctl -n kern.osreldate
10 .endif
11
12 # Temporary Hack
13 #
14 OSVERSION ?= 480102
15 UNAME_s?= FreeBSD
16 UNAME_v?=FreeBSD 4.8-CURRENT
17 UNAME_r?=4.8-CURRENT
18
19 .makeenv UNAME_s
20 .makeenv UNAME_v
21 .makeenv UNAME_r
22 .makeenv OSVERSION
23
24 .if !exists(${DFPORTSDIR}/${PORTPATH}/Makefile)
25
26 .if defined(USE_RC_SUBR)
27 .undef USE_RC_SUBR
28 RC_SUBR=        /etc/rc.subr
29 .endif
30
31 # If the port does not exist in /usr/dfports/<portpath> use the original
32 # FreeBSD port.  Also process as per normal if BEFOREPORTMK is set so
33 # any expected variables are set.
34 #
35 .include <bsd.own.mk>
36 .include "${PORTSDIR}/Mk/bsd.port.mk"
37
38 .else
39
40 .undef BEFOREPORTMK
41 .undef AFTERPORTMK
42
43 # Otherwise retarget to the DragonFly override port.
44 #
45
46 TARGETS+=       all
47 TARGETS+=       build
48 TARGETS+=       checksum
49 TARGETS+=       clean
50 TARGETS+=       clean-for-cdrom
51 TARGETS+=       clean-for-cdrom-list
52 TARGETS+=       clean-restricted
53 TARGETS+=       clean-restricted-list
54 TARGETS+=       configure
55 TARGETS+=       deinstall
56 TARGETS+=       depend
57 TARGETS+=       depends
58 TARGETS+=       describe
59 TARGETS+=       distclean
60 TARGETS+=       extract
61 TARGETS+=       fetch
62 TARGETS+=       fetch-list
63 TARGETS+=       ignorelist
64 TARGETS+=       makesum
65 TARGETS+=       maintainer
66 TARGETS+=       package
67 TARGETS+=       realinstall
68 TARGETS+=       reinstall
69 TARGETS+=       install
70 TARGETS+=       tags
71
72 .undef PORTSDIR
73 .if !make(package-depends-list) && !make(all-depends-list) && \
74     !make(run-depends-list) && !make(build-depends-list)
75 .BEGIN:
76         @echo "WARNING, USING DRAGONFLY OVERRIDE ${DFPORTSDIR}/${PORTPATH}"
77         cd ${DFPORTSDIR}/${PORTPATH} && ${MAKE} -B ${.TARGETS}
78 .endif
79
80 .if !empty(.TARGETS)
81 ${.TARGETS}:
82 .else
83 all:
84 .MAIN: all
85 .endif
86
87 # Hack to get Makefiles with conditional statements working
88 XFREE86_VERSION?=       4
89 ARCH?=                  i386
90 MACHINE_ARCH?=          i386
91 HAVE_GNOME?=
92 FILESDIR?=              ${.CURDIR}/files
93
94 # WORKAROUND to get portupgrade working
95 # Taken from: ${PORTSDIR}/Mk/bsd.port.mk
96 .if !defined(PKGNAME)
97 PKGNAME=        ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
98 .endif
99  
100 .endif
101