1 # $NetBSD: Makefile,v 1.31 2009/11/30 18:32:53 heinz Exp $
5 # We keep an uncompressed tar archive of the sources on
6 # ${MASTER_SITE_LOCAL} so that we won't need gzcat to extract the
7 # sources, which could potentially cause a circular dependency on
10 #MASTER_SITES= ${MASTER_SITE_GNU:=patch/}
11 MASTER_SITES= ${MASTER_SITE_LOCAL}
14 MAINTAINER= pkgsrc-users@NetBSD.org
15 HOMEPAGE= http://www.gnu.org/software/patch/patch.html
16 COMMENT= Patch files using diff output
19 PKG_INSTALLATION_TYPES= overwrite pkgviews
20 PKG_DESTDIR_SUPPORT= user-destdir
24 .include "../../mk/bsd.prefs.mk"
26 .if defined(GNU_PROGRAM_PREFIX)
27 CONFIGURE_ARGS+= --program-prefix=${GNU_PROGRAM_PREFIX:Q}
29 PLIST_SUBST+= GNU_PROGRAM_PREFIX=${GNU_PROGRAM_PREFIX:Q}
30 BUILD_DEFS+= GNU_PROGRAM_PREFIX
34 .if !defined(GNU_PROGRAM_PREFIX) || ${GNU_PROGRAM_PREFIX} != "g"
38 INSTALL_MAKE_FLAGS= bindir=${DESTDIR}${PREFIX}/bin \
39 man1dir=${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
42 ${MV} ${WRKSRC}/pch.c ${WRKSRC}/pch.c.orig
43 ${AWK} '/#include <pch.h>/{print $$0 "\n#include <sys/param.h>";next;}\
44 /^#if HAVE_SETMODE_DOS/ \
45 {gsub(/^#if HAVE_SETMODE_DOS/,"#if defined(HAVE_SETMODE_DOS) \\&\\& !(defined(BSD) \\&\\& BSD >= 199306) \\&\\& !defined(__INTERIX)");print $$0; next; } \
47 < ${WRKSRC}/pch.c.orig \
50 .if !defined(GNU_PROGRAM_PREFIX) || ${GNU_PROGRAM_PREFIX} != "g"
52 ${LN} -sf ${GNU_PROGRAM_PREFIX}patch ${DESTDIR}${PREFIX}/bin/gpatch
55 .include "../../mk/bsd.pkg.mk"