diff --git a/Makefile.am b/Makefile.am index a5beeff56..4bd89101d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,15 +11,14 @@ EXTRA_DIST = \ intltool-merge.in \ intltool-update.in \ win \ - scripts/gajim.in - + scripts/gajim \ + scripts/gajim-history-manager \ + scripts/gajim-remote + DISTCLEANFILES = \ intltool-extract \ intltool-merge \ - intltool-update \ - scripts/gajim \ - scripts/gajim-remote \ - scripts/gajim-histrory-manager + intltool-update MAINTAINERCLEANFILES = \ configure \ diff --git a/configure.ac b/configure.ac index 857357e1a..caee0a9cd 100644 --- a/configure.ac +++ b/configure.ac @@ -77,9 +77,6 @@ AC_CONFIG_FILES([ data/gajim-remote.desktop.in data/defs.py gajim/Makefile - scripts/gajim - scripts/gajim-remote:scripts/gajim.in - scripts/gajim-history-manager:scripts/gajim.in po/Makefile.in plugins/Makefile ]) diff --git a/scripts/gajim.in b/scripts/gajim similarity index 76% rename from scripts/gajim.in rename to scripts/gajim index e163a9bda..4cc961899 100644 --- a/scripts/gajim.in +++ b/scripts/gajim @@ -1,5 +1,4 @@ -#!/bin/sh -## scripts/gajim.in +#!/usr/bin/python3 -OO ## ## Copyright (C) 2005 Yann Le Boulanger ## Copyright (C) 2006 Dimitur Kirov @@ -21,13 +20,12 @@ ## along with Gajim. If not, see . ## -APP=`basename $0` -if test $(id -u) -eq 0; then - echo "You must not launch $APP as root, it is INSECURE" - exit 1 -fi +import os +import sys -[ "$APP" = "gajim-history-manager" ] && APP="history_manager" +if os.geteuid() == 0: + sys.exit("You must not launch gajim as root, it is insecure.") -cd "@GAJIM_SRCDIR@" -exec "@PYTHON@" -OO $APP.py "$@" +import gajim.gajim as g + +g.GajimApplication().run(sys.argv) diff --git a/scripts/gajim-history-manager b/scripts/gajim-history-manager new file mode 100644 index 000000000..6fe987e8f --- /dev/null +++ b/scripts/gajim-history-manager @@ -0,0 +1,35 @@ +#!/usr/bin/python3 -OO +## +## Copyright (C) 2005 Yann Le Boulanger +## Copyright (C) 2006 Dimitur Kirov +## Stefan Bethge +## Copyright (C) 2008 Jonathan Schleifer +## +## This file is part of Gajim. +## +## Gajim 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; version 3 only. +## +## Gajim 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 Gajim. If not, see . +## + +import os +import sys + +if os.geteuid() == 0: + sys.exit("You must not launch gajim as root, it is insecure.") + +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk +import gajim.history_manager as g + +g.HistoryManager() +Gtk.main() diff --git a/scripts/gajim-remote b/scripts/gajim-remote new file mode 100644 index 000000000..81ce64ace --- /dev/null +++ b/scripts/gajim-remote @@ -0,0 +1,31 @@ +#!/usr/bin/python3 -OO +## +## Copyright (C) 2005 Yann Le Boulanger +## Copyright (C) 2006 Dimitur Kirov +## Stefan Bethge +## Copyright (C) 2008 Jonathan Schleifer +## +## This file is part of Gajim. +## +## Gajim 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; version 3 only. +## +## Gajim 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 Gajim. If not, see . +## + +import os +import sys + +if os.geteuid() == 0: + sys.exit("You must not launch gajim as root, it is insecure.") + +import gajim.gajim_remote as g + +g.GajimRemote()