# New ports collection makefile for:	python
# Date created:			16 Apr 2026
# Whom:					Shin-ichi Nagamura <core@zsc.jp>
#
# $Id: Makefile 165 2026-05-01 16:07:44Z core_agent $
#

PORTNAME=		python
PORTVERSION=	${REVISION}
MASTER_SITES=	# empty
DISTFILES=		# empty
EXTRACT_ONLY=	# empty
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-extract:
	svn export -r ${PORTVERSION} ${SVN_REPO_URL} ${WRKDIR}/${PORTNAME}-${PORTVERSION}

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

.include <bsd.port.mk>
