diff --git a/exo-0.12.11.tar.bz2 b/exo-0.12.11.tar.bz2 new file mode 100644 index 0000000..18ab718 Binary files /dev/null and b/exo-0.12.11.tar.bz2 differ diff --git a/exo-0.7.2-remove-xfce-category.patch b/exo-0.7.2-remove-xfce-category.patch new file mode 100644 index 0000000..6a417f4 --- /dev/null +++ b/exo-0.7.2-remove-xfce-category.patch @@ -0,0 +1,12 @@ +diff -Nur exo-0.7.2.orig/exo-helper/exo-preferred-applications.desktop.in exo-0.7.2/exo-helper/exo-preferred-applications.desktop.in +--- exo-0.7.2.orig/exo-helper/exo-preferred-applications.desktop.in 2012-03-28 09:15:15.000000000 -0600 ++++ exo-0.7.2/exo-helper/exo-preferred-applications.desktop.in 2012-04-01 21:19:24.762754983 -0600 +@@ -3,7 +3,7 @@ + Exec=exo-preferred-applications + Icon=preferences-desktop-default-applications + Type=Application +-Categories=XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-PersonalSettings; ++Categories=X-XFCE;GTK;Settings;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-PersonalSettings; + OnlyShowIn=XFCE; + Terminal=false + StartupNotify=true diff --git a/exo.spec b/exo.spec new file mode 100644 index 0000000..027d863 --- /dev/null +++ b/exo.spec @@ -0,0 +1,104 @@ +%global xfceversion 4.14 +Name: exo +Version: 0.12.11 +Release: 1%{?dist} +Summary: An extension library to Xfce +License: LGPLv2+ and GPLv2+ +#Group: Development/Libraries +URL: http://xfce.org/ +Source0: http://archive.xfce.org/src/xfce/%{name}/0.12/%{name}-%{version}.tar.bz2 + +# replace mailto handler with python version +# https://bugzilla.xfce.org/show_bug.cgi?id=9964 +Source1: mailtoparse.py +Patch1: exo-0.7.2-remove-xfce-category.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +#BuildArch: noarch +BuildRequires: gcc-c++ +BuildRequires: gtk-doc +BuildRequires: gettext +BuildRequires: perl-URI +BuildRequires: pkgconfig(glib-2.0) >= 2.24.0 +BuildRequires: pkgconfig(gtk+-2.0) >= 2.20.0 +BuildRequires: pkgconfig(libxfce4util-1.0) >= %{xfceversion} +BuildRequires: pkgconfig(libxfce4ui-1) >= %{xfceversion} +BuildRequires: libnotify-devel +BuildRequires: intltool >= 0.31 +BuildRequires: chrpath +BuildRequires: desktop-file-utils +BuildRequires: gobject-introspection-devel + +%description +An extension library for Xfce, targeted at application development. + +%package devel +Summary: Development tools for exo library +Requires: %{name} = %{version}-%{release} +Requires: libxfce4util-devel +Requires: pkgconfig + +%description devel +Development tools and static libraries and header files for the exo library. + +%prep +%setup -q + +%patch1 -p1 + +%build +%configure --enable-gtk-doc --disable-static +%make_build + +%install +%make_install + +find %{buildroot} -type f -name "*.la" -exec rm -f {} ';' + +chrpath --delete %{buildroot}%{_bindir}/exo-desktop-item-edit +chrpath --delete %{buildroot}%{_bindir}/exo-open +chrpath --delete %{buildroot}%{_libdir}/xfce4/exo-*/exo-helper-* + +%find_lang exo-1 + +for file in %{buildroot}/%{_datadir}/applications/%{name}-*.desktop ; do + desktop-file-validate $file +done + +# replace upstream perl script with python one. +rm -f %{buildroot}%{_libdir}/xfce4/exo-1/exo-compose-mail-1 +install -Dpm 0755 %{SOURCE1} %{buildroot}%{_libdir}/xfce4/exo-1/exo-compose-mail-1 + +%ldconfig_scriptlets + +%files -f exo-1.lang +%license COPYING +%doc AUTHORS ChangeLog NEWS README THANKS +%dir %{_sysconfdir}/xdg/xfce4 +%config(noreplace) %{_sysconfdir}/xdg/xfce4/helpers.rc +%{_bindir}/exo-csource +%{_bindir}/exo-desktop-item-edit +%{_bindir}/exo-open +%{_bindir}/exo-preferred-applications +%{_libdir}/libexo-1.so.0 +%{_libdir}/libexo-1.so.0.1.0 +%{_libdir}/libexo-2.so.0 +%{_libdir}/libexo-2.so.0.1.0 +%{_libdir}/xfce4/ +%{_datadir}/xfce4/ +%{_datadir}/applications/*.desktop +%{_datadir}/icons/hicolor/*/*/* +%{_datadir}/pixmaps/exo +%{_mandir}/man1/exo-open.1.* +%{_mandir}/man1/exo-csource.1.* + +%files devel +%doc TODO +%doc %{_datadir}/gtk-doc +%{_includedir}/exo* +%{_libdir}/lib*.so +%{_libdir}/pkgconfig/*.pc + +%changelog +* Tue Jul 7 2020 Dillon Chen - 0.12.11-1 +- Init Package diff --git a/mailtoparse.py b/mailtoparse.py new file mode 100644 index 0000000..4b3b62c --- /dev/null +++ b/mailtoparse.py @@ -0,0 +1,178 @@ +#!/usr/bin/python3 -tt +# skvidal@fedoraproject.org +# (c) red hat, inc 2013, 2015 +# gpl whatever +# this is a direct port of exo-compos-mail-1 from xfce +# from perl to python +# the idea is to dump the 2000000000 perl pkgs pulled in +# by this for a single item :( +# it should handle all the behaviour the same +# it probably has bugs + +# TODO: +# - figure out what the attachment parsing is trying to do +# - figure out if rebuilding the mailto for evo, sylpheed and balsa +# is actually necessary or not - feels silly but I'm not shocked by silly +# - would be nice to have an actual set of tests :) + + +import sys +import posix +import os +import urllib.parse + + +def parse_url(mailto): + url = urllib.parse.urlparse(mailto, 'mailto') + res = {} + to = [] + query = None + + if url.query or '?' not in url.path: + if url.path: + to.append(urllib.parse.unquote(url.path)) + + else: + (thisto, ques, query) = url.path.partition('?') + if thisto.strip(): + to.append(urllib.parse.unquote(thisto)) + + if not query: + query = url.query + + q_dict = urllib.parse.parse_qs(query) + to.extend(q_dict.get('to', [])) + res['to'] = to + if 'to' in q_dict: + del(q_dict['to']) + + res.update(q_dict) + return res + + +if len(sys.argv) < 3: + sys.stderr.write("Usage: %s