# New ports collection makefile for:	python
# Date created:			16 Apr 2026
# Whom:					Shin-ichi Nagamura <core@zsc.jp>
#
# $Id: Makefile 365 2026-07-26 17:38:45Z core_agent $
#

PORTNAME=		python
PORTVERSION=	${REVISION}
NO_BUILD=		yes

MAINTAINER=		info@zsc.jp
COMMENT=		ashiato python scripts

USES=			python:run

RUN_DEPENDS+=	dcraw-m:graphics/dcraw-m
RUN_DEPENDS+=	python3:lang/python3

PLIST_FILES+=	"@dir ${PYDIR}"
PLIST_FILES+=	"@dir etc/ashiato"
PLIST_FILES+=	"@postexec install -d -o ${USER} -g ${GROUP} -m 775 %D/etc/ashiato"
PLIST_FILES+=	"@postexec install -d -o ${USER} -g ${GROUP} -m 770 /var/cache/ashiato"
PLIST_FILES+=	"@postexec install -d -o ${USER} -g ${GROUP} -m 770 /var/cache/ashiato/depth_map"
PLIST_FILES+=	"@postexec install -d -o ${USER} -g ${GROUP} -m 770 /var/cache/ashiato/image"
PLIST_FILES+=	"@postexec install -d -o ${USER} -g ${GROUP} -m 770 /var/cache/ashiato/python"
PLIST_FILES+=	"@postexec install -d -o ${USER} -g ${GROUP} -m 770 /var/run/ashiato"
PLIST_FILES+=	"@sample etc/ashiato/ashiato.toml.sample"

do-install:
	${MKDIR} -p ${STAGEDIR}${PREFIX}/${PYDIR}
	${CP} -R ${WRKSRC}/python ${STAGEDIR}${PREFIX}/${PYDIR}
	cd ${STAGEDIR}${PREFIX} && \
		${FIND} ${PYDIR}/python -type f | sort >> ${TMPPLIST}
	${MKDIR} -p ${STAGEDIR}${PREFIX}/${ETCDIR}
	${INSTALL_DATA} ${WRKSRC}/etc/ashiato.toml ${STAGEDIR}${PREFIX}/${ETCDIR}/ashiato.toml.sample

.include <bsd.port.mk>
