Permalink
Browse files

setup.py: Use setuptools and update package info

We don't really use any neat setuptools features but we might
as well use it since all the cool kids are doing it.

Signed-off-by: David Aguilar <davvid@gmail.com>
  • Loading branch information...
1 parent abbd647 commit 0395deec7c39cea2dc37a7100f36d0505aabb8d1 @davvid davvid committed May 26, 2012
Showing with 44 additions and 20 deletions.
  1. +14 −9 Makefile
  2. +18 −0 setup.cfg
  3. +12 −11 setup.py
View
@@ -10,6 +10,7 @@ TAR = tar
# These values can be overridden on the command-line or via config.mak
prefix = $(HOME)
bindir = $(prefix)/bin
+coladir = $(prefix)/share/git-cola/lib
# DESTDIR =
cola_base := git-cola
@@ -18,28 +19,32 @@ cola_app = $(CURDIR)/$(cola_app_base)
cola_version = $(shell env TERM=dummy $(PYTHON) cola/version.py)
cola_dist := $(cola_base)-$(cola_version)
-python_version = $(shell env TERM=dummy $(PYTHON) -c 'import distutils.sysconfig as sc; print(sc.get_python_version())')
-python_site := $(prefix)/lib*/python$(python_version)/site-packages
-
test_flags =
all_test_flags = --with-doctest --exclude=sphinxtogithub $(test_flags)
# User customizations
-include config.mak
+setup_args = --prefix=$(prefix)
+setup_args += --quiet
+setup_args += --force
+setup_args += --single-version-externally-managed
+setup_args += --install-scripts=$(bindir)
+setup_args += --record=build/MANIFEST
+setup_args += --install-lib=$(coladir)
+ifdef DESTDIR
+ setup_args += --root=$(DESTDIR)
+endif
all::
$(PYTHON) setup.py build
install: all
- $(PYTHON) setup.py --quiet install \
- --prefix=$(DESTDIR)$(prefix) \
- --install-scripts=$(DESTDIR)$(bindir) \
- --force && \
- rm -f $(DESTDIR)$(python_site)/git_cola*
- rmdir -p $(DESTDIR)$(python_site) 2>/dev/null || true
+ $(PYTHON) setup.py install $(setup_args)
(cd $(DESTDIR)$(bindir) && \
! test -e cola && ln -s git-cola cola) || true
+ rm -rf $(DESTDIR)$(coladir)/git_cola*
+ rm -rf git_cola.egg-info
# Maintainer's dist target
dist:
View
@@ -0,0 +1,18 @@
+[bdist_rpm]
+release = 1
+requires = python PyQt4
+build_requires = python PyQt4
+doc_files =
+ COPYING
+ COPYRIGHT
+ README.md
+ share/doc/git-cola/
+
+[upload_sphinx]
+upload-dir = share/doc/git-cola/_build/html
+
+[build_sphinx]
+all_files = 1
+build-dir = share/doc/git-cola/_build
+source-dir = share/doc/git-cola/
+
View
@@ -4,7 +4,7 @@
import sys
import platform
from glob import glob
-from distutils.core import setup
+from setuptools import setup
# Look for modules in the root
srcdir = os.path.dirname(os.path.abspath(__file__))
@@ -67,16 +67,17 @@ def _run_setup():
if sys.platform == 'win32':
scripts.append('win32/cola')
- setup(name = 'git-cola',
- version = version.version(),
- description = 'The highly caffeinated git GUI',
- license = 'GPLv2',
- author = 'The git-cola community',
- author_email = 'git-cola@googlegroups.com',
- url = 'http://git-cola.github.com/',
- long_description = 'A sleek and powerful git GUI',
- scripts = scripts,
- cmdclass = cmdclass,
+ setup(name='git-cola',
+ version=version.version(),
+ description='The highly caffeinated git GUI',
+ long_description='A sleek and powerful git GUI',
+ license='GPLv2',
+ author='David Aguilar',
+ author_email='davvid@gmail.com',
+ url='http://git-cola.github.com/',
+ scripts=scripts,
+ cmdclass=cmdclass,
+ platforms='any',
data_files = cola_data_files())

0 comments on commit 0395dee

Please sign in to comment.