summaryrefslogtreecommitdiffstats
path: root/misc/excel-writer/Makefile
blob: 9193bf8eb761e0173146432b10443ca3d6a0329d (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
# Created by: John Marino <marino@FreeBSD.org>
# $FreeBSD$

PORTNAME=	excel-writer
PORTVERSION=	15
PORTREVISION=	1
CATEGORIES=	misc
MASTER_SITES=	http://sourceforge.net/projects/${SFPATH}/
DISTNAME=	excel_writer_${PORTVERSION}

MAINTAINER=	marino@FreeBSD.org
COMMENT=	Ada package for easily creating Excel files with basic formats

LICENSE=	MIT

USES=		ada zip dos2unix
SFPATH=		excel-writer/files/excel-writer
WRKSRC=		${WRKDIR}/Excel_Writer
PORTDOCS=	excel_writer.txt
PORTEXAMPLES=	example.gpr excel_out_demo.adb runme.sh

OPTIONS_DEFINE=	DOCS EXAMPLES

.include <bsd.port.options.mk>

post-extract:
	${CP} ${FILESDIR}/construct.gpr ${FILESDIR}/biff_dump.gpr ${WRKSRC}
	${MKDIR} ${WRKSRC}/src ${WRKDIR}/data
	${MV} "${WRKSRC}/Big [BIFF4].xls" ${WRKDIR}/data/Big.xls
	(cd ${WRKSRC}; ${MV} excel_out.ad[bs] ieee* extras/csv.* src)
	${SED} -e "s,@PREFIX@,${LOCALBASE},g" ${FILESDIR}/runme.sh.in \
		> ${WRKSRC}/runme.sh

post-patch:
	@${REINPLACE_CMD} -e "s|Big.xls|${DATADIR}/Big.xls|" \
		-e 's|\$$Dump\$$|_dump_|g' ${WRKSRC}/extras/biff_dump.adb
	${REINPLACE_CMD} -e 's/"\(.*\.xls\)"/"\/tmp\/\1"/g' \
		${WRKSRC}/excel_out_demo.adb

do-build:
	(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} gnatmake -p -Pconstruct)
	(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} gnatmake -p -Pbiff_dump)

do-install:
	${MKDIR} ${STAGEDIR}${PREFIX}/lib/gnat \
		${STAGEDIR}${PREFIX}/lib/excel_writer \
		${STAGEDIR}${PREFIX}/include/excel_writer \
		${STAGEDIR}${DATADIR}
	${INSTALL_DATA} ${FILESDIR}/excel_writer.gpr \
		${STAGEDIR}${PREFIX}/lib/gnat
	${INSTALL_DATA} ${WRKSRC}/src/* \
		${STAGEDIR}${PREFIX}/include/excel_writer
	${INSTALL_DATA} ${WRKSRC}/lib/*  \
		${STAGEDIR}${PREFIX}/lib/excel_writer
	${INSTALL_PROGRAM} ${WRKSRC}/bin/biff_dump ${STAGEDIR}${PREFIX}/bin
	${INSTALL_DATA} ${WRKDIR}/data/Big.xls ${STAGEDIR}${DATADIR}
.if ${PORT_OPTIONS:MDOCS}
	${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/excel_writer.txt ${STAGEDIR}${DOCSDIR}
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	${INSTALL_SCRIPT} ${WRKSRC}/runme.sh ${STAGEDIR}${EXAMPLESDIR}
	${INSTALL_DATA} ${WRKSRC}/excel_out_demo.adb \
		${FILESDIR}/example.gpr ${STAGEDIR}${EXAMPLESDIR}
.endif

.include <bsd.port.mk>
OpenPOWER on IntegriCloud