summaryrefslogtreecommitdiff
path: root/sysutils/gdisk/Makefile
blob: 1c3372bb51786b679d341c02dd67263ec0601720 (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
# Created by: Dmitry N Fomin <fdn@okbire.ru>
# $FreeBSD$

PORTNAME=	gdisk
PORTVERSION=	0.8.6
CATEGORIES=	sysutils
MASTER_SITES=	SF/gptfdisk/gptfdisk/${PORTVERSION}
DISTNAME=	gptfdisk-${PORTVERSION}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	GPT fdisk

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

LIB_DEPENDS=	libuuid.so:${PORTSDIR}/misc/e2fsprogs-libuuid \
		libpopt.so:${PORTSDIR}/devel/popt

WRKSRC=		${WRKDIR}/gptfdisk-${PORTVERSION}

FETCH_ARGS=	-Rr

ONLY_FOR_ARCHS=	i386 amd64

OPTIONS_DEFINE=	CGDISK UTF16
CGDISK_DESC=	A curses-based interactive program
UTF16_DESC=	Support for Unicode partition names

MAKEFILE=	Makefile.freebsd

PROGRAM_LIST=	fixparts gdisk sgdisk
PLIST_FILES=	${PROGRAM_LIST:C,^,sbin/,}

NO_STAGE=	yes
.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MCGDISK}
PROGRAM_LIST+=	cgdisk
LIB_DEPENDS+=	libncurses.so:${PORTSDIR}/devel/ncurses
.endif

.if ${PORT_OPTIONS:MUTF16}
LIB_DEPENDS+=	libicuuc.so:${PORTSDIR}/devel/icu
.endif

MAN8=
.for i in ${PROGRAM_LIST}
MAN8+=	${i}.8
.endfor

post-patch:
	${REINPLACE_CMD} -e 's|/usr/include/||' ${WRKSRC}/guid.h
	${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/${MAKEFILE}

.if ! ${PORT_OPTIONS:MCGDISK}
	${REINPLACE_CMD} -e '/^all:/s| cgdisk||' ${WRKSRC}/${MAKEFILE}
.endif

.if ! ${PORT_OPTIONS:MUTF16}
	${REINPLACE_CMD} -e 's| -D USE_UTF16||' \
			 -e 's| -licuio||' ${WRKSRC}/${MAKEFILE}
.endif

do-install:
.for i in ${PROGRAM_LIST}
	${INSTALL_PROGRAM} ${WRKSRC}/${i} ${PREFIX}/sbin
	${INSTALL_MAN} ${WRKSRC}/${i}.8 ${MAN8PREFIX}/man/man8
.endfor

post-install:
	@${ECHO_MSG}
	@${CAT} ${PKGMESSAGE}
	@${ECHO_MSG}

.include <bsd.port.mk>