Skip to content
Browse files

Improve installation of extra data files

  • Loading branch information...
1 parent 1fbecac commit 92b20da8d76c186e8ecf30ab59eedb79dbfb4651 @takluyver takluyver committed Sep 26, 2012
Showing with 41 additions and 21 deletions.
  1. +10 −21 README.rst
  2. +18 −0 install_data_files.sh
  3. +13 −0 po/Makefile
View
31 README.rst
@@ -37,19 +37,14 @@ as you please.
Requirements
------------
-I don't really know what the exact requirements are. In the configure script,
-the following are checked:
+* Python >= 2.6
+* gtk+
+* pygtk
+* pygobject
+* pycairo
-* Python >= 2.6
-* gtk+ >= 2.8
-* pygtk-2.0 >= 2.8
-* pygobject-2.0 >= 2.10
-* pycairo >= 1.0
-
-which probably means (to compile) you need the ``-dev`` versions of all these
-(except Python). Note that although these are checked, it may work with
-previous versions. If it does, please let us know and the configure script
-can be adapted accordingly.
+The minimum required versions are unknown, but any reasonably recent packages
+should work.
How to use it
-------------
@@ -58,15 +53,9 @@ From the top directory of the package, run the command::
./labyrinth
-It can also be installed using the ./configure && make dance thus::
-
- ./configure --prefix=<prefix_to_use>
- make
- make install
-
-and run with::
-
- labyrinth
+You can also install Labyrinth with ``python setup.py install``, and
+``./install_data_files.sh`` for icons and translations. It can then be run as
+``labyrinth``.
This will open a browser window, showing you all the maps currently available
and allow you to modify / delete them and create new maps. The title is
View
18 install_data_files.sh
@@ -0,0 +1,18 @@
+# Run this to install Labyrinth's optional data files - language packs, icons,
+# and the .desktop file.
+#
+# Set the $DESTDIR environment variable to install somewhere other than root.
+set -e
+
+echo "Installing icons"
+for size in 16x16 22x22 24x24 scalable; do install -d $DESTDIR/usr/share/icons/hicolor/$size/apps; done
+install -m 644 data/labyrinth-16.png $DESTDIR/usr/share/icons/hicolor/16x16/apps/labyrinth.png
+install -m 644 data/labyrinth-22.png $DESTDIR/usr/share/icons/hicolor/22x22/apps/labyrinth.png
+install -m 644 data/labyrinth-24.png $DESTDIR/usr/share/icons/hicolor/24x24/apps/labyrinth.png
+install -m 644 data/labyrinth.svg $DESTDIR/usr/share/icons/hicolor/scalable/apps/labyrinth.svg
+
+echo "Installing .desktop file"
+install -D -m 755 data/labyrinth.desktop $DESTDIR/usr/share/applications/labyrinth.desktop
+
+echo "Installing translations"
+make -C po localedir=$DESTDIR/usr/share/locale install
View
13 po/Makefile
@@ -1,11 +1,20 @@
LANGS=ca cs de es eu fa fr it nl pl pt_BR pt_PT ru sv zh_CN
+LANG_FOLDERS:=$(addprefix $(localedir)/,$(LANGS))
+INST_MO:=$(addsuffix /LC_MESSAGES/labyrinth.mo,$(LANG_FOLDERS))
+
# Translate to binary message format
%.mo: %.po
msgfmt -o $@ $<
all-mo: $(LANGS:%=%.mo)
+# The installation rule
+$(localedir)/%/LC_MESSAGES/labyrinth.mo : %.mo
+ install -D -m 644 $< $@
+
+install: all-mo $(INST_MO)
+
labyrinth.pot:
xgettext --language=Python --keyword=_ --output=$@ `find ../labyrinth_lib -name "*.py"`
xgettext --output=$@ --join-existing ../data/labyrinth.glade
@@ -33,3 +42,7 @@ update-%-po:
fi; \
update-po: labyrinth.pot $(LANGS:%=update-%-po)
+
+clean:
+ rm -rf *.mo
+ rm -rf *.new.po

0 comments on commit 92b20da

Please sign in to comment.
Something went wrong with that request. Please try again.