diff --git a/ChangeLog b/ChangeLog index b9b0846..5a56141 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +******************************* +* Version 0.4.1 (Nov 2014) * +******************************* ++ packaging support for Python/Arch Linux {Nick} +! calmagick: fixed bug regarding --min-size being greater than --max-size +* refactored some common code between callirhoe and calmagick + ******************************* * Version 0.4.0 (Oct 2014) * ******************************* diff --git a/INSTALL b/INSTALL index 48e6eb9..f803dd8 100644 --- a/INSTALL +++ b/INSTALL @@ -9,7 +9,8 @@ QUICK INSTALLATION GUIDE CONTENTS 1) FROM COMPRESSED ARCHIVE 2) FROM SVN - 3) INSTALLATION FOR ARCH LINUX + 3) INVOKING callirhoe FROM PATH + 4) INSTALLATION FOR ARCH LINUX (rough installation guide for novice users...) @@ -31,13 +32,7 @@ Now you can launch the program, e.g. $ ./callirhoe.py foo.pdf -You may want to add a link to your path, $HOME/bin or /usr/local/bin: - -$ ln -s `pwd`/callirhoe.py $HOME/bin/callirhoe - -You can do the same with calmagick.py. You may also install it system-wide, -for example in /opt. In this case, keep in mind, that ~/.callirhoe/ is also -searched for additional definitions, styles etc. +See section 3 for how to install callirhoe so that it lies in your executable path. 2) FROM SVN @@ -57,11 +52,40 @@ You can launch the program as usual: $ ./callirhoe.py foo.pdf -3) INSTALLATION FOR ARCH LINUX +3) INVOKING callirhoe FROM PATH + +You can add a link to your path, $HOME/bin or /usr/local/bin: + +$ ln -s `pwd`/callirhoe.py $HOME/bin/callirhoe + +You can do the same with calmagick.py. You may also install it system-wide, +for example in /opt. In this case, keep in mind, that ~/.callirhoe/ is also +searched for additional definitions, styles etc. + +If you do not plan to mess with the source, you make create a binary python package. +This is not exactly a binary, it is a zip archive containing compiled python bytecode, +which is quite compact. To do so, go to the scripts directory: + +$ cd scripts + +and run + +$ ./make_pkg + +This will create in the parent directory two executables, 'callirhoe' and 'calmagick'. +Now copy them to your binary path. And you can remove the source dir, as it is no longer +needed. You might want to copy the holiday data files first, if you want to use them +(callirhoe takes a full path to them, so you can store them wherever you want). + +On a linux system, you will additionally see a Makefile created, which you can alternatively +run with 'make install' to install the files in the standard places, +instead of manually copying them. + +4) INSTALLATION FOR ARCH LINUX There is a PKGBUILD file you can use to install. You can get the PKGBUILD either from SVN or compressed archive or from AUR. -For the first two options the method to get the source tree is described above, +For the first two options, the method to get the source tree is described in sections 1 and 2, while for the third option you can get it from here: diff --git a/scripts/make_pkg b/scripts/make_pkg index 7189b17..3b8e549 100755 --- a/scripts/make_pkg +++ b/scripts/make_pkg @@ -1,8 +1,6 @@ #!/bin/bash -set -e -cd .. -make_archive() { +make_python_zip() { base="$1" tempdir="$2" curdir=`pwd` @@ -19,28 +17,38 @@ make_archive() { rm -f $base.zip } +create_callirhoe_package() { + DIR=`mktemp -d -t callirhoe.XXX` + tar c {geom,lang,layouts,lib,style}/*.py | tar x -C "$DIR" + cp callirhoe.py "$DIR/__main__.py" + python2.7 scripts/make_resources_list.py > "$DIR/lib/resources.py" -# Create Callirhoe package -DIR=`mktemp -d -t callirhoe.XXX` -tar c {geom,lang,layouts,lib,style}/*.py | tar x -C "$DIR" + make_python_zip callirhoe "$DIR" +} -cp callirhoe.py "$DIR/__main__.py" -scripts/make_resources_list > "$DIR/lib/resources.py" +create_calmagick_package() { + # Create Calmagick package + DIR=`mktemp -d -t callirhoe.XXX` + tar c lib/{__init__,geom}.py | tar x -C "$DIR" + cp calmagick.py "$DIR/__main__.py" + + make_python_zip calmagick "$DIR" +} -make_archive callirhoe "$DIR" - -# Create Calmagick package -DIR=`mktemp -d -t callirhoe.XXX` -tar c lib/{__init__,geom}.py | tar x -C "$DIR" -cp calmagick.py "$DIR/__main__.py" - -make_archive calmagick "$DIR" - -# Create Makefile -cat << END > Makefile +create_makefile() { + cat << END > Makefile install: install -Dm755 callirhoe \$(DESTDIR)/bin/callirhoe install -Dm755 calmagick \$(DESTDIR)/bin/calmagick END -find holidays/* -printf "\tinstall -Dm644 %p \$(DESTDIR)/share/callirhoe/%p\n" >> Makefile + find holidays/* -printf "\tinstall -Dm644 %p \$(DESTDIR)/share/callirhoe/%p\n" >> Makefile +} + +set -e +cd .. + +create_callirhoe_package +create_calmagick_package + +[[ "`uname`" != "Darwin" ]] && create_makefile diff --git a/scripts/make_resources_list b/scripts/make_resources_list.py similarity index 100% rename from scripts/make_resources_list rename to scripts/make_resources_list.py