blob: fc6d45e6e7ca0cb087ba9a906ba9b1406d7a520d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
# Ports collection makefile for: py-sqlalchemy
# Date created: 12 August 2004
# Whom: Dryice Dong Liu <dryice@dryice.name>
#
# $FreeBSD$
#
PORTNAME= sqlalchemy
PORTVERSION= 0.7.8
CATEGORIES= databases python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
DISTNAME= SQLAlchemy-${DISTVERSION}
MAINTAINER= nivit@FreeBSD.org
COMMENT= A Python SQL toolkit and Object Relational Mapper
LICENSE= MIT
# Python3 ready
USE_PYTHON= yes
USE_PYDISTUTILS= easy_install
PYDISTUTILS_PKGNAME= SQLAlchemy
PYDISTUTILS_PKGVERSION= ${DISTVERSION}
PYDISTUTILS_NOEGGINFO= yes
PYEASYINSTALL_ARCHDEP= yes
# bypass infrastructure bug
OPTIONSFILE= ${PORT_DBDIR}/py-${PORTNAME}/options
OPTIONS_DEFINE= DOCS EXAMPLES NOSE
OPTIONS_MULTI= BACKEND
OPTIONS_MULTI_BACKEND= FIREBIRD MSSQL MYSQL PGSQL SQLITE SYBASE
OPTIONS_DEFAULT= MYSQL PGSQL SQLITE
FIREBIRD_DESC= Firebird backend
MSSQL_DESC= MS SQL Server backend
NOSE_DESC= Use Nose for unit tests
SYBASE_DESC= Sybase backend
.include <bsd.port.options.mk>
DOCSDIR= ${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME}
EXAMPLESDIR= ${PREFIX}/share/examples/${PKGNAMEPREFIX}${PORTNAME}
.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MDOCS}
AL_PORTDOCS= *.html *.js
AL_PORTDOCS_SUBDIR= core dialects orm
.endif
.if ${PORT_OPTIONS:MFIREBIRD}
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/kinterbasdb/__init__.py:${PORTSDIR}/databases/kinterbasdb
.endif
.if ${PORT_OPTIONS:MMSSQL}
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/pymssql.py:${PORTSDIR}/databases/py-mssql
.endif
.if ${PORT_OPTIONS:MMYSQL}
.if ${PYTHON_VER} < 3.0
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}MySQLdb>=1.2.2:${PORTSDIR}/databases/py-MySQLdb
#.else
# At the moment databases/py-pymysql does not build with Python3
# See https://github.com/petehunt/PyMySQL#python-3-0-support
#RUN_DEPENDS+= pymysql>=0.5:${PORTSDIR}/databases/py-pymysql
.endif
.endif
.if ${PORT_OPTIONS:MNOSE}
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}nose-1.0.0:${PORTSDIR}/devel/py-nose
.endif
.if ${PORT_OPTIONS:MPGSQL}
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}psycopg2>=2.0.8:${PORTSDIR}/databases/py-psycopg2
.endif
.if ${PORT_OPTIONS:MSQLITE}
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/_sqlite3.so:${PORTSDIR}/databases/py-sqlite3
.endif
.if ${PORT_OPTIONS:MSYBASE}
RUN_DEPENDS+= ${PYTHON_SITELIBDIR}/Sybase.py:${PORTSDIR}/databases/py-sybase
.endif
post-install:
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${DOCSDIR}
.for i in ${AL_PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/doc/${i} ${DOCSDIR}
.endfor
.for i in ${AL_PORTDOCS_SUBDIR}
${MKDIR} ${DOCSDIR}/${i}
@cd ${WRKSRC}/doc/${i} && ${COPYTREE_SHARE} . ${DOCSDIR}/${i}
.endfor
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
${MKDIR} ${EXAMPLESDIR}
@cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} . ${EXAMPLESDIR}
.endif
.if ${PYTHON_REL} < 300
PLIST_SUB+= SPEEDUPS=""
.else
# C extensions are not supported in py3k
PLIST_SUB+= SPEEDUPS="@comment "
PYEASYINSTALL_OSARCH=
easyinstall-setopt:
${DO_NADA}
.endif
# When Python version is 3.2+ we rewrite all the filenames
# of TMPPLIST that end with .py[co], so that they conform
# to PEP 3147 (see http://www.python.org/dev/peps/pep-3147/)
.if ${PYTHON_REL} >= 320
PYMAGICTAG= ${PYTHON_CMD} -c 'import imp; print(imp.get_tag())'
add-plist-post:
@${AWK} '\
/\.py[co]$$/ && !($$0 ~ "/" pc "/") {id = match($$0, /\/[^\/]+\.py[co]$$/); if (id != 0) {d = substr($$0, 1, RSTART - 1); dirs[d] = 1}; sub(/\.py[co]$$/, "." mt "&"); sub(/[^\/]+\.py[co]$$/, pc "/&"); print; next} \
/^@dirrm / {d = substr($$0, 8); if (d in dirs) {print $$0 "/" pc}; print $$0; next} \
{print} \
END {if (sp in dirs) {print "@dirrm " sp "/" pc}} \
' \
pc="__pycache__" mt="$$(${PYMAGICTAG})" sp="${PYTHON_SITELIBDIR:S,${PYTHONBASE}/,,g}" \
${TMPPLIST} > ${TMPPLIST}.pyc_tmp
@${MV} ${TMPPLIST}.pyc_tmp ${TMPPLIST}
.endif
.include <bsd.port.post.mk>
|