Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switch to using an Extension.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
  • Loading branch information...
commit 8f987d93b91cfc2b79d31d42ddcfbfb0e2a05de4 1 parent 8686edc
Chris Lalancette authored
Showing with 2 additions and 15 deletions.
  1. +2 −15 setup.py
View
17 setup.py
@@ -3,23 +3,10 @@
"""python-iptables setup script"""
import os
-from distutils import ccompiler
-from distutils.core import setup
+from distutils.core import setup, Extension
execfile("iptc/version.py")
-# libxtwrapper sources
-LIBDIR="libxtwrapper"
-csources = [os.path.join(LIBDIR, src)
- for src in os.listdir("libxtwrapper") if src.endswith(".c")]
-
-# compile and link libxtwrapper as a shared library
-compiler = ccompiler.new_compiler(compiler="unix")
-objs = compiler.compile(csources, extra_preargs=["-fPIC"])
-compiler.link_shared_lib(objs, "xtwrapper", output_dir=LIBDIR)
-lib = [os.path.join(LIBDIR,
- compiler.library_filename("xtwrapper", lib_type="shared"))]
-
# build/install python-iptables
setup(
name = __pkgname__,
@@ -30,7 +17,7 @@
url = "http://nilvec.com/",
packages = ["iptc"],
package_dir = {"iptc" : "iptc"},
- data_files = [("lib", lib)],
+ ext_modules = [Extension("libxtwrapper", ["libxtwrapper/wrapper.c"])],
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Please sign in to comment.
Something went wrong with that request. Please try again.