aboutsummaryrefslogtreecommitdiffstats
path: root/astro/geographiclib/Makefile
diff options
context:
space:
mode:
authorriggs <riggs@FreeBSD.org>2014-10-03 21:12:39 +0800
committerriggs <riggs@FreeBSD.org>2014-10-03 21:12:39 +0800
commita6a919da4974e809d52036f59c3a1d063f09b725 (patch)
tree212026a73e7065b2cd27716ffb3eb33dd9f9c2ca /astro/geographiclib/Makefile
parent44ba86408bdf035eaa1bd5e3812eab7549b4d5a6 (diff)
downloadfreebsd-ports-gnome-a6a919da4974e809d52036f59c3a1d063f09b725.tar.gz
freebsd-ports-gnome-a6a919da4974e809d52036f59c3a1d063f09b725.tar.zst
freebsd-ports-gnome-a6a919da4974e809d52036f59c3a1d063f09b725.zip
- Modernise pkg-plist
- Update handling of DATADIR - Bump PORTREVISION PR: 193968 Submitted by: tatsuki_makino@hotmail.com (maintainer)
Diffstat (limited to 'astro/geographiclib/Makefile')
-rw-r--r--astro/geographiclib/Makefile64
1 files changed, 46 insertions, 18 deletions
diff --git a/astro/geographiclib/Makefile b/astro/geographiclib/Makefile
index a73f015647ee..5c899fd71afd 100644
--- a/astro/geographiclib/Makefile
+++ b/astro/geographiclib/Makefile
@@ -3,6 +3,7 @@
PORTNAME= geographiclib
PORTVERSION= 1.37
+PORTREVISION= 1
CATEGORIES= astro
MASTER_SITES= SF/geographiclib/distrib \
SF/geographiclib:geoids,gravity,magnetic
@@ -18,13 +19,14 @@ LICENSE= MIT
USES= gmake libtool python
USE_GCC= any
USE_AUTOTOOLS= autoconf
-GNU_CONFIGURE= yes
-USE_LDCONFIG= yes
-NO_WRKSUBDIR= yes
-INSTALL_TARGET= install-strip
WRKSRC= ${WRKDIR}/${DISTNAME}
-MAKE_ARGS= pythondir=${PYTHON_SITELIBDIR}/geographiclib
+NO_WRKSUBDIR= yes
PORTDOCS= *
+GNU_CONFIGURE= yes
+MAKE_ARGS+= geographiclib_data=${DATADIR:Q}
+MAKE_ARGS+= pythondir=${PYTHON_SITELIBDIR}/geographiclib
+INSTALL_TARGET= install-strip
+USE_LDCONFIG= yes
OPTIONS_SUB= yes
OPTIONS_DEFAULT= GEOID_EGM96_5 GRAVITY_EGM96 GRAVITY_WGS84 \
@@ -68,24 +70,50 @@ post-patch:
${REINPLACE_CMD} -e '/wget/s/wget -O/fetch -o /' \
${WRKSRC}/tools/geographiclib-get-*.sh
-post-install:
- ${MKDIR} ${STAGEDIR}${DATADIR}/geoids \
- ${STAGEDIR}${DATADIR}/gravity \
- ${STAGEDIR}${DATADIR}/magnetic
- ${TOUCH} ${STAGEDIR}${DATADIR}/geoids/.keep \
- ${STAGEDIR}${DATADIR}/gravity/.keep \
- ${STAGEDIR}${DATADIR}/magnetic/.keep
+install-datasets-mkdir: .NOTMAIN
+ for d in geoids gravity magnetic ;\
+ do ${MKDIR} ${STAGEDIR}${DATADIR}/$${d} &&\
+ ${TOUCH} ${STAGEDIR}${DATADIR}/$${d}/.keep ;\
+ done
+.PHONY: install-datasets-mkdir
+
+.for n in geoids gravity magnetic
+install-datasets-${n}: install-datasets-mkdir .NOTMAIN
+ (cd ${WRKDIR}/${n} && \
+ ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/${n})
+.PHONY: install-datasets-${n}
+.endfor
+
+post-install: install-datasets-mkdir
.if ${PORT_OPTIONS:MGEOID_*}
- (cd ${WRKDIR}/geoids && \
- ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/geoids)
+post-install: install-datasets-geoids
.endif
.if ${PORT_OPTIONS:MGRAVITY_*}
- (cd ${WRKDIR}/gravity && \
- ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/gravity)
+post-install: install-datasets-gravity
.endif
.if ${PORT_OPTIONS:MMAGNETIC_*}
- (cd ${WRKDIR}/magnetic && \
- ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/magnetic)
+post-install: install-datasets-magnetic
.endif
+.PHONY: x-tool-plist
+x-tool-plist: ${PLIST} .NOTMAIN
+ ${REINPLACE_CMD}\
+ -e '/^%%PORTDOCS%%/d'\
+ -e '/^%%DATADIR%%\/geoids\/[^.]/{\
+ h;s|^%%DATADIR%%/geoids/\([^.]\{1,\}\).*|GEOID_\1|;\
+ s/[^0-9A-Za-z]/_/g;\
+ y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;\
+ s/^/%%/;s/$$/%%/;G;s/\n//;}'\
+ -e '/^%%DATADIR%%\/gravity\/[^.]/{\
+ h;s|^%%DATADIR%%/gravity/\([^.]\{1,\}\).*|GRAVITY_\1|;\
+ s/[^0-9A-Za-z]/_/g;\
+ y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;\
+ s/^/%%/;s/$$/%%/;G;s/\n//;}'\
+ -e '/^%%DATADIR%%\/magnetic\/[^.]/{\
+ h;s|^%%DATADIR%%/magnetic/\([^.]\{1,\}\).*|MAGNETIC_\1|;\
+ s/[^0-9A-Za-z]/_/g;\
+ y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;\
+ s/^/%%/;s/$$/%%/;G;s/\n//;}'\
+ ${PLIST}
+
.include <bsd.port.mk>