aboutsummaryrefslogtreecommitdiff
path: root/emulators/mtools/Makefile
blob: 7869aeca636d2c0631cc0cb78b701896bbc16b35 (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
# New ports collection makefile for:    mtools
# Date created:         5 October 1994
# Whom:                 jmz
#
# $FreeBSD$
#

PORTNAME=	mtools
PORTVERSION=	4.0.10
PORTREVISION=	3
CATEGORIES=	emulators
MASTER_SITES=	${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR=	mtools

MAINTAINER=	skreuzer@FreeBSD.org
COMMENT=	A collection of tools for manipulating MSDOS files

CONFLICTS_INSTALL=	multimarkdown-*

USE_BZIP2=	yes
USE_GMAKE=	yes
GNU_CONFIGURE=	yes
CONFIGURE_ENV=	ac_cv_header_malloc_h=no
CONFIGURE_ARGS=	--enable-xdf

SUB_FILES=	pkg-message

MAN1=		mattrib.1 mbadblocks.1 mcat.1 mcd.1 mclasserase.1 mcopy.1 \
		mdel.1 mdeltree.1 mdir.1 mdu.1 mformat.1 mkmanifest.1 \
		minfo.1 mlabel.1 mmd.1 mmount.1 mmove.1 mpartition.1 \
		mrd.1 mren.1 mshowfat.1 mtoolstest.1 mtools.1 mtype.1 \
		mzip.1
MAN5=		mtools.5
INFO=		mtools

.if defined(WITHOUT_ICONV)
CONFIGURE_ENV+=	ac_cv_header_iconv_h=no
.else
USE_ICONV=	yes
CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib -liconv
.endif

.if defined(WITHOUT_X11)
CONFIGURE_ARGS+=	--without-x
PLIST_SUB=	X11="@comment "
MAKE_ENV+=	WITHOUT_X11=${WITHOUT_X11}
.else
USE_XORG=	x11 sm ice xau
PLIST_SUB=	X11=""
MAN1+=		floppyd.1 floppyd_installtest.1
.endif

post-patch:
	@${REINPLACE_CMD} -e \
		's|^#define MT_SIZE_T size_t|#define MT_SIZE_T off_t|g' \
		${WRKSRC}/llong.h
	@${REINPLACE_CMD} -e 's|/etc/mtools.conf|${PREFIX}/etc/mtools.conf|g' \
		${WRKSRC}/mformat.c
.for f in mtools.5 mtools.texi
	@${REINPLACE_CMD} -e 's|/usr/local/etc/|${PREFIX}/etc/|g' \
		${WRKSRC}/${f}
.endfor

post-install:
	${INSTALL_DATA} ${WRKSRC}/mtools.conf ${PREFIX}/etc/mtools.conf.sample
	@if [ ! -f ${PREFIX}/etc/mtools.conf ]; then \
		cd ${PREFIX}/etc && ${CP} -p mtools.conf.sample mtools.conf; \
	fi
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>