# Multiple files refers to the name "4Pane", not "4pane", so
# let's use 4Pane as %%{name}
# Explicitly declare this, as this package
# really expects this
# (expanded afterwards, use %%define)
%define _docdir_fmt %{NAME}
%undefine _hardened_build
Name: 4Pane
Version: 3.0
Release: 7{?dist}
Summary: Multi-pane, detailed-list file manager
License: GPLv3
URL: http://www.4pane.co.uk/
Source0: http://downloads.sourceforge.net/fourpane/4pane-%{version}.tar.gz
# https://sourceforge.net/p/fourpane/discussion/767206/thread/9daf0cda/
Patch1: 4Pane-HEAD-0001-When-getting-a-pointer-to-a-menubar-menu-don-t-searc.patch
# http://sourceforge.net/p/fourpane/feature-requests/9/
Patch2: 4Pane-HEAD-0002-Add-the-man-page-to-git.patch
# http://sourceforge.net/p/fourpane/feature-requests/10/
Patch3: 4Pane-HEAD-0003-Add-an-appdata-file-see-https-sourceforge.net-p-four.patch
Patch4: 4Pane-HEAD-0004-Correct-the-use-of-DESTDIR-in-the-last-commit.patch
# Request from the upstream
Patch5: 4Pane-HEAD-0005-Make-the-toolbar-the-correct-size-for-its-tools-in-g.patch
BuildRequires: bzip2-devel
BuildRequires: xz-devel
BuildRequires: wxGTK3-devel
BuildRequires: desktop-file-utils
BuildRequires: git
%description
4Pane is a multi-pane, detailed-list file manager. It is designed
to be fully-featured without bloat, and aims for speed rather than
visual effects.
In addition to standard file manager things, it offers multiple
undo and redo of most operations (including deletions), archive
management including 'virtual browsing' inside archives, multiple
renaming/duplication of files, a terminal emulator and user-defined
tools.
%prep
%setup -q -n 4pane-%{version}
cat > .gitignore <<EOF
configure
config.guess
config.sub
aclocal.m4
config.h.in
EOF
git init
git config user.email "4Pane-owner@fedoraproject.org"
git config user.name "4Pane owners"
git add .
git commit -m "base" -q
cat %PATCH1 | git am
cat %PATCH2 | git am
cat %PATCH3 | git am
cat %PATCH4 | git am
cat %PATCH5 | git am
sed -i -e '\@Icon=@s|^.*$|Icon=%{name}|' rc/%{name}.desktop
git commit -m "Fix icon entry in desktop file" -a
%build
export WX_CONFIG_NAME=wx-config-3.0
export EXTRA_CXXFLAGS="%{optflags}"
# --without-builtin_bzip2 means using system bzip2
%configure\
--disable-desktop \
--without-builtin_bzip2 || \
{ sleep 5 ; cat config.log ; sleep 10 ; exit 1; }
make %{?_smp_mflags}
%install
%make_install \
INSTALL="install -p"
# Some manual installation
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/{48x48,32x32}/apps
install -cpm 644 rc/%{name}.desktop %{buildroot}%{_datadir}/applications/
install -cpm 644 bitmaps/%{name}Icon32.xpm %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.xpm
install -cpm 644 bitmaps/%{name}Icon48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
mkdir -p %{buildroot}%{_mandir}/man1
install -cpm 644 4Pane.1 %{buildroot}%{_mandir}/man1/
%find_lang %{name}
# Once remove document and let %%doc re-install them
rm -rf %{buildroot}%{_docdir}/%{name}
%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
if [ $1 -eq 0 ] ; then
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files -f %{name}.lang
%license LICENCE
%doc doc/*
%doc README
%doc changelog
%{_bindir}/4pane
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
%if 0%{?fedora} >= 21
%{_datadir}/appdata/%{name}.appdata.xml
%endif
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}*
%changelog
* Mon May 4 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.0-7
- Kill hardened build, does not build
* Mon Dec 22 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.0-6
- Patch for toolbar issue, requested by the upstream
* Sun Dec 21 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.0-5
- Add man page, appdata (on F-21+)
* Thu Dec 11 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.0-3
- Replace Patch0 with the one revised by the upstream
* Wed Dec 10 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.0-2
- Patch to fix crash with managing bookmark on non-English
locale (sourceforge 767206)
* Tue Dec 9 2014 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.0-1
- Initial package