[tnef] Initial import of package, review #522920.

David Timms dtimms at fedoraproject.org
Tue Jul 19 10:02:18 UTC 2011


commit a817cd8671ef3072462f3ae3150fd613059f2740
Author: David Timms <dtimms at iinet.net.au>
Date:   Tue Jul 19 20:01:10 2011 +1000

    Initial import of package, review #522920.

 .gitignore           |    1 +
 sources              |    1 +
 tnef-extract.desktop |   10 +++
 tnef.sh              |   28 ++++++++
 tnef.spec            |  169 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tnefextract.desktop  |   14 ++++
 vnd.ms-tnef.desktop  |    9 +++
 7 files changed, 232 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..ccd4de5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/tnef-1.4.8.tar.gz
diff --git a/sources b/sources
index e69de29..74c9eaf 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+cc6443ac5f30913394c0c16ae7941e4f  tnef-1.4.8.tar.gz
diff --git a/tnef-extract.desktop b/tnef-extract.desktop
new file mode 100644
index 0000000..7973de9
--- /dev/null
+++ b/tnef-extract.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Type=Application
+Name=Extract TNEF archive
+Comment=Extract files from TNEF archive
+Exec=tnef.sh %f
+Icon=archive-extract
+Terminal=true
+MimeType=application/vnd.ms-tnef;
+NoDisplay=true
+#refresh F5 nautilus to see changes to this file
diff --git a/tnef.sh b/tnef.sh
new file mode 100644
index 0000000..378eaf4
--- /dev/null
+++ b/tnef.sh
@@ -0,0 +1,28 @@
+#! /bin/bash
+# /usr/bin/tnef.sh
+# 
+# nautilus helper to extract a tnef file's contents into a subfolder of the 
+#     tnef file's location.
+#   todo: 
+# error checking (disk space, unwritable etc).
+# how could the calling nautilus window be told to refresh it's contents so the
+#    extracted folder becomes visible straight away. (for paths with spaces).
+filefullpath="$1"
+file=`basename "$filefullpath"`
+filepath="`dirname "$filefullpath"`/"$file".extract"
+#echo $filefullpath
+#echo $file
+#echo $filepath
+if ! [ -d "$filepath" ]; then
+  echo "  creating folder $filepath..."
+  mkdir "$filepath"
+  echo "  extracting $file tnef contents..."
+  tnef --verbose --save-body -C "$filepath" "$filefullpath"
+  echo "  complete."
+  sleep 4
+else
+  echo "  default extract folder $filepath"
+  echo "      already exists, extraction aborted."
+  sleep 6
+fi
+
diff --git a/tnef.spec b/tnef.spec
new file mode 100644
index 0000000..be74e6a
--- /dev/null
+++ b/tnef.spec
@@ -0,0 +1,169 @@
+Name:      tnef
+Version:   1.4.8
+Release:   3%{?dist}
+Summary:   Extract files from email attachments like WINMAIL.DAT
+
+Group:     Applications/Archiving
+License:   GPLv2+
+# what about: src/ConvertUTF.* ?
+# * Unicode, Inc. hereby grants the right to freely use the information
+# ... Fedora-legal confirmed this to be the free Unicode license.
+URL:       http://sourceforge.net/projects/tnef/
+Source0:   http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
+Source1:   vnd.ms-tnef.desktop
+Source2:   tnef-extract.desktop
+Source3:   tnefextract.desktop
+Source4:   tnef.sh
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: kde-filesystem
+
+
+%description
+This application provides a way to unpack Microsoft MS-TNEF MIME attachments.
+It operates like tar in order to unpack files of type "application/ms-tnef",
+which may have been placed into the MS-TNEF attachment instead of being
+attached separately.
+
+Such files may have attachment names similar to WINMAIL.DAT
+
+
+%package nautilus
+Summary: Provides TNEF extract extension for Gnome's Nautilus file manager
+Group:   Applications/Archiving
+
+Requires: tnef
+Requires: nautilus
+
+
+%description nautilus
+Provides a right-click extract menu item for Nautilus to extract TNEF files.
+
+
+%package dolphin
+Summary: Provides TNEF extract extension for KDE's Dolphin file manager
+Group:   Applications/Archiving
+
+Requires: tnef
+Requires: kde-filesystem
+Requires: dolphin
+
+
+%description dolphin
+Provides a right-click extract menu item for Dolphin to extract TNEF files.
+
+
+%prep
+%setup -q
+
+
+%build
+%configure
+make %{?_smp_mflags}
+chmod a-x THANKS
+
+
+%install
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot}
+
+mkdir -p %{buildroot}/%{_datadir}/mimelnk/application/
+desktop-file-install                                  \
+    --dir=%{buildroot}%{_datadir}/mimelnk/application \
+    %{SOURCE1}
+
+mkdir -p %{buildroot}/%{_datadir}/applications/
+desktop-file-install                                   \
+    --dir=%{buildroot}%{_datadir}/applications \
+    %{SOURCE2}
+
+#in future: kde4_servicesdir, but for now
+mkdir -p %{buildroot}%{_kde4_datadir}/kde4/services/ 
+desktop-file-install                                 \
+    --dir=%{buildroot}%{_kde4_datadir}/kde4/services \
+    %{SOURCE3}
+
+install -p -m 755 %{SOURCE4} \
+        %{buildroot}%{_bindir}/
+
+
+%post nautilus
+/usr/bin/update-desktop-database &> /dev/null || :
+
+%postun nautilus
+/usr/bin/update-desktop-database &> /dev/null || :
+
+
+%post dolphin
+/usr/bin/update-desktop-database &> /dev/null || :
+
+
+%postun dolphin
+/usr/bin/update-desktop-database &> /dev/null || :
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%check
+make check DESTDIR=%{buildroot}
+
+
+%files
+%defattr(-,root,root,-)
+%doc AUTHORS ChangeLog COPYING NEWS README THANKS TODO
+%{_bindir}/%{name}
+%{_bindir}/%{name}.sh
+%{_mandir}/man1/%{name}.1*
+
+
+%files nautilus
+%{_datadir}/applications/tnef-extract.desktop
+%{_datadir}/mimelnk/application/vnd.ms-tnef.desktop
+
+
+%files dolphin
+%{_kde4_datadir}/kde4/services/tnefextract.desktop
+
+
+%changelog
+
+* Mon Jul 18 2011 David Timms <iinet.net.au at dtimms> - 1.4.8-3
+- del main package require on kde-filesystem
+- del require on desktop-file-utils to meet packaging guidelines
+
+* Mon Jul 18 2011 David Timms <iinet.net.au at dtimms> - 1.4.8-2
+- remove dolphin requires on kde-filesystem
+- move update-desktop-database to gui subpackages
+
+* Sun Jul 17 2011 David Timms <iinet.net.au at dtimms> - 1.4.8-1
+- update to 1.48
+- use % style macros everywhere instead of $ style
+- move the desktop icon stuff to subpackage
+
+* Wed Apr  7 2010 David Timms <iinet.net.au at dtimms> - 1.4.7-2
+- mod the description and summary to make rpmlint spelling checks happier
+
+* Sat Mar 20 2010 David Timms <iinet.net.au at dtimms> - 1.4.7-1
+- update to 1.47, which reverts changes to UTF handling
+
+* Thu Jan  7 2010 David Timms <iinet.net.au at dtimms> - 1.4.6-5
+- trial potential fix for ppc32/64 rpm test failure on ppc arch
+
+* Mon Oct  5 2009 David Timms <iinet.net.au at dtimms> - 1.4.6-4
+- fix desktop file for nautilus Extract archive menu
+- add exclude arch ppc since build tests fail, by using ifarch
+- add missing update-desktop-database calls
+
+* Wed Sep 30 2009 David Timms <iinet.net.au at dtimms> - 1.4.6-3
+- add missing buildrequires and requires on kde-filesystem
+- mod to use desktop-file-install to install the .desktop files.
+
+* Sun Sep 27 2009 David Timms <iinet.net.au at dtimms> - 1.4.6-2
+- add tnefextract.desktop ServiceMenu for dolphin
+- run make build tests
+
+* Sun Sep 06 2009 David Timms <iinet.net.au at dtimms> - 1.4.6-1
+- initial packaging for fedora
+- add desktop file for nautilus open, and appropriate extract script
diff --git a/tnefextract.desktop b/tnefextract.desktop
new file mode 100644
index 0000000..4583588
--- /dev/null
+++ b/tnefextract.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Type=Service
+X-KDE-Priority=TopLevel
+X-KDE-ServiceTypes=KonqPopupMenu/Plugin,application/vnd.ms-tnef
+Name=tnef tools
+Comment=tnef archive tool menu
+Icon=archive-extract
+Actions=tnefExtractToSubfolder;
+
+[Desktop Action tnefExtractToSubfolder]
+Type=Application
+Name=Extract TNEF (email attachment) Archive
+Exec=tnef.sh "%f"
+Icon=archive-extract
diff --git a/vnd.ms-tnef.desktop b/vnd.ms-tnef.desktop
new file mode 100644
index 0000000..f3a3a68
--- /dev/null
+++ b/vnd.ms-tnef.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+MimeType=application/vnd.ms-tnef;
+Icon=archive-extract
+Name=Extract TNEF (email attachment) Archive
+Comment=TNEF archive
+#Patterns=winmail.dat;winmail*.dat;*.dat;
+Exec=tnef.sh "%f"
+NoDisplay=true


More information about the scm-commits mailing list