summaryrefslogtreecommitdiff
path: root/misc/nut/Makefile
blob: 04935a8cd99296e9c1fd0377307c48023eec8a6e (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
PORTNAME=	nut
PORTVERSION=	20.1
PORTREVISION=	3
CATEGORIES=	misc
MASTER_SITES=	SF
PKGNAMEPREFIX=	health-

MAINTAINER=	jhale@FreeBSD.org
COMMENT=	Nutrition software to record what you eat
WWW=		http://nut.sourceforge.net/

LICENSE=	GPLv2+
LICENSE_FILE=	${WRKSRC}/LICENSE

USES=		gmake

DOCSDIR=	${PREFIX}/share/doc/${PKGBASE}
PORTDOCS=	CREDITS README nut.html

OPTIONS_DEFINE=	FLTK DOCS
OPTIONS_SUB=	yes

FLTK_DESC=		Install FLTK GUI
FLTK_LIB_DEPENDS=	libfreetype.so:print/freetype2 \
			libexpat.so:textproc/expat2 \
			libfontconfig.so:x11-fonts/fontconfig \
			libfltk_images.so:x11-toolkits/fltk
FLTK_USES=		xorg
FLTK_USE=		XORG=x11,xau,xcb,xcursor,xdmcp,xext,xfixes,xft,xinerama,xpm,xrender
FLTK_MAKE_ENV=		HAVE_FLTK=1 FLTK_NUT="fltk/Nut"
FLTK_MAKE_ENV_OFF=	HAVE_FLTK=0 FLTK_NUT=""
FLTK_DESKTOP_ENTRIES=	"Nut" "" "nuticon" "Nut" "Science;Biology;MedicalSoftware;" false

post-patch:
	@${FIND} ${WRKSRC} -name "Makefile" | ${XARGS} ${REINPLACE_CMD} -e \
		's|$$(prefix)/lib/nut|${DATADIR}| ; \
		 s|^HAVE_FLTK|#HAVE_FLTK| ; \
		 s|^FLTK_NUT|#FLTK_NUT| ; \
		 s|^CC =|CC ?=| ; \
		 s|^CXX =|CXX ?=| ; \
		 s|^CFLAGS :=|CFLAGS +=| ; \
		 s|$$(OPT)||'

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/nut ${STAGEDIR}${PREFIX}/bin
	${INSTALL_MAN} ${WRKSRC}/nut.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
	@${MKDIR} ${STAGEDIR}${DATADIR}
	(cd ${WRKSRC}/raw.data && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR})
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}

do-install-FLTK-on:
	${INSTALL_PROGRAM} ${WRKSRC}/fltk/Nut ${STAGEDIR}${PREFIX}/bin
	${INSTALL_DATA} ${WRKSRC}/nuticon.xpm ${STAGEDIR}${PREFIX}/share/pixmaps

.include <bsd.port.mk>