[d-feet] Use autotools for d-feet
- From: Thomas Bechtold <toabctl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [d-feet] Use autotools for d-feet
- Date: Tue, 14 May 2013 15:28:07 +0000 (UTC)
commit 1363e987ea6bab056470f963cf9d3dd74c5baaf2
Author: Thomas Bechtold <thomasbechtold jpberlin de>
Date: Sun May 12 22:36:47 2013 +0200
Use autotools for d-feet
MANIFEST.in | 7 -
Makefile.am | 10 ++
autogen.sh | 20 ++++
configure.ac | 47 ++++++++
d-feet | 54 ---------
data/Makefile.am | 27 +++++
data/d-feet.desktop.in.in | 11 ++
data/icons/Makefile.am | 53 +++++++++
.../icons}/hicolor/16x16/apps/d-feet.png | Bin 1002 -> 1002 bytes
.../16x16/apps/dfeet-icon-default-service.png | Bin 652 -> 652 bytes
.../hicolor/16x16/apps/dfeet-method-category.png | Bin 505 -> 505 bytes
.../icons}/hicolor/16x16/apps/dfeet-method.png | Bin 459 -> 459 bytes
.../icons}/hicolor/16x16/apps/dfeet-object.png | Bin 702 -> 702 bytes
.../hicolor/16x16/apps/dfeet-property-category.png | Bin 427 -> 427 bytes
.../icons}/hicolor/16x16/apps/dfeet-property.png | Bin 330 -> 330 bytes
.../hicolor/16x16/apps/dfeet-signal-category.png | Bin 474 -> 474 bytes
.../icons}/hicolor/16x16/apps/dfeet-signal.png | Bin 400 -> 400 bytes
.../icons}/hicolor/24x24/apps/d-feet.png | Bin 1522 -> 1522 bytes
.../icons}/hicolor/256x256/apps/d-feet.png | Bin 39476 -> 39476 bytes
.../icons}/hicolor/32x32/apps/d-feet.png | Bin 2443 -> 2443 bytes
.../icons}/hicolor/48x48/apps/d-feet.png | Bin 4393 -> 4393 bytes
.../icons}/hicolor/scalable/apps/d-feet.svg | 0
.../icons}/hicolor/src/object-catagories-boxed.svg | 0
.../hicolor/src/object-catagories-centered.svg | 0
{icons => data/icons}/hicolor/src/object.svg | 0
data/org.gnome.d-feet.gschema.xml | 4 +
data/ui/Makefile.am | 14 +++
{ui => data/ui}/addconnectiondialog.ui | 0
{ui => data/ui}/buswatch.ui | 0
{ui => data/ui}/executedialog.ui | 0
{ui => data/ui}/introspection.ui | 0
{ui => data/ui}/mainwindow.ui | 0
dfeet/_ui/__init__.py | 2 -
po/POTFILES.in | 3 +
setup.cfg | 6 -
setup.py | 117 --------------------
src/Makefile.am | 29 +++++
{dfeet => src}/__init__.py | 0
src/d-feet.in | 55 +++++++++
src/dfeet/Makefile.am | 15 +++
{dfeet/_ui => src/dfeet}/addconnectiondialog.py | 2 +-
dfeet/DFeetApp.py => src/dfeet/application.py | 11 +-
{dfeet => src/dfeet}/bus_watch.py | 2 +-
{dfeet => src/dfeet}/dbus_utils.py | 0
{dfeet/_ui => src/dfeet}/executemethoddialog.py | 2 +-
{dfeet => src/dfeet}/introspection.py | 4 +-
{dfeet => src/dfeet}/introspection_helper.py | 0
{dfeet => src/dfeet}/settings.py | 0
{dfeet/_ui => src/dfeet}/uiloader.py | 0
{dfeet/_ui => src/dfeet}/wnck_utils.py | 0
{tests => src/tests}/tests.py | 0
ui/dfeet.desktop | 11 --
52 files changed, 300 insertions(+), 206 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..9db6e3e
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,10 @@
+SUBDIRS = po src data help
+
+EXTRA_DIST = \
+ autogen.sh \
+ COPYING \
+ NEWS
+
+DISTCLEANFILES = intltool-extract \
+ intltool-merge \
+ intltool-update
\ No newline at end of file
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..39ed4f7
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+PKG_NAME="d-feet"
+
+(test -f $srcdir/src/dfeet/application.py) || {
+ echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+ echo " top-level $PKG_NAME directory"
+ exit 1
+ }
+
+ which gnome-autogen.sh || {
+ echo "You need to install gnome-common."
+ exit 1
+ }
+
+ . gnome-autogen.sh
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..d71f32e
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,47 @@
+AC_PREREQ([2.64])
+AC_INIT([d-feet],
+ [0.3.5],
+ [http://bugzilla.gnome.org/enter_bug.cgi?product=d-feet],
+ [d-feet],
+ [http://live.gnome.org/DFeet])
+
+AM_INIT_AUTOMAKE([1.11 -Wall foreign no-define tar-ustar no-dist-gzip dist-xz])
+
+GLIB_GSETTINGS
+
+PKG_PROG_PKG_CONFIG
+
+GNOME_COMPILE_WARNINGS([maximum])
+
+YELP_HELP_INIT
+
+AM_PATH_PYTHON([2.7])
+
+PKG_CHECK_MODULES(DFEET, [
+ gtk+-3.0 >= 3.6
+])
+
+
+# i18n stuff
+IT_PROG_INTLTOOL([0.40.0])
+
+AM_GNU_GETTEXT_VERSION([0.17])
+AM_GNU_GETTEXT([external])
+
+GETTEXT_PACKAGE=AC_PACKAGE_NAME
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Package name for gettext])
+
+AC_CONFIG_FILES([
+ Makefile
+ po/Makefile.in
+ src/Makefile
+ src/dfeet/Makefile
+ data/Makefile
+ data/d-feet.desktop.in
+ data/icons/Makefile
+ data/ui/Makefile
+ help/Makefile
+])
+
+AC_OUTPUT
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..6a9ed1d
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,27 @@
+SUBDIRS = icons ui
+
+gsettings_SCHEMAS = org.gnome.d-feet.gschema.xml
+ GSETTINGS_RULES@
+
+ INTLTOOL_DESKTOP_RULE@
+
+desktopdir = $(datadir)/applications
+desktop_in_files = d-feet.desktop.in
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+
+UPDATE_DESKTOP = update-desktop-database $(datadir)/applications || :
+
+install-data-hook:
+ $(UPDATE_DESKTOP)
+uninstall-hook:
+ $(UPDATE_DESKTOP)
+
+EXTRA_DIST = \
+ $(desktop_in_files) \
+ $(gsettings_SCHEMAS)
+
+CLEANFILES = \
+ $(DESKTOP_FILES)
+
+DISTCLEANFILES = \
+ $(desktop_DATA)
diff --git a/data/d-feet.desktop.in.in b/data/d-feet.desktop.in.in
new file mode 100644
index 0000000..790a1dc
--- /dev/null
+++ b/data/d-feet.desktop.in.in
@@ -0,0 +1,11 @@
+[Desktop Entry]
+_Name=D-Feet
+_GenericName=D-Bus Debugger
+_Comment=Debug D-Bus applications
+_Keywords=debug;d-bus;
+Exec= PACKAGE@
+Icon= PACKAGE@
+Terminal=false
+Type=Application
+Categories=GNOME;GTK;Development;Debugger;
+StartupNotify=true
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
new file mode 100644
index 0000000..06fd496
--- /dev/null
+++ b/data/icons/Makefile.am
@@ -0,0 +1,53 @@
+icon16dir = $(datadir)/icons/hicolor/16x16/apps
+icon16_DATA = \
+ hicolor/16x16/apps/d-feet.png \
+ hicolor/16x16/apps/dfeet-method-category.png \
+ hicolor/16x16/apps/dfeet-method.png \
+ hicolor/16x16/apps/dfeet-object.png \
+ hicolor/16x16/apps/dfeet-property-category.png \
+ hicolor/16x16/apps/dfeet-property.png \
+ hicolor/16x16/apps/dfeet-signal-category.png \
+ hicolor/16x16/apps/dfeet-signal.png
+
+icon24dir = $(datadir)/icons/hicolor/24x24/apps
+icon24_DATA = hicolor/24x24/apps/d-feet.png
+
+icon32dir = $(datadir)/icons/hicolor/32x32/apps
+icon32_DATA = hicolor/32x32/apps/d-feet.png
+
+icon48dir = $(datadir)/icons/hicolor/48x48/apps
+icon48_DATA = hicolor/48x48/apps/d-feet.png
+
+#icon64dir = $(datadir)/icons/hicolor/64x64/apps
+#icon64_DATA = hicolor/64x64/apps/d-feet.png
+
+#icon128dir = $(datadir)/icons/hicolor/128x128/apps
+#icon128_DATA = hicolor/128x128/apps/d-feet.png
+
+icon256dir = $(datadir)/icons/hicolor/256x256/apps
+icon256_DATA = hicolor/256x256/apps/d-feet.png
+
+scaleabledir = $(datadir)/icons/hicolor/scaleable/apps
+scaleable_DATA = hicolor/scalable/apps/d-feet.svg
+
+gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
+
+install-data-hook: update-icon-cache
+uninstall-hook: update-icon-cache
+update-icon-cache:
+ @-if test -z "$(DESTDIR)"; then \
+ echo "Updating Gtk icon cache."; \
+ $(gtk_update_icon_cache); \
+ else \
+ echo "*** Icon cache not updated. After (un)install, run this:"; \
+ echo "*** $(gtk_update_icon_cache)"; \
+ fi
+
+EXTRA_DIST = \
+ $(icon16_DATA) \
+ $(icon24_DATA) \
+ $(icon32_DATA) \
+ $(icon48_DATA) \
+ $(icon256_DATA) \
+ $(scaleable_DATA)
+
diff --git a/icons/hicolor/scalable/apps/d-feet.svg b/data/icons/hicolor/scalable/apps/d-feet.svg
similarity index 100%
rename from icons/hicolor/scalable/apps/d-feet.svg
rename to data/icons/hicolor/scalable/apps/d-feet.svg
diff --git a/icons/hicolor/src/object-catagories-boxed.svg
b/data/icons/hicolor/src/object-catagories-boxed.svg
similarity index 100%
rename from icons/hicolor/src/object-catagories-boxed.svg
rename to data/icons/hicolor/src/object-catagories-boxed.svg
diff --git a/icons/hicolor/src/object-catagories-centered.svg
b/data/icons/hicolor/src/object-catagories-centered.svg
similarity index 100%
rename from icons/hicolor/src/object-catagories-centered.svg
rename to data/icons/hicolor/src/object-catagories-centered.svg
diff --git a/icons/hicolor/src/object.svg b/data/icons/hicolor/src/object.svg
similarity index 100%
rename from icons/hicolor/src/object.svg
rename to data/icons/hicolor/src/object.svg
diff --git a/data/org.gnome.d-feet.gschema.xml b/data/org.gnome.d-feet.gschema.xml
new file mode 100644
index 0000000..297cd1f
--- /dev/null
+++ b/data/org.gnome.d-feet.gschema.xml
@@ -0,0 +1,4 @@
+<schemalist gettext-domain="d-feet">
+ <schema id="org.gnome.d-feet" path="/org/gnome/d-feet/">
+ </schema>
+</schemalist>
diff --git a/data/ui/Makefile.am b/data/ui/Makefile.am
new file mode 100644
index 0000000..64f2d27
--- /dev/null
+++ b/data/ui/Makefile.am
@@ -0,0 +1,14 @@
+uidir = $(datadir)/d-feet/ui/
+
+ui_DATA = \
+ addconnectiondialog.ui \
+ buswatch.ui \
+ executedialog.ui \
+ introspection.ui \
+ mainwindow.ui \
+ $(NULL)
+
+EXTRA_DIST = \
+ $(ui_DATA) \
+ $(NULL)
+
diff --git a/ui/addconnectiondialog.ui b/data/ui/addconnectiondialog.ui
similarity index 100%
rename from ui/addconnectiondialog.ui
rename to data/ui/addconnectiondialog.ui
diff --git a/ui/buswatch.ui b/data/ui/buswatch.ui
similarity index 100%
rename from ui/buswatch.ui
rename to data/ui/buswatch.ui
diff --git a/ui/executedialog.ui b/data/ui/executedialog.ui
similarity index 100%
rename from ui/executedialog.ui
rename to data/ui/executedialog.ui
diff --git a/ui/introspection.ui b/data/ui/introspection.ui
similarity index 100%
rename from ui/introspection.ui
rename to data/ui/introspection.ui
diff --git a/ui/mainwindow.ui b/data/ui/mainwindow.ui
similarity index 100%
rename from ui/mainwindow.ui
rename to data/ui/mainwindow.ui
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..59039aa
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,3 @@
+# List of source files containing translatable strings.
+# Please keep this file sorted alphabetically.
+data/d-feet.desktop.in.in
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..6a092db
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,29 @@
+SUBDIRS = dfeet
+
+bin_SCRIPTS = d-feet
+
+# convenience command for doing Makefile variable substitutions in non-Makefile
+# files (scripts, service files, etc.)
+do_subst = sed -e 's|@abs_top_srcdir[ ]|$(abs_top_srcdir)|g' \
+ -e 's|@abs_top_builddir[ ]|$(abs_top_builddir)|g' \
+ -e 's|@localedir[ ]|$(localedir)|g' \
+ -e 's|@bindir[ ]|$(bindir)|g' \
+ -e 's|@libdir[ ]|$(libdir)|g' \
+ -e 's|@libexecdir[ ]|$(libexecdir)|g' \
+ -e 's|@pkglibdir[ ]|$(pkglibdir)|g' \
+ -e 's|@pkgdatadir[ ]|$(pkgdatadir)|g' \
+ -e 's|@pythondir[ ]|$(pythondir)|g' \
+ -e 's|@PACKAGE_NAME[ ]|$(PACKAGE_NAME)|g' \
+ -e 's|@PACKAGE_VERSION[ ]|$(PACKAGE_VERSION)|g' \
+ -e 's|@GETTEXT_PACKAGE[ ]|$(GETTEXT_PACKAGE)|g'
+
+do_substitution = sed -e 's,[ ]pythondir[@],$(pythondir),g' \
+ -e 's,[ ]PACKAGE[@],$(PACKAGE),g' \
+ -e 's,[ ]VERSION[@],$(VERSION),g'
+
+d-feet: d-feet.in
+ $(AM_V_GEN) $(do_subst) $< > $@
+ chmod +x $@
+
+CLEANFILES = $(bin_SCRIPTS)
+EXTRA_DIST = d-feet.in
diff --git a/dfeet/__init__.py b/src/__init__.py
similarity index 100%
rename from dfeet/__init__.py
rename to src/__init__.py
diff --git a/src/d-feet.in b/src/d-feet.in
new file mode 100644
index 0000000..42ef161
--- /dev/null
+++ b/src/d-feet.in
@@ -0,0 +1,55 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# Copyright (C) 2013 Thomas Bechtold <thomasbechtold jpberlin de>
+
+# This file is part of d-feet.
+
+# D-Feet 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.
+
+# D-Feet 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 D-Feet. If not, see <http://www.gnu.org/licenses/>.
+
+
+#import os
+#gi_typelib_path = ["@pkglibdir@/girepository-1.0",]
+#if 'GI_TYPELIB_PATH' in os.environ:
+# gi_typelib_path.append(os.environ['GI_TYPELIB_PATH'])
+#os.environ['GI_TYPELIB_PATH'] = ":".join(gi_typelib_path)
+
+#ld_library_path = ["@pkglibdir@",]
+#if 'LD_LIBRARY_PATH' in os.environ:
+# ld_library_path.append(os.environ['LD_LIBRARY_PATH'])
+#os.environ['LD_LIBRARY_PATH'] = ":".join(ld_library_path)
+
+import os
+import sys
+sys.path.insert(1, '@pythondir@')
+
+import gettext
+from gettext import gettext as _
+gettext.textdomain("@GETTEXT_PACKAGE@")
+
+from gi.repository import Gtk, GObject
+from dfeet.application import DFeetApp
+
+
+if __name__ == "__main__":
+ GObject.threads_init()
+ data_dir = "@pkgdatadir@"
+ #use local paths when debugging
+ if os.getenv("DFEET_DEBUG") is not None:
+ data_dir = os.path.join(os.path.dirname(__file__), "..", "data")
+ Gtk.IconTheme.get_default().prepend_search_path(
+ os.path.join(os.path.dirname(__file__), "..", "data", "icons"))
+ #start the application
+ app = DFeetApp(package="@PACKAGE_NAME@", version="@PACKAGE_VERSION@", data_dir=data_dir)
+ sys.exit(app.run(sys.argv))
diff --git a/src/dfeet/Makefile.am b/src/dfeet/Makefile.am
new file mode 100644
index 0000000..4ed0875
--- /dev/null
+++ b/src/dfeet/Makefile.am
@@ -0,0 +1,15 @@
+dfeet_PYTHON = \
+ __init__.py \
+ application.py \
+ addconnectiondialog.py \
+ bus_watch.py \
+ dbus_utils.py \
+ executemethoddialog.py \
+ introspection_helper.py \
+ introspection.py \
+ settings.py \
+ uiloader.py \
+ wnck_utils.py
+
+
+dfeetdir = $(pythondir)/dfeet
diff --git a/src/dfeet/__init__.py b/src/dfeet/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/dfeet/_ui/addconnectiondialog.py b/src/dfeet/addconnectiondialog.py
similarity index 97%
rename from dfeet/_ui/addconnectiondialog.py
rename to src/dfeet/addconnectiondialog.py
index d42826f..d7c889a 100644
--- a/dfeet/_ui/addconnectiondialog.py
+++ b/src/dfeet/addconnectiondialog.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from gi.repository import Gtk, Gio
-from dfeet._ui.uiloader import UILoader
+from dfeet.uiloader import UILoader
class AddConnectionDialog:
diff --git a/dfeet/DFeetApp.py b/src/dfeet/application.py
similarity index 95%
rename from dfeet/DFeetApp.py
rename to src/dfeet/application.py
index e67f44b..610c640 100644
--- a/dfeet/DFeetApp.py
+++ b/src/dfeet/application.py
@@ -5,9 +5,9 @@ from gi.repository import Gtk, Gio, GObject
from dfeet.bus_watch import BusWatch
from dfeet.settings import Settings
-from dfeet._ui.uiloader import UILoader
-from dfeet._ui.addconnectiondialog import AddConnectionDialog
-from dfeet._ui.executemethoddialog import ExecuteMethodDialog
+from dfeet.uiloader import UILoader
+from dfeet.addconnectiondialog import AddConnectionDialog
+from dfeet.executemethoddialog import ExecuteMethodDialog
class NotebookTabLabel(Gtk.Box):
@@ -38,7 +38,10 @@ class DFeetApp(Gtk.Application):
HISTORY_MAX_SIZE = 10
- def __init__(self):
+ def __init__(self, package, version, data_dir):
+ self.package = package
+ self.version = version
+ self.data_dir = data_dir
Gtk.Application.__init__(self, application_id="org.gnome.d-feet",
flags=Gio.ApplicationFlags.FLAGS_NONE)
diff --git a/dfeet/bus_watch.py b/src/dfeet/bus_watch.py
similarity index 99%
rename from dfeet/bus_watch.py
rename to src/dfeet/bus_watch.py
index ccb0f6d..2ba403d 100644
--- a/dfeet/bus_watch.py
+++ b/src/dfeet/bus_watch.py
@@ -3,7 +3,7 @@ from __future__ import print_function
from gi.repository import GObject, Gtk, Gio
-from dfeet._ui.uiloader import UILoader
+from dfeet.uiloader import UILoader
from dfeet.introspection import AddressInfo
diff --git a/dfeet/dbus_utils.py b/src/dfeet/dbus_utils.py
similarity index 100%
rename from dfeet/dbus_utils.py
rename to src/dfeet/dbus_utils.py
diff --git a/dfeet/_ui/executemethoddialog.py b/src/dfeet/executemethoddialog.py
similarity index 99%
rename from dfeet/_ui/executemethoddialog.py
rename to src/dfeet/executemethoddialog.py
index 451d327..1f2e05c 100644
--- a/dfeet/_ui/executemethoddialog.py
+++ b/src/dfeet/executemethoddialog.py
@@ -3,7 +3,7 @@ import time
from pprint import pformat
from gi.repository import GLib, Gio, Gtk
-from dfeet._ui.uiloader import UILoader
+from dfeet.uiloader import UILoader
class ExecuteMethodDialog:
diff --git a/dfeet/introspection.py b/src/dfeet/introspection.py
similarity index 99%
rename from dfeet/introspection.py
rename to src/dfeet/introspection.py
index 4c05cd5..bcf2445 100644
--- a/dfeet/introspection.py
+++ b/src/dfeet/introspection.py
@@ -2,9 +2,9 @@
from __future__ import print_function
from gi.repository import Gtk, Gio, GLib
-from dfeet._ui.executemethoddialog import ExecuteMethodDialog
+from dfeet.executemethoddialog import ExecuteMethodDialog
-from dfeet._ui.uiloader import UILoader
+from dfeet.uiloader import UILoader
from dfeet.introspection_helper import DBusNode, DBusInterface, DBusProperty, DBusSignal, DBusMethod
diff --git a/dfeet/introspection_helper.py b/src/dfeet/introspection_helper.py
similarity index 100%
rename from dfeet/introspection_helper.py
rename to src/dfeet/introspection_helper.py
diff --git a/dfeet/settings.py b/src/dfeet/settings.py
similarity index 100%
rename from dfeet/settings.py
rename to src/dfeet/settings.py
diff --git a/dfeet/_ui/uiloader.py b/src/dfeet/uiloader.py
similarity index 100%
rename from dfeet/_ui/uiloader.py
rename to src/dfeet/uiloader.py
diff --git a/dfeet/_ui/wnck_utils.py b/src/dfeet/wnck_utils.py
similarity index 100%
rename from dfeet/_ui/wnck_utils.py
rename to src/dfeet/wnck_utils.py
diff --git a/tests/tests.py b/src/tests/tests.py
similarity index 100%
rename from tests/tests.py
rename to src/tests/tests.py
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]