Name:           mucommander
Version:        0.9.3
Release:        3
License:        GPLv3, LGPLv3, APSL 2.0, ICU, BSD and CC-BY
Summary:        File manager with Norton Commander interface written in Java
Url:            https://www.mucommander.com
Group:          Productivity/File utilities
Source0:        https://github.com/%{name}/%{name}/releases/download/%{version}-%{release}/%{name}-%{version}.tar.gz
Source1:        https://gist.githubusercontent.com/bongochong/5ade857cec4d546f782647f080644515/raw/6bab6858354277f8c0155369b9451c04b2c29987/%{name}.desktop
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
BuildRequires:	unzip
BuildRequires:	java-devel

%description
muCommander is a lightweight, cross-platform file manager featuring a Norton Commander style interface and running on any operating system with Java support (Mac OS X, Windows, Linux, *BSD, Solaris...).

* Virtual filesystem with local volumes, FTP, SFTP, SMB, NFS, HTTP and Bonjour support
* Quickly copy, move, rename files, create directories, email files...
* Browse, create and uncompress ZIP, RAR, TAR, GZip, BZip2, ISO/NRG, AR/Deb and LST archives
* ZIP files can be modified on-the-fly, without having to recompress the whole archive
* Universal bookmarks and credentials manager
* Multiple windows support
* Full keyboard access
* Highly configurable
* Available in 22 languages : American & British English, French, German, Spanish, Czech, Simplified & Traditional Chinese, Polish, Hungarian, Russian, Slovenian, Romanian, Italian, Korean, Brazilian Portuguese, Dutch, Slovak, Japanese, Swedish, Danish and Ukrainian.
* Free Software (GPL)

%prep
%setup -q -n muCommander-%{version}

%build
echo '#!/bin/bash
java -Djdk.gtk.version=3 \
  -jar %{_javadir}/mucommander.jar' > mucommander.sh

%install
mkdir -p %{buildroot}%{_javadir}/
cp mucommander.jar  %{buildroot}%{_javadir}/
mkdir -p %{buildroot}%{_bindir}/
cp mucommander.sh %{buildroot}%{_bindir}/mucommander
for i in 16 32 48 128 256; do
  unzip -j mucommander.jar images/mucommander/icon${i}_24.png
  mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
  cp icon${i}_24.png %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/mucommander.png
done
mkdir -p %{buildroot}%{_datadir}/applications/
cp %{_sourcedir}/mucommander.desktop %{buildroot}%{_datadir}/applications/

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc license.txt readme.txt
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/16x16
%dir %{_datadir}/icons/hicolor/16x16/apps
%dir %{_datadir}/icons/hicolor/32x32
%dir %{_datadir}/icons/hicolor/32x32/apps
%dir %{_datadir}/icons/hicolor/48x48
%dir %{_datadir}/icons/hicolor/48x48/apps
%dir %{_datadir}/icons/hicolor/128x128
%dir %{_datadir}/icons/hicolor/128x128/apps
%dir %{_datadir}/icons/hicolor/256x256
%dir %{_datadir}/icons/hicolor/256x256/apps
%{_bindir}/mucommander
%{_javadir}/mucommander.jar
%{_datadir}/applications/mucommander.desktop
%{_datadir}/icons/hicolor/*/apps/mucommander.png

%changelog
* Sun May  2 2021 bongochong@github.com
- updated to 0.9.3-3
* Sun Jul 30 2017 kkirill@opensuse.org
- updated to 0.9.2
* Wed Sep 14 2011 kirill.kirillov@gmail.com
- fixed license tag
* Thu Apr  1 2010 prusnak@suse.cz
- updated to 0.8.5
* Wed Jun 17 2009 radomir.cernoch@gmail.com
- initial package for openSUSE