2022-01-13 04:15:53 +01:00
|
|
|
import os, sys
|
2022-01-12 05:28:21 +01:00
|
|
|
from setuptools import setup, Extension
|
2011-05-12 22:45:14 +02:00
|
|
|
|
2022-01-14 08:57:08 +01:00
|
|
|
exec(open("netfilterqueue/_version.py", encoding="utf-8").read())
|
2011-05-12 22:45:14 +02:00
|
|
|
|
2022-01-14 01:19:28 +01:00
|
|
|
setup_requires = []
|
2011-05-12 22:45:14 +02:00
|
|
|
try:
|
|
|
|
# Use Cython
|
2022-01-12 05:28:21 +01:00
|
|
|
from Cython.Build import cythonize
|
2022-01-13 02:32:09 +01:00
|
|
|
|
2022-01-12 05:28:21 +01:00
|
|
|
ext_modules = cythonize(
|
|
|
|
Extension(
|
2022-01-14 20:58:56 +01:00
|
|
|
"netfilterqueue._impl",
|
|
|
|
["netfilterqueue/_impl.pyx"],
|
2022-01-14 08:57:08 +01:00
|
|
|
libraries=["netfilter_queue"],
|
2022-01-12 05:28:21 +01:00
|
|
|
),
|
|
|
|
compiler_directives={"language_level": "3str"},
|
|
|
|
)
|
2011-05-12 22:45:14 +02:00
|
|
|
except ImportError:
|
|
|
|
# No Cython
|
2022-01-13 11:14:43 +01:00
|
|
|
if "egg_info" in sys.argv:
|
|
|
|
# We're being run by pip to figure out what we need. Request cython in
|
|
|
|
# setup_requires below.
|
|
|
|
setup_requires = ["cython"]
|
2022-01-13 11:21:24 +01:00
|
|
|
elif not os.path.exists(
|
2022-01-14 20:58:56 +01:00
|
|
|
os.path.join(os.path.dirname(__file__), "netfilterqueue/_impl.c")
|
2022-01-13 11:21:24 +01:00
|
|
|
):
|
2022-01-13 04:15:53 +01:00
|
|
|
sys.stderr.write(
|
|
|
|
"You must have Cython installed (`pip install cython`) to build this "
|
|
|
|
"package from source.\nIf you're receiving this error when installing from "
|
|
|
|
"PyPI, please file a bug report at "
|
|
|
|
"https://github.com/oremanj/python-netfilterqueue/issues/new\n"
|
|
|
|
)
|
|
|
|
sys.exit(1)
|
2022-01-12 05:28:21 +01:00
|
|
|
ext_modules = [
|
2022-01-14 08:57:08 +01:00
|
|
|
Extension(
|
2022-01-14 20:58:56 +01:00
|
|
|
"netfilterqueue._impl",
|
|
|
|
["netfilterqueue/_impl.c"],
|
2022-01-14 08:57:08 +01:00
|
|
|
libraries=["netfilter_queue"],
|
|
|
|
)
|
2022-01-12 05:28:21 +01:00
|
|
|
]
|
2011-05-12 22:45:14 +02:00
|
|
|
|
|
|
|
setup(
|
|
|
|
name="NetfilterQueue",
|
2022-01-14 08:57:08 +01:00
|
|
|
version=__version__,
|
2016-06-28 08:56:35 +02:00
|
|
|
license="MIT",
|
2011-05-12 22:45:14 +02:00
|
|
|
author="Matthew Fox",
|
2016-06-28 08:52:50 +02:00
|
|
|
author_email="matt@tansen.ca",
|
2022-01-12 05:28:21 +01:00
|
|
|
url="https://github.com/oremanj/python-netfilterqueue",
|
2011-05-12 22:45:14 +02:00
|
|
|
description="Python bindings for libnetfilter_queue",
|
2022-01-14 08:57:08 +01:00
|
|
|
long_description=open("README.rst", encoding="utf-8").read(),
|
|
|
|
packages=["netfilterqueue"],
|
|
|
|
ext_modules=ext_modules,
|
|
|
|
include_package_data=True,
|
2022-01-14 21:11:17 +01:00
|
|
|
exclude_package_data={"netfilterqueue": ["*.c"]},
|
2022-01-14 08:57:08 +01:00
|
|
|
setup_requires=setup_requires,
|
|
|
|
python_requires=">=3.6",
|
2022-01-12 05:28:21 +01:00
|
|
|
classifiers=[
|
2016-06-28 08:57:58 +02:00
|
|
|
"Development Status :: 5 - Production/Stable",
|
2016-06-28 08:56:35 +02:00
|
|
|
"License :: OSI Approved :: MIT License",
|
2011-05-12 22:45:14 +02:00
|
|
|
"Operating System :: POSIX :: Linux",
|
|
|
|
"Topic :: System :: Networking",
|
|
|
|
"Topic :: Security",
|
|
|
|
"Intended Audience :: Developers",
|
|
|
|
"Intended Audience :: Telecommunications Industry",
|
|
|
|
"Programming Language :: Cython",
|
|
|
|
"Programming Language :: Python :: 2",
|
2015-05-16 09:25:44 +02:00
|
|
|
"Programming Language :: Python :: 3",
|
2022-01-13 02:32:09 +01:00
|
|
|
],
|
2011-05-12 22:45:14 +02:00
|
|
|
)
|