Init package
This commit is contained in:
parent
c7a177d8a1
commit
61e3dfd727
BIN
exo-0.12.11.tar.bz2
Normal file
BIN
exo-0.12.11.tar.bz2
Normal file
Binary file not shown.
12
exo-0.7.2-remove-xfce-category.patch
Normal file
12
exo-0.7.2-remove-xfce-category.patch
Normal file
@ -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
|
||||
104
exo.spec
Normal file
104
exo.spec
Normal file
@ -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 <dillon.chen@turbolinux.com.cn> - 0.12.11-1
|
||||
- Init Package
|
||||
178
mailtoparse.py
Normal file
178
mailtoparse.py
Normal file
@ -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 <style> <binary> <mailto>\n" % (sys.argv[0]))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
style = sys.argv[1]
|
||||
binary = sys.argv[2]
|
||||
raw_mailto = sys.argv[3]
|
||||
mailto = parse_url(raw_mailto)
|
||||
|
||||
|
||||
to = mailto.get('to', [])
|
||||
cc = mailto.get('cc', [])
|
||||
bcc = mailto.get('bcc', [])
|
||||
subject = ' '.join(mailto.get('subject', []))
|
||||
body = '\n'.join(mailto.get('body', []))
|
||||
attachments = mailto.get('attachment', [])
|
||||
|
||||
# hackish
|
||||
if isinstance(subject, list):
|
||||
subject = subject[0]
|
||||
|
||||
|
||||
args = [binary]
|
||||
if style == 'mozilla':
|
||||
|
||||
command = "to='" + ','.join(to) + "'"
|
||||
command += ",cc='" + ','.join(cc) + "'"
|
||||
command += ",bcc='" + ','.join(bcc) + "'"
|
||||
command += ",attachment='" + ','.join(attachments) + "'"
|
||||
if subject:
|
||||
command += ",subject='" + subject + "'"
|
||||
if body:
|
||||
command += ",body='" + body + "'"
|
||||
|
||||
args.append('-compose')
|
||||
args.append(command)
|
||||
|
||||
elif style == 'mozilla-remote':
|
||||
# generate xfeDoCommand(composeMessage, ...) string
|
||||
command = 'xfeDoCommand(composeMessage'
|
||||
command += ",to='" + ','.join(to) + "'"
|
||||
command += ",cc='" + ','.join(cc) + "'"
|
||||
command += ",bcc='" + ','.join(bcc) + "'"
|
||||
command += ",attachment='" + ','.join(attachments) + "'"
|
||||
if subject:
|
||||
command += ",subject='" + subject + "'"
|
||||
if body:
|
||||
command += ",body='" + body + "'"
|
||||
|
||||
command += ')'
|
||||
|
||||
# and add the parameters to the argv
|
||||
args.append('-remote')
|
||||
args.append(command)
|
||||
|
||||
elif style == 'evolution':
|
||||
# evo takes a mailto uri and parses it itself
|
||||
# just hand back what we were handed originally
|
||||
# note - it my want them to be url_escaped first? or not?
|
||||
args.append(raw_mailto)
|
||||
|
||||
elif style == 'kmail':
|
||||
if len(to) >= 1:
|
||||
baseaddr = to[0]
|
||||
cc.extend(to[1:])
|
||||
else:
|
||||
baseaddr = " "
|
||||
|
||||
for item in cc:
|
||||
args.append('--cc')
|
||||
args.append(item)
|
||||
for item in bcc:
|
||||
args.append('--bcc')
|
||||
args.append(item)
|
||||
for item in attachments:
|
||||
args.append('--attach')
|
||||
args.append(item)
|
||||
if subject:
|
||||
args.append('--subject')
|
||||
args.append(subject)
|
||||
if body:
|
||||
args.append('--body')
|
||||
args.append('\n'.join(body))
|
||||
args.append('--composer')
|
||||
args.append(baseaddr)
|
||||
|
||||
elif style == 'sylpheed':
|
||||
args.append('--compose')
|
||||
args.append(raw_mailto)
|
||||
# fixme - do attachments separately
|
||||
|
||||
elif style == 'balsa': # cmon, balsa? really?
|
||||
args.append('--compose')
|
||||
args.append(raw_mailto)
|
||||
# fixme - do attachments separately
|
||||
|
||||
elif style == 'mutt':
|
||||
for item in cc:
|
||||
args.append('-c')
|
||||
args.append(item)
|
||||
for item in attachments:
|
||||
args.append('-a')
|
||||
args.append(item)
|
||||
if subject:
|
||||
args.append('-s')
|
||||
args.append(subject)
|
||||
for item in to:
|
||||
args.append(item)
|
||||
if to:
|
||||
args.append('')
|
||||
|
||||
|
||||
else:
|
||||
sys.stderr.write("%s: Unsupported style '%s'.\n" % (sys.argv[0], style))
|
||||
sys.exit(1)
|
||||
|
||||
# try to execute the generated command
|
||||
posix.execv(binary, args)
|
||||
# DEBUG
|
||||
# print binary,
|
||||
# print ' '.join(args)
|
||||
# sys.exit(0)
|
||||
# ENDDEBUG
|
||||
# something went wrong
|
||||
sys.exit(1)
|
||||
Loading…
x
Reference in New Issue
Block a user