ports/databases/py-psycopg2/Makefile

52 lines
1.4 KiB
Makefile
Raw Normal View History

2023-10-11 18:19:00 +00:00
COMMENT= PostgreSQL database adapter for Python
2023-08-16 22:26:55 +00:00
2023-10-11 18:19:00 +00:00
MODPY_EGG_VERSION= 2.9.9
DISTNAME= psycopg2-${MODPY_EGG_VERSION}
PKGNAME= py-${DISTNAME}
CATEGORIES= databases
2023-08-16 22:26:55 +00:00
2023-10-11 18:19:00 +00:00
HOMEPAGE= https://www.psycopg.org/
2023-08-16 22:26:55 +00:00
# LGPLv3
2023-10-11 18:19:00 +00:00
PERMIT_PACKAGE=Yes
2023-08-16 22:26:55 +00:00
WANTLIB += ${MODPY_WANTLIB}
WANTLIB += pq pthread
2023-10-11 18:19:00 +00:00
MODULES= lang/python \
databases/postgresql
2023-08-16 22:26:55 +00:00
2023-10-11 18:19:00 +00:00
MODPY_PI= Yes
MODPY_PYBUILD= setuptools
MODPY_PYTEST= No
2023-08-16 22:26:55 +00:00
2023-10-11 18:19:00 +00:00
LIB_DEPENDS= databases/postgresql
RUN_DEPENDS= databases/postgresql
TEST_DEPENDS= ${FULLPKGNAME}:${BUILD_PKGPATH}
2023-08-16 22:26:55 +00:00
2023-10-11 18:19:00 +00:00
FLAVORS= python3
FLAVOR= python3
2023-08-16 22:26:55 +00:00
# To run the tests, create and start a test database as follows:
# createdb psycopg2_test
# The test target will use the PSYCOPG2_TESTDB environment
# variable to connect to the database; see below for defaults. The
# user running the test test will be used to make the connection
# and should own the database:
# echo "ALTER DATABASE psycopg2_test OWNER TO ${USER};" | \
# psql -U postgres
2023-10-11 18:19:00 +00:00
MODPOSTGRESQL_TEST_DBNAME= psycopg2_test
2023-08-16 22:26:55 +00:00
PSYCOPG2_TESTDB_USER ?= "postgres"
PSYCOPG2_TESTDB_PASSWORD ?= "postgres"
2023-10-11 18:19:00 +00:00
# PSYCOPG2_TESTDB_PASSWORD=postgres
TEST_DEPENDS= devel/gmake
TEST_ENV= PSYCOPG2_TESTDB=${MODPOSTGRESQL_TEST_DBNAME} \
PSYCOPG2_TESTDB_USER=postgres \
PYTHON_VERSION=${MODPY_VERSION}
MODPOSTGRESQL_TEST_CMD= gmake check \
BUILD_DIR=${WRKSRC}/build/lib.openbsd-${OSREV}-${ARCH}-cpython-${MODPY_MAJORMINOR}
2023-08-16 22:26:55 +00:00
.include <bsd.port.mk>