summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py34
1 files changed, 24 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index fafe828..766b2a2 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@
# File: setup.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 René 'Necoro' Neumann
# This is free software. You may redistribute copies of it under the terms of
# the GNU General Public License version 2.
# There is NO WARRANTY, to the extent permitted by law.
@@ -16,9 +16,8 @@ import sys
from distutils.core import setup
from distutils.extension import Extension
-from Cython.Distutils import build_ext
-from portato.constants import VERSION, ICON_DIR, PLUGIN_DIR, TEMPLATE_DIR, APP
+from portato.constants import VERSION, ICON_DIR, PLUGIN_DIR, DATA_DIR, TEMPLATE_DIR, APP
from build_manpage import build_manpage
@@ -36,21 +35,36 @@ packages = [
data_files = [
(TEMPLATE_DIR, [os.path.join("portato/gui/templates",x) for x in os.listdir("portato/gui/templates") if (x.endswith(".ui") or x.endswith(".menu"))]),
- (ICON_DIR, ["icons/portato-icon.png"]),
+ (ICON_DIR, ["icons/portato-icon.png", "icons/better-package.svg"]),
+ (DATA_DIR, ["doc/TRANSLATORS"]),
(PLUGIN_DIR, plugin_list("gpytage", "notify", "etc_proposals", "reload_portage", "package_details"))]
+cmdclass = {'build_manpage': build_manpage}
+
+# remove useless options / they are the default
+for o in ("cython", "eix"):
+ try:
+ sys.argv.remove("--enable-"+o)
+ except ValueError:
+ pass
+
# extension stuff
-ext_modules = [Extension("portato.ipc", ["portato/ipc.pyx"])]
+if "--disable-cython" in sys.argv:
+ sys.argv.remove("--disable-cython")
+ ext = "c"
+else:
+ from Cython.Distutils import build_ext
+ cmdclass['build_ext'] = build_ext
+ ext = "pyx"
+
+ext_modules = [Extension("portato.ipc", ["portato/ipc."+ext])]
if "--disable-eix" in sys.argv:
sys.argv.remove("--disable-eix")
else:
- ext_modules.append(Extension("portato.eix.parser", ["portato/eix/parser.pyx"]))
+ ext_modules.append(Extension("portato.eix.parser", ["portato/eix/parser."+ext]))
packages.append("portato.eix")
- if "--enable-eix" in sys.argv:
- sys.argv.remove("--enable-eix")
-
# do the distutils setup
setup(name=APP,
version = VERSION,
@@ -64,5 +78,5 @@ setup(name=APP,
packages = packages,
data_files = data_files,
ext_modules = ext_modules,
- cmdclass={'build_manpage': build_manpage, 'build_ext' : build_ext}
+ cmdclass = cmdclass
)