diff --git a/data/org.mamolinux.simple-pwgen.gschema.xml b/data/org.mamolinux.simple-pwgen.gschema.xml.in similarity index 100% rename from data/org.mamolinux.simple-pwgen.gschema.xml rename to data/org.mamolinux.simple-pwgen.gschema.xml.in diff --git a/data/schema/org.mamolinux.simple-pwgen.gschema.xml b/data/schema/org.mamolinux.simple-pwgen.gschema.xml new file mode 100644 index 0000000..1537685 --- /dev/null +++ b/data/schema/org.mamolinux.simple-pwgen.gschema.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/generate_desktop_files b/generate_desktop_files index e31a906..ae46cde 100755 --- a/generate_desktop_files +++ b/generate_desktop_files @@ -22,7 +22,7 @@ StartupNotify=false NotShowIn=KDE; """ -additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/simple-pwgen.desktop", prefix, _("Simple Password Generator"), _("Very simple Python3-based GUI application to generate random password."), suffix) +additionalfiles.generate(DOMAIN, PATH, "data/simple-pwgen.desktop.in", prefix, _("Simple Password Generator"), _("Very simple Python3-based GUI application to generate random password."), suffix) prefix = "[Desktop Entry]\n" @@ -36,4 +36,4 @@ X-KDE-StartupNotify=false OnlyShowIn=KDE; """ -additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/kde4/simple-pwgen.desktop", prefix, _("Simple Password Generator"), _("Very simple Python3-based GUI application to generate random password."), suffix, genericName=_("Simple Password Generator")) +additionalfiles.generate(DOMAIN, PATH, "data/kde4/simple-pwgen.desktop.in", prefix, _("Simple Password Generator"), _("Very simple Python3-based GUI application to generate random password."), suffix, genericName=_("Simple Password Generator")) diff --git a/setup.cfg b/setup.cfg index 5bb313d..815fcb2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,9 +23,13 @@ classifiers = [options] package_dir = = src -packages = find: +packages = find_namespace: python_requires = >=3.6 include_package_data = True +install_requires = + configobj + PyGObject + setproctitle [options.package_data] * = *VERSION, *ui @@ -41,6 +45,6 @@ console_scripts = domain=simple-pwgen desktop_files=[("share/applications", ("data/simple-pwgen.desktop.in", ))] -schemas_files=[("share/glib-2.0/schemas", +schemas_files=[("share/glib-2.0/schemas", ("data/org.mamolinux.simple-pwgen.gschema.xml.in",)) ] diff --git a/setup.py b/setup.py index 119bb46..1d99558 100644 --- a/setup.py +++ b/setup.py @@ -7,32 +7,32 @@ import distutils.command.install_data for line in subprocess.check_output('dpkg-parsechangelog --format rfc822'.split(), - universal_newlines=True).splitlines(): - header, colon, value = line.lower().partition(':') - if header == 'version': - version = value.strip() - break + universal_newlines=True).splitlines(): + header, colon, value = line.lower().partition(':') + if header == 'version': + version = value.strip() + break else: - raise RuntimeError('No version found in debian/changelog') + raise RuntimeError('No version found in debian/changelog') with open("src/SimplePwgen/VERSION", "w") as f: - if '~' in version: - version = version.split('~')[0] - f.write("%s" % version) + if '~' in version: + version = version.split('~')[0] + f.write("%s" % version) gschema_dir_suffix = 'share/glib-2.0/schemas' class install_data(distutils.command.install_data.install_data): - def run(self): - # Python 3 'super' call. - super().run() - - # Compile '*.gschema.xml' to update or create 'gschemas.compiled'. - info("compiling gsettings schemas") - # Use 'self.install_dir' to build the path, so that it works - # for both global and local '--user' installs. - gschema_dir = os.path.join(self.install_dir, gschema_dir_suffix) - self.spawn(["glib-compile-schemas", gschema_dir]) + def run(self): + # Python 3 'super' call. + super().run() + + # Compile '*.gschema.xml' to update or create 'gschemas.compiled'. + info("compiling gsettings schemas") + # Use 'self.install_dir' to build the path, so that it works + # for both global and local '--user' installs. + gschema_dir = os.path.join(self.install_dir, gschema_dir_suffix) + self.spawn(["glib-compile-schemas", gschema_dir]) data_files = [('share/applications', glob.glob("data/applications/*.desktop")), ('share/icons/hicolor/scalable/apps', glob.glob("data/icons/*")),