Added BSD-like license.
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 27 Jul 2004 10:25:52 +0000 (10:25 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 27 Jul 2004 10:25:52 +0000 (10:25 +0000)
Support building Windows installer from Unix.

Wrote postinstall script for the Windows installer. Shortcuts are
created in the start menu and on the desktop.

Wrote a small README.txt.

COPYING.txt [new file with mode: 0644]
MANIFEST.in [new file with mode: 0644]
Makefile
README.txt [new file with mode: 0644]
setup.py
src/gkofoto/glade/gkofoto.glade
src/gkofoto/scripts/gkofoto-windows-postinstall.py [new file with mode: 0644]
src/lib/kofoto/version.py

diff --git a/COPYING.txt b/COPYING.txt
new file mode 100644 (file)
index 0000000..b4519d9
--- /dev/null
@@ -0,0 +1,28 @@
+Copyright (c) Joel Rosdahl and Ulrik Svensson
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of the copyright holders nor the names of
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644 (file)
index 0000000..af67e56
--- /dev/null
@@ -0,0 +1,6 @@
+include COPYING.txt
+include doc/overview.txt
+include src/gkofoto/glade/*.glade
+include src/gkofoto/icons/*.png
+include src/gkofoto/start
+prune src/web
index 5c5c88f..c55ad67 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,13 +8,21 @@ help:
 
 clean:
        $(MAKE) -C src/web clean
-       rm -rf build
+       rm -rf build dist
        find . \( -name '*~' -o -name '.*~' -o -name '.#*' -o -name '*.pyc' \
                  -o -name '*.orig' -o -name '*.bak' -o -name '*.rej' \
+                  -o -name MANIFEST \
               \) -exec rm -f {} \;
 
 install:
-       python setup.py install --prefix=$(PREFIX)
+       ./setup.py install --prefix=$(PREFIX)
+
+dist:
+       ./setup.py sdist --formats=gztar,zip
+       ./setup.py bdist --formats=gztar,rpm
+       ./setup.py windows bdist_wininst --install-script gkofoto-windows-postinstall.py
 
 check:
        python src/test/alltests.py
+
+.PHONY: help clean install dist check
diff --git a/README.txt b/README.txt
new file mode 100644 (file)
index 0000000..0b8795a
--- /dev/null
@@ -0,0 +1,143 @@
+ _  __      __       _
+| |/ /___  / _| ___ | |_ ___
+| ' // _ \| |_ / _ \| __/ _ \
+| . \ (_) |  _| (_) | || (_) |
+|_|\_\___/|_|  \___/ \__\___/
+
+
+OVERVIEW
+========
+
+Kofoto is a tool for viewing and organizing images.
+
+Actually, Kofoto is a framework with a backend and (currently) two
+frontends:
+
+  * A graphical GTK+-based client (gkofoto).
+  * A command-line utility (kofoto).
+
+With the clients you can:
+
+  * Organize images in an album tree.
+  * Organize images by use of categories.
+  * Associate images with attributes.
+  * Search for images matching a search expression.
+
+With the graphical client you can also:
+
+  * View images.
+  * Rotate images (by use of an external command-line program, e.g.
+    jpegtran).
+  * Open images in an external program (e.g. The GIMP).
+
+With the command-line client you can also:
+
+  * Generate HTML pages of an album subtree.
+
+See also the file overview.txt in the doc subdirectory.
+
+LICENSE
+=======
+
+See COPYING.txt. The license is a BSD-like open source license (see
+http://www.opensource.org).
+
+
+CONTACT
+=======
+
+Email: kofoto@rosdahl.net
+Web page: http://kofoto.rosdahl.net
+Source repository: http://svn.rosdahl.net/kofoto/kofoto
+
+
+INSTALLATION
+============
+
+A. Unix
+-------
+
+   Prerequisites
+   -------------
+
+   Kofoto depends on the following third-party softwares:
+
+     * Python 2.3 or newer. Found at:
+
+           http://www.python.org
+
+     * GTK+ 2.2. Found at:
+
+           http://www.pygtk.org
+
+     * PyGTK for GTK+ 2.2. Found at:
+
+           http://www.pygtk.org
+
+     * Python Imaging Library. Found at:
+
+           http://www.pythonware.com/products/pil/
+
+     * PySQLite. Found at:
+
+           http://pysqlite.sourceforge.net
+
+   On a Debian GNU/Linux machine, installing the packages python-gtk2,
+   python-imaging and python-sqlite should do.
+
+
+   Installing and running Kofoto
+   -----------------------------
+
+   0. Install the prerequisites, if necessary.
+   1. Unpack the kofoto-*.tar.gz archive.
+   2. Run "python setup.py install" in the created directory to
+      install Kofoto at the default location (e.g. /usr/local). See
+      http://www.python.org/doc/current/inst/inst.html for more
+      information.
+   3. Run gkofoto or "kofoto --help".
+
+
+B. Windows
+----------
+
+   Prerequisites
+   -------------
+
+   Kofoto depends on the following third-party softwares:
+
+     * Python 2.3 or newer. Found at:
+
+           http://www.python.org
+
+     * GTK+ 2.2 for Windows. Found at:
+
+            http://www.dropline.net/gtk/
+
+     * PyGTK for GTK+ 2.2 for Windows. Found at:
+
+            http://www.mapr.ucl.ac.be/~gustin/win32_ports/pygtk.html
+
+     * Python Imaging Library. Found at:
+
+           http://www.pythonware.com/products/pil/
+
+     * PySQLite. Found at:
+
+           http://pysqlite.sourceforge.net
+
+
+   Installing and running Kofoto
+   -----------------------------
+
+   0. Install the prerequisites, if necessary.
+   1. Run the kofoto-*.win32.exe Windows installer and complete the
+      wizard.
+   2. Double-click the Kofoto shortcut at the desktop or in the start
+      menu.
+
+
+VERSION HISTORY
+===============
+
+To be written.
index 5ac2a65..2a2bdd5 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -1,8 +1,16 @@
 #! /usr/bin/env python
 
 from distutils.core import setup
-import shutil
+import glob
 import os
+import shutil
+import sys
+
+if sys.argv[1] == "windows":
+    windows_mode = True
+    del sys.argv[1]
+else:
+    windows_mode = False
 
 package_dir = {
     "kofoto": "src/lib/kofoto",
@@ -15,57 +23,41 @@ packages = [
     ]
 data_files = [
     ("share/gkofoto/glade", ["src/gkofoto/glade/gkofoto.glade"]),
-    ("share/gkofoto/icons", ["src/gkofoto/icons/about-icon.png",
-                             "src/gkofoto/icons/album.png",
-                             "src/gkofoto/icons/fullscreen-24.png",
-                             "src/gkofoto/icons/objectview.png",
-                             "src/gkofoto/icons/rotateleft.png",
-                             "src/gkofoto/icons/rotateright.png",
-                             "src/gkofoto/icons/tableview.png",
-                             "src/gkofoto/icons/thumbnailsview.png",
-                             "src/gkofoto/icons/unknownimage.png"])
+    ("share/gkofoto/icons", glob.glob("src/gkofoto/icons/*.png")),
     ]
 
-if os.name == "posix":
-    shutil.copy("src/gkofoto/start", "src/gkofoto/gkofoto")
+if windows_mode:
+    shutil.copy("src/gkofoto/start", "src/gkofoto/gkofoto-start.pyw")
     scripts = [
-        "src/cmdline/renameimage",
         "src/cmdline/kofoto",
-        "src/cmdline/kofoto-upload",
-        "src/gkofoto/gkofoto",
+        "src/gkofoto/gkofoto-start.pyw",
+        "src/gkofoto/scripts/gkofoto-windows-postinstall.py",
         ]
-    if os.system("cd src/web && make") != 0:
-        import sys
-        sys.exit(1)
-    package_dir["kofotoweb"] = "src/web/kofotoweb"
-    packages.append("kofotoweb")
-    scripts.append("src/web/webkofoto")
-    data_files.append(("share/kofotoweb/static", [
-        "src/web/static/webkofoto.css",
-        ]))
 else:
-    shutil.copy("src/gkofoto/start", "src/gkofoto/gkofoto-start.pyw")
+    shutil.copy("src/gkofoto/start", "src/gkofoto/gkofoto")
     scripts = [
         "src/cmdline/kofoto",
-        "src/gkofoto/gkofoto-start.pyw",
+        "src/cmdline/kofoto-upload",
+        "src/gkofoto/gkofoto",
         ]
 
 versionDict = {}
 execfile("src/lib/kofoto/version.py", versionDict)
 
 setup(
-    windows=["src/gkofoto/gkofoto-start.pyw"],
     name="kofoto",
     version=versionDict["version"],
+    description="A tool for organizing and viewing images.",
     package_dir=package_dir,
     packages=packages,
     scripts=scripts,
     data_files=data_files,
     author="Joel Rosdahl and Ulrik Svensson",
     author_email="kofoto@rosdahl.net",
-    url="http://svn.rosdahl.net/kofoto/kofoto/")
+    url="http://svn.rosdahl.net/kofoto/kofoto/",
+    )
 
-if os.name == "posix":
-    os.unlink("src/gkofoto/gkofoto")
-else:
+if windows_mode:
     os.unlink("src/gkofoto/gkofoto-start.pyw")
+else:
+    os.unlink("src/gkofoto/gkofoto")
index 772c683..6e9f520 100644 (file)
@@ -2011,7 +2011,7 @@ The categories' children will not be destroyed, nor will the images associated w
          <child>
            <widget class="GtkLabel" id="label37">
              <property name="visible">True</property>
-             <property name="label" translatable="yes">An image categorization tool.</property>
+             <property name="label" translatable="yes">A tool for organizing and viewing images.</property>
              <property name="use_underline">False</property>
              <property name="use_markup">True</property>
              <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -2032,7 +2032,7 @@ The categories' children will not be destroyed, nor will the images associated w
          <child>
            <widget class="GtkLabel" id="label38">
              <property name="visible">True</property>
-             <property name="label" translatable="yes">&lt;span size=&quot;small&quot;&gt;Copyright © 2002-2004 Joel Rosdahl and Ulrik Svensson&lt;/span&gt;</property>
+             <property name="label" translatable="yes">&lt;span size=&quot;small&quot;&gt;Copyright © Joel Rosdahl and Ulrik Svensson&lt;/span&gt;</property>
              <property name="use_underline">False</property>
              <property name="use_markup">True</property>
              <property name="justify">GTK_JUSTIFY_LEFT</property>
diff --git a/src/gkofoto/scripts/gkofoto-windows-postinstall.py b/src/gkofoto/scripts/gkofoto-windows-postinstall.py
new file mode 100644 (file)
index 0000000..a321098
--- /dev/null
@@ -0,0 +1,40 @@
+import sys
+
+if sys.platform[:3] != "win":
+    sys.exit()
+
+if sys.argv[1] == "-install":
+    import distutils.sysconfig
+    import os
+    import shutil
+
+    target = os.path.join(
+        distutils.sysconfig.PREFIX,
+        "Scripts",
+        "gkofoto-start.pyw")
+
+    try:
+        programs_dir = get_special_folder_path("CSIDL_COMMON_PROGRAMS")
+    except OSError:
+        try:
+            programs_dir = get_special_folder_path("CSIDL_PROGRAMS")
+        except OSError, reason:
+            print "Couldn't install shortcuts: %s" % reason
+            sys.exit()
+    programs_shortcut = os.path.join(programs_dir, "Kofoto.lnk")
+    create_shortcut(target, "Kofoto", programs_shortcut)
+    file_created(programs_shortcut)
+
+    try:
+        desktop_dir = get_special_folder_path("CSIDL_COMMON_DESKTOPDIRECTORY")
+    except OSError:
+        try:
+            desktop_dir = get_special_folder_path("CSIDL_DESKTOPDIRECTORY")
+        except OSError, reason:
+            print "Couldn't install shortcuts: %s" % reason
+            sys.exit()
+    desktop_shortcut = os.path.join(desktop_dir, "Kofoto.lnk")
+    create_shortcut(target, "Kofoto", desktop_shortcut)
+    file_created(desktop_shortcut)
+
+    print "Created Kofoto shortcut on the Desktop and in the Start menu."
index 90bc179..10ba80d 100644 (file)
@@ -1 +1 @@
-version = "pre-0.1"
+version = "pre0.1"