summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Reffett <creffett@gentoo.org>2013-03-02 03:32:55 +0000
committerChris Reffett <creffett@gentoo.org>2013-03-02 03:32:55 +0000
commit39ce9d79610159c7f129ebfc5eacbf049cf5a160 (patch)
tree730b6bd7eded30ead0b9dbd2e1eeb2b5a2081055 /app-misc/xmind
parentUpdate USE flag description based on confusion from upstream reported bug (diff)
downloadgentoo-2-39ce9d79610159c7f129ebfc5eacbf049cf5a160.tar.gz
gentoo-2-39ce9d79610159c7f129ebfc5eacbf049cf5a160.tar.bz2
gentoo-2-39ce9d79610159c7f129ebfc5eacbf049cf5a160.zip
New package wrt bugs 295242, 375249. Thanks to Mark Dumlao <madumlao@gmail.com>, Vitovt <vitovt@grusha.org.ua>, Heiu-mun Park <padangustasana@gmail.com>, Tarcisio Fedrizzi <tarcisio.fedrizzi@gmail.com> for work in making the ebuild.
(Portage version: 2.2.0_alpha163/cvs/Linux x86_64, signed Manifest commit with key 42618354)
Diffstat (limited to 'app-misc/xmind')
-rw-r--r--app-misc/xmind/ChangeLog14
-rw-r--r--app-misc/xmind/files/x-xmind.xml10
-rw-r--r--app-misc/xmind/files/xmind-thumbnailer78
-rw-r--r--app-misc/xmind/files/xmind.16.pngbin0 -> 1817 bytes
-rw-r--r--app-misc/xmind/files/xmind.32.pngbin0 -> 2987 bytes
-rw-r--r--app-misc/xmind/files/xmind.48.pngbin0 -> 3607 bytes
-rw-r--r--app-misc/xmind/files/xmind.schemas30
-rw-r--r--app-misc/xmind/metadata.xml8
-rw-r--r--app-misc/xmind/xmind-3.3.1.201212250029.ebuild96
9 files changed, 236 insertions, 0 deletions
diff --git a/app-misc/xmind/ChangeLog b/app-misc/xmind/ChangeLog
new file mode 100644
index 000000000000..9c41692ce92d
--- /dev/null
+++ b/app-misc/xmind/ChangeLog
@@ -0,0 +1,14 @@
+# ChangeLog for app-misc/xmind
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/xmind/ChangeLog,v 1.1 2013/03/02 03:32:55 creffett Exp $
+
+*xmind-3.3.1.201212250029 (02 Mar 2013)
+
+ 02 Mar 2013; Chris Reffett <creffett@gentoo.org> +files/x-xmind.xml,
+ +files/xmind-thumbnailer, +files/xmind.16.png, +files/xmind.32.png,
+ +files/xmind.48.png, +files/xmind.schemas, +metadata.xml,
+ +xmind-3.3.1.201212250029.ebuild:
+ New package wrt bugs 295242, 375249. Thanks to Mark Dumlao
+ <madumlao@gmail.com>, Vitovt <vitovt@grusha.org.ua>, Heiu-mun Park
+ <padangustasana@gmail.com>, Tarcisio Fedrizzi <tarcisio.fedrizzi@gmail.com>
+ for work in making the ebuild.
diff --git a/app-misc/xmind/files/x-xmind.xml b/app-misc/xmind/files/x-xmind.xml
new file mode 100644
index 000000000000..57292e9c689b
--- /dev/null
+++ b/app-misc/xmind/files/x-xmind.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="application/x-xmind">
+ <sub-class-of type="application/zip"/>
+ <comment>XMind Workbook</comment>
+ <alias type="application/vnd.xmind.workbook"/>
+ <generic-icon name="package-x-generic"/>
+ <glob pattern="*.xmind"/>
+ </mime-type>
+</mime-info>
diff --git a/app-misc/xmind/files/xmind-thumbnailer b/app-misc/xmind/files/xmind-thumbnailer
new file mode 100644
index 000000000000..48eb89b8cd9a
--- /dev/null
+++ b/app-misc/xmind/files/xmind-thumbnailer
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+
+import gnomevfs
+import os
+import sys
+import zipfile
+from PIL import Image, ImageEnhance
+
+# Alter these varibles to change thumbnail look
+ICON_PATH = "/usr/share/icons/hicolor/32x32/apps/xmind.png" # Change this path to alter icons
+ICON_OPACITY = 0.6 #Opacity of the icon (between 0.0 and 1.0)
+THUMBNAIL_BACKGROUND_COLOR = "white" # Color of the background
+
+in_file_path = gnomevfs.get_local_path_from_uri(sys.argv[1])
+out_file_path = sys.argv[2]
+path_without_thumbs = os.getenv("HOME")+"/Templates"
+
+def get_icon(thumbnail_size):
+ #Load icon
+ icon = Image.open(ICON_PATH).convert("RGBA")
+ #Set it's opacity
+ icon = set_icon_opacity(icon,ICON_OPACITY)
+ #And set it's position in thumbnail
+ icon_posx=thumbnail_size[0]-icon.size[0]
+ icon_posy=thumbnail_size[1]-icon.size[1]
+ icon_width=thumbnail_size[0]
+ icon_height=thumbnail_size[1]
+ return {"image":icon,"position":(icon_posx,icon_posy,icon_width,icon_height)}
+
+def get_basic_thumbnail():
+ #Find out if the file is not in Templates directory
+ if in_file_path.find(path_without_thumbs)!=0:
+ try:
+ #Extract thumbnail from Xmind file and save it
+ zip=zipfile.ZipFile(in_file_path,mode="r")
+ picture=zip.read("Thumbnails/thumbnail.jpg")
+ zip.close()
+ thumbnail=open(out_file_path,"w")
+ thumbnail.write(picture)
+ thumbnail.write("/n")
+ thumbnail.close()
+ #Open saved thumbnail
+ image=Image.open(out_file_path).convert("RGBA")
+ if image.size[0]>200:
+ image = image.resize((200,image.size[1]*200/image.size[0]))
+ if image.size[1]>200:
+ image = image.resize((image.size[0]*200/image.size[1],200))
+ return {"suceeded":True,"image":image,"size":(image.size[0],image.size[1])}
+
+ except:
+ return {"suceeded":False}
+ else:
+ return {"suceeded":False}
+
+# Nicked from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362879
+def set_icon_opacity(icon,opacity):
+ #Returns an image with reduced opacity.
+ assert opacity >= 0 and opacity <= 1
+ if icon.mode != 'RGBA':
+ icon = icon.convert('RGBA')
+ else:
+ icon = icon.copy()
+ alpha = icon.split()[3]
+ alpha = ImageEnhance.Brightness(alpha).enhance(opacity)
+ icon.putalpha(alpha)
+ return icon
+
+thumbnail=get_basic_thumbnail()
+if thumbnail["suceeded"]:
+ background=Image.new("RGB", thumbnail["size"], THUMBNAIL_BACKGROUND_COLOR)
+ icon=get_icon(thumbnail["size"])
+ thumbnail=thumbnail["image"]
+ # Add thumbnail
+ background.paste(thumbnail, None, thumbnail)
+ # Add icon
+ background.paste(icon["image"],icon["position"],icon["image"])
+ # Save thumbnail
+ background.save(out_file_path,"PNG")
diff --git a/app-misc/xmind/files/xmind.16.png b/app-misc/xmind/files/xmind.16.png
new file mode 100644
index 000000000000..28480879c7a1
--- /dev/null
+++ b/app-misc/xmind/files/xmind.16.png
Binary files differ
diff --git a/app-misc/xmind/files/xmind.32.png b/app-misc/xmind/files/xmind.32.png
new file mode 100644
index 000000000000..4774b258abcb
--- /dev/null
+++ b/app-misc/xmind/files/xmind.32.png
Binary files differ
diff --git a/app-misc/xmind/files/xmind.48.png b/app-misc/xmind/files/xmind.48.png
new file mode 100644
index 000000000000..6fc816afb180
--- /dev/null
+++ b/app-misc/xmind/files/xmind.48.png
Binary files differ
diff --git a/app-misc/xmind/files/xmind.schemas b/app-misc/xmind/files/xmind.schemas
new file mode 100644
index 000000000000..336b09ecd837
--- /dev/null
+++ b/app-misc/xmind/files/xmind.schemas
@@ -0,0 +1,30 @@
+<gconfschemafile>
+ <schemalist>
+
+ <schema>
+ <key>/schemas/desktop/gnome/thumbnailers/application@x-xmind/enable</key>
+ <applyto>/desktop/gnome/thumbnailers/application@x-xmind/enable</applyto>
+ <owner>xmind-thumb</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short></short>
+ <long></long>
+ </locale>
+ </schema>
+
+
+ <schema>
+ <key>/schemas/desktop/gnome/thumbnailers/application@x-xmind/command</key>
+ <applyto>/desktop/gnome/thumbnailers/application@x-xmind/command</applyto>
+ <owner>xmind-thumb</owner>
+ <type>string</type>
+ <default>/usr/bin/xmind-thumbnailer %u %o</default>
+ <locale name="C">
+ <short></short>
+ <long></long>
+ </locale>
+ </schema>
+
+ </schemalist>
+</gconfschemafile>
diff --git a/app-misc/xmind/metadata.xml b/app-misc/xmind/metadata.xml
new file mode 100644
index 000000000000..b8f97c36765b
--- /dev/null
+++ b/app-misc/xmind/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>creffett@gentoo.org</email>
+ <name>Chris Reffett</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-misc/xmind/xmind-3.3.1.201212250029.ebuild b/app-misc/xmind/xmind-3.3.1.201212250029.ebuild
new file mode 100644
index 000000000000..4b63bb3ae00f
--- /dev/null
+++ b/app-misc/xmind/xmind-3.3.1.201212250029.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/xmind/xmind-3.3.1.201212250029.ebuild,v 1.1 2013/03/02 03:32:55 creffett Exp $
+
+EAPI=5
+
+inherit eutils multilib fdo-mime gnome2-utils
+
+MY_PN="${PN}-portable"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A brainstorming and mind mapping software tool."
+HOMEPAGE="http://www.xmind.net"
+SRC_URI="http://dl2.xmind.net/xmind-downloads/${MY_P}.zip"
+LICENSE="EPL-1.0 LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="
+ >=virtual/jre-1.5
+ x11-libs/gtk+:2
+"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}
+
+QA_PRESTRIPPED="/usr/$(get_libdir)/xmind/XMind/libcairo-swt.so"
+
+src_configure() {
+ if use amd64; then
+ XDIR="XMind_Linux_64bit"
+ else
+ XDIR="XMind_Linux"
+ fi
+ mv -v "$XDIR" XMind
+ mv -v XMind/.eclipseproduct XMind/configuration Commons
+
+ # force data instance & config area to be at home/.xmind directory
+ sed -i -e '/-configuration/d' XMind/XMind.ini || die
+ sed -i -e '/\.\/configuration/d' XMind/XMind.ini || die
+ sed -i -e '/-data/d' XMind/XMind.ini || die
+ sed -i -e '/\.\.\/Commons\/data\/workspace-cathy/d' XMind/XMind.ini || die
+ echo '-Dosgi.instance.area=@user.home/.xmind/workspace-cathy' >> XMind/XMind.ini || die
+ echo '-Dosgi.configuration.area=@user.home/.xmind/configuration-cathy' >> XMind/XMind.ini || die
+}
+
+src_compile() {
+ :;
+}
+
+src_install() {
+ libdir="$(get_libdir)"
+ dodir "/usr/${libdir}/xmind"
+ insinto "/usr/${libdir}/xmind"
+ doins -r Commons
+ doins -r XMind
+
+ exeinto "/usr/${libdir}/xmind/XMind"
+ doexe XMind/XMind
+ dosym "/usr/${libdir}/xmind/XMind/XMind" /usr/bin/xmind
+
+ # insall icons
+ local res
+ for res in 16 32 48; do
+ insinto /usr/share/icons/hicolor/${res}x${res}/apps
+ newins "${FILESDIR}/xmind.${res}.png" xmind.png
+ done
+
+ # insall MIME type
+ insinto /usr/share/mime/packages
+ doins "${FILESDIR}/x-xmind.xml"
+
+ # make desktop entry
+ make_desktop_entry xmind XMind xmind Office "MimeType=application/x-xmind;"
+ sed -i -e "/^Exec/s/$/ %F/" "${ED}"/usr/share/applications/*.desktop
+
+ insinto /etc/gconf/schemas
+ doins "${FILESDIR}/xmind.schemas"
+ dobin "${FILESDIR}/xmind-thumbnailer"
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+ gnome2_icon_cache_update
+ elog "For audio notes support, install media-sound/lame"
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}