File freemind.spec of Package freemind
#
# spec file for package freemind
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: freemind
Version: 1.0.1
Release: 0
Summary: Java Program for creating and viewing Mindmaps
License: GPL-2.0+
Group: Productivity/Office/Other
URL: http://freemind.sourceforge.net/
Source0: http://sourceforge.net/projects/freemind/files/freemind/%{version}/%{name}-src-%{version}.tar.gz
Source1: %{name}.desktop
Source2: x-%{name}.xml
Source3: %{name}.1
Source4: urlsee
Source5: urlsee.1
Patch0: %{name}_properties.patch
Patch1: %{name}_encoding.patch
BuildRequires: ImageMagick
BuildRequires: ant
BuildRequires: ant-nodeps
BuildRequires: fdupes
# this is just to satisfy rpmlint
BuildRequires: hicolor-icon-theme
BuildRequires: java-1_8_0-openjdk-devel
BuildRequires: java-devel >= 1.5.0
Requires: java >= 1.5.0
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: shared-mime-info
# these used to be separate packages
Obsoletes: %{name}-plugins-help < %{version}
Obsoletes: %{name}-plugins-script < %{version}
Obsoletes: %{name}-plugins-svg < %{version}
Provides: %{name}-plugins-help = %{version}
Provides: %{name}-plugins-script = %{version}
Provides: %{name}-plugins-svg = %{version}
BuildArch: noarch
%description
FreeMind is a premier free mind-mapping software written in Java.
The recent development has hopefully turned it into high productivity tool.
%prep
%setup -q -n %{name}
%patch0
%patch1
chmod +x check_for_duplicate_resources.sh
%build
ant
%install
install -d %{buildroot}%{_datadir}/%{name}
install -d %{buildroot}%{_docdir}/%{name}
(cd ../bin/dist && cp -R accessories browser lib plugins %{buildroot}%{_datadir}/%{name})
install -m 755 freemind.sh %{buildroot}%{_datadir}/%{name}
ln -sf %{_docdir}/%{name} %{buildroot}%{_datadir}/%{name}/doc
install -d -m 755 %{buildroot}%{_datadir}/applications
install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications
install -d -m 755 %{buildroot}%{_datadir}/mime/packages
install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/mime/packages
install -d -m 755 %{buildroot}%{_datadir}/pixmaps
%{_bindir}/convert -scale 32 images/FreeMindWindowIcon.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
for i in 16 32 48
do
install -d -m 755 %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
%{_bindir}/convert -scale ${i} images/FreeMindWindowIcon.png %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
done
install -d -m 755 %{buildroot}%{_sysconfdir}/%{name}
install -m 644 patterns.xml %{buildroot}%{_sysconfdir}/%{name}
install -d -m 755 %{buildroot}%{_bindir}
ln -s %{_datadir}/%{name}/%{name}.sh %{buildroot}%{_bindir}/%{name}
install -m 755 %{SOURCE4} %{buildroot}%{_bindir}
install -d -m 755 %{buildroot}%{_mandir}/man1
install -m 644 %{SOURCE3} %{buildroot}%{_mandir}/man1
install -m 644 %{SOURCE5} %{buildroot}%{_mandir}/man1
%fdupes -s %{buildroot}%{_datadir}
%fdupes
%post
if [ -x $(which update-mime-database) ]
then # FREEDESKTOP.ORG integration
update-mime-database %{_datadir}/mime
fi
%postun
if [ -x $(which update-mime-database) ]
then # FREEDESKTOP.ORG integration
update-mime-database %{_datadir}/mime
fi
%files
%{_bindir}/%{name}
%{_bindir}/urlsee
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/%{name}.sh
%{_datadir}/%{name}/accessories
%{_datadir}/%{name}/browser
%{_datadir}/%{name}/lib
%{_datadir}/%{name}/doc
%{_datadir}/%{name}/plugins
%{_mandir}/man1/%{name}.1%{ext_man}
%{_mandir}/man1/urlsee.1%{ext_man}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/mime/packages/x-%{name}.xml
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/icons/hicolor/*x*/apps/%{name}.png
%doc license history.txt doc/*
%config %{_sysconfdir}/%{name}
%changelog