From 7801694f3302f6f8490f8b6ade70963cd29a3ff3 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Mon, 14 Apr 2008 00:08:32 -0700 Subject: [PATCH] debian: ugit is now debianized Signed-off-by: David Aguilar --- .gitignore | 5 +++++ debian/changelog | 10 ++++++++++ debian/compat | 1 + debian/control | 11 +++++++++++ debian/copyright | 34 ++++++++++++++++++++++++++++++++++ debian/dirs | 5 +++++ debian/docs | 0 debian/rules | 46 ++++++++++++++++++++++++++++++++++++++++++++++ scripts/build-win32.sh | 4 +++- scripts/common.sh | 5 ++++- scripts/mkdeb.sh | 10 ++++++++++ scripts/mktar-win32.sh | 3 +-- scripts/mktar.sh | 12 ------------ scripts/ugit.desktop | 11 +++++++++++ scripts/wscript | 2 ++ ugit/git-ugit | 16 +++++++--------- wscript | 4 +++- 17 files changed, 153 insertions(+), 26 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/docs create mode 100755 debian/rules create mode 100755 scripts/mkdeb.sh create mode 100644 scripts/ugit.desktop diff --git a/.gitignore b/.gitignore index 28604d6..ef4f0f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,12 @@ +*.deb *.pyc *.pyo +*.rpm *.swp *~ +/debian/files +/debian/bld +/debian/ugit /installroot /.lock-wscript /obj diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..3f373c5 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,10 @@ +ugit (0.8.13-1) unstable; urgency=low + + * Debianized on 04/14/2008 + + ugit's debian/rules file skips the configure and build targets. + The install target configures, builds and installs for both + Python 2.4 and 2.5. + + -- David Aguilar Sun, 13 Apr 2008 18:28:41 -0700 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..12706b1 --- /dev/null +++ b/debian/control @@ -0,0 +1,11 @@ +Source: ugit +Section: devel +Priority: extra +Maintainer: David Aguilar +Build-Depends: debhelper (>= 5), python2.4, python2.5, gettext, pyqt4-dev-tools +Standards-Version: 3.7.2 + +Package: ugit +Architecture: all +Depends: python (>= 2.4), python-qt4 (>= 4.3), git-core (>= 1.5) +Description: ugit: the pythonic git gui diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..9a6df0e --- /dev/null +++ b/debian/copyright @@ -0,0 +1,34 @@ +This package was debianized by David Aguilar on +Sun, 13 Apr 2008 18:28:41 -0700. + +It was downloaded from http://ugit.sf.net/releases + +Upstream Author(s): + + David Aguilar + +Copyright: + + Copyright (C) 2008 David Aguilar + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2008, David Aguilar and +is licensed under the GPL, see above. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..db80c5d --- /dev/null +++ b/debian/dirs @@ -0,0 +1,5 @@ +usr/bin +usr/share/applications +usr/share/ugit +usr/share/ugit/controllers +usr/share/ugit/views diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e69de29 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..a10569a --- /dev/null +++ b/debian/rules @@ -0,0 +1,46 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# We run configure + make install twice: +# once for every supported Python version +configure: configure-stamp +configure-stamp: + ./configure \ + --prefix=/usr \ + --blddir=$(CURDIR)/debian/bld \ + --destdir=$(CURDIR)/debian/ugit + +build: build-stamp +build-stamp: configure-stamp + $(MAKE) + +clean: + dh_testdir + dh_testroot + dh_clean + +install: build + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) DESTDIR=$(CURDIR)/debian/ugit install + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep +.PHONY: build clean binary-indep binary install configure diff --git a/scripts/build-win32.sh b/scripts/build-win32.sh index 3510de8..d435f8f 100755 --- a/scripts/build-win32.sh +++ b/scripts/build-win32.sh @@ -6,10 +6,12 @@ BINDIR=$PREFIX/bin DOCDIR=$PREFIX/share/doc/ugit try_python /usr/bin/python2.5 "$PREFIX" -mkdir -p $DOCDIR + # no symlinks on win32 rm -f $BINDIR/bin/ugit cp scripts/py2exe-* $BINDIR cp scripts/ugit-win32.sh $BINDIR + +mkdir -p $DOCDIR cp README $DOCDIR/README.txt diff --git a/scripts/common.sh b/scripts/common.sh index 60274e4..635f229 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -17,7 +17,10 @@ waf_restore() try_python() { waf_backup - env PYTHON="$1" ./configure --prefix="$2" --blddir="$PWD/tmp.$$" && + env PYTHON="$1" \ + ./configure \ + --prefix="$2" \ + --blddir="$PWD/tmp.$$" && make && make install status=$? diff --git a/scripts/mkdeb.sh b/scripts/mkdeb.sh new file mode 100755 index 0000000..c9aa744 --- /dev/null +++ b/scripts/mkdeb.sh @@ -0,0 +1,10 @@ +#!/bin/sh +. $(dirname $0)/common.sh +waf_backup + dpkg-buildpackage -A +waf_restore + +rm -rf debian/bld +rm -rf debian/ugit +rm ../ugit_*.changes +mv ../ugit_*.deb . diff --git a/scripts/mktar-win32.sh b/scripts/mktar-win32.sh index 755a974..bfded58 100755 --- a/scripts/mktar-win32.sh +++ b/scripts/mktar-win32.sh @@ -1,6 +1,5 @@ #!/bin/sh -cd $(dirname $0) -cd .. +. $(dirname $0)/common.sh VERSION=$(scripts/version.sh) BASENAME=ugit-win32-$VERSION diff --git a/scripts/mktar.sh b/scripts/mktar.sh index 97bb1a0..d31acd5 100755 --- a/scripts/mktar.sh +++ b/scripts/mktar.sh @@ -10,18 +10,6 @@ fi try_python "$(which python)" "$DIR" -find $DIR -name '*.py[co]' | xargs rm -PYTHONVER=$(python -c 'import sys; sys.stdout.write(sys.version[:3])') - -( - cd $DIR/lib; - for i in 2.4 2.5; do - if [ ! -e python$i ]; then - ln -s python$PYTHONVER python$i - fi - done -) - rsync -avr $DIR/ $BASENAME/ && tar czf $FILE $BASENAME/ && rm -rf $DIR $BASENAME diff --git a/scripts/ugit.desktop b/scripts/ugit.desktop new file mode 100644 index 0000000..5c50f6f --- /dev/null +++ b/scripts/ugit.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=ugit +Comment=ugit: the pythonic git gui +Exec=git ugit +Icon=/usr/share/ugit/icons/git.png +StartupNotify=true +Terminal=false +Type=Application +Categories=Development +X-KDE-SubstituteUID=false diff --git a/scripts/wscript b/scripts/wscript index dc9e54f..829672a 100644 --- a/scripts/wscript +++ b/scripts/wscript @@ -18,3 +18,5 @@ def build(bld): vgen.stdin = 'gitversion.sh' vgen.stdout = 'version.py' vgen.install = gen_install('../scripts/version.py') + + Common.install_files('UGIT_APPS', '', 'ugit.desktop') diff --git a/ugit/git-ugit b/ugit/git-ugit index 3b5757e..6faad9c 100755 --- a/ugit/git-ugit +++ b/ugit/git-ugit @@ -5,23 +5,21 @@ import os import sys import platform import optparse +from os.path import join +from os.path import dirname def setup_environment(): """Prepends sys.path with ugit's module path.""" version = platform.python_version() try: thisfile = os.path.realpath(__file__) - sys.path.insert(0, os.path.dirname(os.path.dirname(thisfile))) - sys.path.insert(0, os.path.join( - os.path.dirname(os.path.dirname(thisfile)), - 'lib', 'python' + version[:3], - 'site-packages')) - - ugitmodules = os.path.dirname(thisfile) - if ugitmodules not in sys.path: - sys.path.insert(0, os.path.dirname(thisfile)) + rootdir = dirname(dirname(thisfile)) + sys.path.insert(0, join(rootdir, 'share')) except: + rootdir = dirname(os.getcwd()) sys.path.insert(0, os.getcwd()) + sys.path.insert(0, rootdir) + sys.path.insert(0, join(rootdir, 'share')) def ugit_main(): try: diff --git a/wscript b/wscript index a1d2033..b9e1bea 100644 --- a/wscript +++ b/wscript @@ -42,17 +42,19 @@ def configure(conf): env = conf.env prefix = env['PREFIX'] bindir = join(prefix, 'bin') - sitepackages = pymod(env) + sitepackages = join(prefix, 'share') modules = join(sitepackages, 'ugit') views = join(modules, 'views') controllers = join(modules, 'controllers') icons = join(prefix, 'share', 'ugit', 'icons') + apps = join(prefix, 'share', 'applications') env['UGIT_BINDIR'] = bindir env['UGIT_MODULES'] = modules env['UGIT_VIEWS'] = views env['UGIT_CONTROLLERS'] = controllers env['UGIT_ICONS'] = icons + env['UGIT_APPS'] = apps ############################################################################# -- 2.11.4.GIT