git: cad6302bccda - main - astro/astrometry: Put python into versioned dir

From: Rainer Hurling <rhurlin_at_FreeBSD.org>
Date: Sun, 03 Jul 2022 19:58:12 UTC
The branch main has been updated by rhurlin:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cad6302bccdaef3b1fd9fd4ce8b1d26c24b32840

commit cad6302bccdaef3b1fd9fd4ce8b1d26c24b32840
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2022-07-03 19:51:42 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2022-07-03 19:55:54 +0000

    astro/astrometry: Put python into versioned dir
    
    The Python files and libraries were incorrectly installed under
    lib/python instead of lib/python3.x and were therefore not version
    specific. This was corrected by using PYTHON_LIBDIR.
    
    While here, doing some more corrections:
    
    - Use PY_BASE_INSTALL_DIR for PYTHON_LIBDIR
    - Move DATA_INSTALL_DIR into MAKE_ENV
    - Strip bin and lib files
    - Remove PORTDOCS and PORTEXAMPLES entries
    - Pet portclippy
    - Update pkg-plist
    - Bump PORTREVISION
    
    MFH:            2022Q3
---
 astro/astrometry/Makefile  |  29 ++++++----
 astro/astrometry/pkg-plist | 138 ++++++++++++++++++++++++++-------------------
 2 files changed, 99 insertions(+), 68 deletions(-)

diff --git a/astro/astrometry/Makefile b/astro/astrometry/Makefile
index 25ee166e1cae..0696922a69d7 100644
--- a/astro/astrometry/Makefile
+++ b/astro/astrometry/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	astrometry
 PORTVERSION=	0.89
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	astro
 MASTER_SITES=	http://astrometry.net/downloads/
 DISTNAME=	${PORTNAME}.net-${PORTVERSION}
@@ -28,37 +28,46 @@ RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}astropy>0:astro/py-astropy@${PY_FLAVOR} \
 USES=		gmake jpeg localbase pkgconfig python shebangfix
 USE_LDCONFIG=	yes
 
