summaryrefslogtreecommitdiff
path: root/sysutils/coreutils/Makefile
blob: eadc9fb8101072cc4841c887a960fc4a37b544b3 (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
69
70
71
72
73
74
75
# $NetBSD: Makefile,v 1.83 2022/06/28 11:35:55 wiz Exp $

PKGREVISION= 1
.include "../../sysutils/coreutils/Makefile.common"

CONFLICTS=	fileutils-[0-9]* gnuls-[0-9]* linuxls-[0-9]* sh-utils-[0-9]* textutils-[0-9]*

# devel/id-utils installs a 'gid' program, so conflict with it
# databases/geneweb a 'gwc' program, so conflict with it
# graphics/graphviz installs a 'gpr' program, so conflict with it
CONFLICTS+=		id-utils-[0-9]* gnome-utils<1.4.1.2nb2
CONFLICTS+=		geneweb-[0-9]*
CONFLICTS+=		graphviz<1.12

INFO_FILES=		yes

# Exclude programs from PLIST which aren't built on a platform.
PLIST_VARS+=		hostid stdbuf
.if ${OPSYS} != "Interix"
PLIST.hostid=		yes
.endif

# This should really only be defined if building stdbuf, however we cannot
# set this variable after including compiler.mk, so we take the hit of
# setting it unconditionally for now.
USE_GCC_RUNTIME=	yes

.include "../../mk/compiler.mk"

.if (${OBJECT_FMT} == "ELF" || ${OBJECT_FMT} == "Mach-O") && \
    (!empty(PKGSRC_COMPILER:Mgcc) || !empty(PKGSRC_COMPILER:Mclang))
PLIST.stdbuf=		yes
.endif

# Ensure libstdbuf.so has a valid library name otherwise REQUIRES will
# record the relative path of the object output file.
SUBST_CLASSES.Darwin+=	libname
SUBST_STAGE.libname=	pre-configure
SUBST_FILES.libname=	Makefile.in
SUBST_SED.libname=	-e '/^src_libstdbuf_so_LDFLAGS/s,$$, -install_name ${PREFIX}/libexec/coreutils/glibstdbuf.so,'

PROGS=	[ b2sum base32 base64 basename cat chcon chgrp chmod chown chroot cksum comm \
	cp csplit cut date dd df dir dircolors dirname du hostid echo env \
	expand expr factor false fmt fold groups head id install join kill \
	link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl \
	nohup nproc numfmt od paste pathchk pinky pr printenv printf ptx pwd \
	readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum \
	sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty sum \
	sync tac tail tee test timeout touch tr true truncate tsort tty uname \
	unexpand uniq unlink uptime users vdir wc who whoami yes

AUTO_MKDIRS=	yes

post-install:
.for f in ${PROGS}
	set -e; \
	if ${TEST} -f ${DESTDIR}${PREFIX}/bin/g${f:Q}; then \
	  ${LN} -sf ${PREFIX}/bin/g${f:Q} ${DESTDIR}${PREFIX}/${PKGGNUDIR}bin/${f:Q}; \
	fi; \
	if ${TEST} -f ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/g${f:Q}.1; then \
	  ${LN} -sf ${PREFIX}/${PKGMANDIR}/man1/g${f:Q}.1 ${DESTDIR}${PREFIX}/${PKGGNUDIR}${PKGMANDIR}/man1/${f:Q}.1; \
	fi
.endfor

#CONFIGURE_ARGS+=	--enable-install-program=su
#.if ${OPSYS} == "NetBSD" ||  ${OPSYS} == "FreeBSD" || \
#  ${OPSYS} == "OpenBSD"
#MAKE_FLAGS+=		setuid_root_mode=a=rx
#MESSAGE_SRC=		${.CURDIR}/MESSAGE.gsu
#MESSAGE_SUBST+=	OPSYS=${OPSYS:Q}
#.endif

.include "../../converters/libiconv/buildlink3.mk"
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"