From a4dcaf0f4c57288b8252972ecb80d59f39bf4b78 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Mon, 1 Mar 2010 16:01:23 +0100 Subject: [PATCH] Added .bat files to test and build under Windows systems; adjusted ignore, setup and Makefiles for this platform. --- .gitignore | 1 + Makefile | 2 +- dist.bat | 20 ++++++++++++++++++++ setup.py | 12 ++++++++---- test.bat | 18 ++++++++++++++++++ 5 files changed, 48 insertions(+), 5 deletions(-) create mode 100755 dist.bat create mode 100755 test.bat diff --git a/.gitignore b/.gitignore index 899daba..082980b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.pyc *.pyo /build +/dist diff --git a/Makefile b/Makefile index 7e37bf1..082c9b7 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ count: clean: find . -name \*.pyc -delete find . -name \*.pyo -delete - rm -rf build + rm -rf build dist .PHONY: test test: diff --git a/dist.bat b/dist.bat new file mode 100755 index 0000000..6463a87 --- /dev/null +++ b/dist.bat @@ -0,0 +1,20 @@ +:: Create patool Windows distribution file +:: Copyright (C) 2010 Bastian Kleineidam +:: This program 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 3 of the License, or +:: (at your option) any later version. +:: +:: This program 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 program. If not, see . +@echo off +set PYDIR=c:\python26 +rd build /s /q +rd dist /s /q +%PYDIR%\python.exe setup.py bdist_wininst +pause diff --git a/setup.py b/setup.py index 38321e0..ab2fc20 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ import sys if not (hasattr(sys, 'version_info') or sys.version_info < (2, 5, 0, 'final', 0)): raise SystemExit("This program requires Python 2.5 or later.") - +import os from distutils.core import setup AppName = "patool" @@ -30,6 +30,12 @@ AppVersion = "0.3" MyName = "Bastian Kleineidam" MyEmail = "calvin@users.sourceforge.net" +data_files = [] +if os.name == 'nt': + data_files.append(('share', ['doc/patool.txt'])) +else: + data_files.append(('share/man/man1', ['doc/patool.1'])) + setup ( name = AppName, version = AppVersion, @@ -40,8 +46,6 @@ setup ( maintainer_email = MyEmail, license = "GPL", packages = ['patoolib', 'patoolib.programs'], - data_files = [ - ('share/man/man1', ['doc/patool.1']), - ], + data_files = data_files, scripts = ['patool'], ) diff --git a/test.bat b/test.bat new file mode 100755 index 0000000..b5178d9 --- /dev/null +++ b/test.bat @@ -0,0 +1,18 @@ +:: Run patool test suite +:: Copyright (C) 2010 Bastian Kleineidam +:: This program 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 3 of the License, or +:: (at your option) any later version. +:: +:: This program 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 program. If not, see . +@echo off +set PYDIR=C:\Python26 +%PYDIR%\python.exe %PYDIR%\scripts\nosetests -v -m "^test_.*" tests/ +@pause