-CONFLICTS_INSTALL=	afni p5-Text-RecordParser # bin/imstat bin/tabmerge
-
 SHEBANG_FILES=	bin/* sdss/*.py solver/*.py util/[!c]*.py
 
 MAKE_ARGS=	NETPBM_INC="-I${LOCALBASE}/include/netpbm" \
 		NETPBM_LIB="-L${LOCALBASE}/lib -lnetpbm" \
 		SYSTEM_GSL=yes
 MAKE_ENV=	INSTALL_DIR=${STAGEDIR}${PREFIX} \
+		DATA_INSTALL_DIR=${STAGEDIR}${DATADIR} \
 		DOC_INSTALL_DIR=${STAGEDIR}${DOCSDIR} \
 		EXAMPLE_INSTALL_DIR=${STAGEDIR}${EXAMPLESDIR} \
 		MAN1_INSTALL_DIR=${STAGEDIR}${PREFIX}/man/man1 \
+		PY_BASE_INSTALL_DIR=${STAGEDIR}${PYTHON_LIBDIR}/astrometry \
 		PYTHON=${PYTHON_CMD} PYTHON_SCRIPT=${PYTHON_CMD}
 MAKE_JOBS_UNSAFE=	yes
 ALL_TARGET=	all extra
 LDFLAGS+=	-lz
 
-# Need this to get gzipped man pages
+CONFLICTS_INSTALL=	afni p5-Text-RecordParser # bin/imstat bin/tabmerge
+
 MANDIRS=	${MANPREFIX}/man/man1
 SUB_FILES=	pkg-message
 
-PORTDOCS=	*
-PORTEXAMPLES=	*
-
 OPTIONS_DEFINE=		DOCS EXAMPLES
 OPTIONS_DEFAULT=	EXAMPLES
 
-# Changes search path in astrometry-engine
-DATA_INSTALL_DIR=	${STAGEDIR}${DATADIR}
+FILES=	an-fitstopnm an-pnmtofits astrometry-engine \
+	build-astrometry-index downsample-fits fit-wcs \
+	fits-column-merge fits-flip-endian fits-guess-scale \
+	fitscopy fitsgetext fitsverify get-healpix get-wcs \
+	hpsplit image2xy imarith imcopy imstat listhead liststruc \
+	modhead new-wcs pad-file plot-constellations \
+	plotquad plotxy query-starkd solve-field startree \
+	subtable tablist tabmerge tabsort wcs-grab wcs-match \
+	wcs-pv2sip wcs-rd2xy wcs-resample wcs-to-tan wcs-xy2rd \
+	wcsinfo
 
-# DATA_INSTALL_DIR does not work globally :(
 post-install:
+.for file in ${FILES}
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${file}
+.endfor
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libastrometry.so
 	@${REINPLACE_CMD} -i '' \
 		-e 's|${STAGEDIR}/usr/local/data|${DATADIR}|' \
 		${STAGEDIR}${PREFIX}/etc/${PORTNAME}.cfg
diff --git a/astro/astrometry/pkg-plist b/astro/astrometry/pkg-plist
index f0a1c6e9e243..0a35fca7d59d 100644
--- a/astro/astrometry/pkg-plist
+++ b/astro/astrometry/pkg-plist
@@ -191,64 +191,64 @@ lib/libastrometry.so
 lib/libcatalogs.a
 lib/libkd.a
 lib/libqfits.a
-lib/python/astrometry/__init__.py
-lib/python/astrometry/catalogs/__init__.py
-lib/python/astrometry/libkd/__init__.py
-lib/python/astrometry/libkd/spherematch.py
-lib/python/astrometry/libkd/spherematch_c%%PYTHON_EXT_SUFFIX%%.so
-lib/python/astrometry/net/client/client.py
-lib/python/astrometry/plot/_plotstuff_c%%PYTHON_EXT_SUFFIX%%.so
-lib/python/astrometry/plot/plotstuff.py
-lib/python/astrometry/plot/plotstuff_c.py
-lib/python/astrometry/sdss/__init__.py
-lib/python/astrometry/sdss/_cutils%%PYTHON_EXT_SUFFIX%%.so
-lib/python/astrometry/sdss/casjobs.py
-lib/python/astrometry/sdss/common.py
-lib/python/astrometry/sdss/cutils.py
-lib/python/astrometry/sdss/cutout.py
-lib/python/astrometry/sdss/dr10.py
-lib/python/astrometry/sdss/dr7.py
-lib/python/astrometry/sdss/dr8.py
-lib/python/astrometry/sdss/dr9.py
-lib/python/astrometry/sdss/fields.py
-lib/python/astrometry/sdss/runList-dr10.par
-lib/python/astrometry/sdss/runList-dr8.par
-lib/python/astrometry/sdss/runList-dr9.par
-lib/python/astrometry/sdss/sdss_das.py
-lib/python/astrometry/sdss/sdss_name.py
-lib/python/astrometry/sdss/yanny.py
-lib/python/astrometry/solver/__init__.py
-lib/python/astrometry/util/EXIF.py
-lib/python/astrometry/util/__init__.py
-lib/python/astrometry/util/_util%%PYTHON_EXT_SUFFIX%%.so
-lib/python/astrometry/util/addpath.py
-lib/python/astrometry/util/file.py
-lib/python/astrometry/util/filetype.py
-lib/python/astrometry/util/find_data_file.py
-lib/python/astrometry/util/fits.py
-lib/python/astrometry/util/fix_sdss_idr.py
-lib/python/astrometry/util/horizons.py
-lib/python/astrometry/util/image2pnm.py
-lib/python/astrometry/util/imageutils.py
-lib/python/astrometry/util/miscutils.py
-lib/python/astrometry/util/multiproc.py
-lib/python/astrometry/util/plotshift.py
-lib/python/astrometry/util/plotutils.py
-lib/python/astrometry/util/removelines.py
-lib/python/astrometry/util/resample.py
-lib/python/astrometry/util/run_command.py
-lib/python/astrometry/util/shell.py
-lib/python/astrometry/util/siap.py
-lib/python/astrometry/util/stages.py
-lib/python/astrometry/util/starutil.py
-lib/python/astrometry/util/starutil_numpy.py
-lib/python/astrometry/util/timingpool.py
-lib/python/astrometry/util/ttime.py
-lib/python/astrometry/util/uniformize.py
-lib/python/astrometry/util/usnob_catalog.py
-lib/python/astrometry/util/usnob_get_image.py
-lib/python/astrometry/util/usnob_get_region.py
-lib/python/astrometry/util/util.py
+%%PYTHON_LIBDIR%%/astrometry/__init__.py
+%%PYTHON_LIBDIR%%/astrometry/catalogs/__init__.py
+%%PYTHON_LIBDIR%%/astrometry/libkd/__init__.py
+%%PYTHON_LIBDIR%%/astrometry/libkd/spherematch.py
+%%PYTHON_LIBDIR%%/astrometry/libkd/spherematch_c%%PYTHON_EXT_SUFFIX%%.so
+%%PYTHON_LIBDIR%%/astrometry/net/client/client.py
+%%PYTHON_LIBDIR%%/astrometry/plot/_plotstuff_c%%PYTHON_EXT_SUFFIX%%.so
+%%PYTHON_LIBDIR%%/astrometry/plot/plotstuff.py
+%%PYTHON_LIBDIR%%/astrometry/plot/plotstuff_c.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/__init__.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/_cutils%%PYTHON_EXT_SUFFIX%%.so
+%%PYTHON_LIBDIR%%/astrometry/sdss/casjobs.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/common.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/cutils.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/cutout.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/dr10.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/dr7.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/dr8.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/dr9.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/fields.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/runList-dr10.par
+%%PYTHON_LIBDIR%%/astrometry/sdss/runList-dr8.par
+%%PYTHON_LIBDIR%%/astrometry/sdss/runList-dr9.par
+%%PYTHON_LIBDIR%%/astrometry/sdss/sdss_das.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/sdss_name.py
+%%PYTHON_LIBDIR%%/astrometry/sdss/yanny.py
+%%PYTHON_LIBDIR%%/astrometry/solver/__init__.py
+%%PYTHON_LIBDIR%%/astrometry/util/EXIF.py
+%%PYTHON_LIBDIR%%/astrometry/util/__init__.py
+%%PYTHON_LIBDIR%%/astrometry/util/_util%%PYTHON_EXT_SUFFIX%%.so
+%%PYTHON_LIBDIR%%/astrometry/util/addpath.py
+%%PYTHON_LIBDIR%%/astrometry/util/file.py
+%%PYTHON_LIBDIR%%/astrometry/util/filetype.py
+%%PYTHON_LIBDIR%%/astrometry/util/find_data_file.py
+%%PYTHON_LIBDIR%%/astrometry/util/fits.py
+%%PYTHON_LIBDIR%%/astrometry/util/fix_sdss_idr.py
+%%PYTHON_LIBDIR%%/astrometry/util/horizons.py
+%%PYTHON_LIBDIR%%/astrometry/util/image2pnm.py
+%%PYTHON_LIBDIR%%/astrometry/util/imageutils.py
+%%PYTHON_LIBDIR%%/astrometry/util/miscutils.py
+%%PYTHON_LIBDIR%%/astrometry/util/multiproc.py
+%%PYTHON_LIBDIR%%/astrometry/util/plotshift.py
+%%PYTHON_LIBDIR%%/astrometry/util/plotutils.py
+%%PYTHON_LIBDIR%%/astrometry/util/removelines.py
+%%PYTHON_LIBDIR%%/astrometry/util/resample.py
+%%PYTHON_LIBDIR%%/astrometry/util/run_command.py
+%%PYTHON_LIBDIR%%/astrometry/util/shell.py
+%%PYTHON_LIBDIR%%/astrometry/util/siap.py
+%%PYTHON_LIBDIR%%/astrometry/util/stages.py
+%%PYTHON_LIBDIR%%/astrometry/util/starutil.py
+%%PYTHON_LIBDIR%%/astrometry/util/starutil_numpy.py
+%%PYTHON_LIBDIR%%/astrometry/util/timingpool.py
+%%PYTHON_LIBDIR%%/astrometry/util/ttime.py
+%%PYTHON_LIBDIR%%/astrometry/util/uniformize.py
+%%PYTHON_LIBDIR%%/astrometry/util/usnob_catalog.py
+%%PYTHON_LIBDIR%%/astrometry/util/usnob_get_image.py
+%%PYTHON_LIBDIR%%/astrometry/util/usnob_get_region.py
+%%PYTHON_LIBDIR%%/astrometry/util/util.py
 man/man1/an-fitstopnm.1.gz
 man/man1/an-pnmtofits.1.gz
 man/man1/astrometry-engine.1.gz
@@ -296,3 +296,25 @@ man/man1/wcsinfo.1.gz
 %%DATADIR%%/sdss/psf2k0.fits
 %%DATADIR%%/sdss/tsField-002830-6-0398.fit
 %%DATADIR%%/solver/index-9918.fits
+%%PORTDOCS%%%%DOCSDIR%%/CREDITS
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE
+%%PORTDOCS%%%%DOCSDIR%%/README.md
+%%PORTDOCS%%%%DOCSDIR%%/report.txt
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/CREDITS
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/apod1.jpg
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/apod1.xyls
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/apod2.jpg
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/apod2.xyls
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/apod3.jpg
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/apod3.xyls
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/apod4.jpg
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/apod4.xyls
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/apod5.jpg
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/apod5.xyls
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/cfg
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/index-4119.fits
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/m44-1910-04-01.jpg
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/m44-1975-01-18.jpg
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sdss.jpg
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sdss.xyls
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tycho2-mag6.fits