File xfe.spec of Package xfe

#
# spec file for package xfe
#
# Copyright (c) 2007-2013  SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015  SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright SUSE Software Solutions Germany 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 https://bugs.opensuse.org/
#


Name:           xfe
Version:        1.44
Release:        0
Summary:        A filemanager for X
License:        GPL-2.0-or-later
Group:          Productivity/File utilities
URL:            http://roland65.free.fr/xfe/index.php
BuildRequires:  automake
BuildRequires:  fox16-devel
BuildRequires:  intltool
BuildRequires:  libpng-devel >= 1.2
Requires:       bzip2
Requires:       file
Requires:       fox >= 1.6
Requires:       gzip
Requires:       libpng >= 1.2
Requires:       tar
Requires:       unzip
Requires:       zip
#
# SUSE Requires
#
%if 0%{?suse_version}
BuildRequires:  bzip2
BuildRequires:  cups-devel
BuildRequires:  cups-libs
BuildRequires:  fdupes
BuildRequires:  freetype2-devel
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  libjpeg-devel
BuildRequires:  libtiff-devel
BuildRequires:  make
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-Mesa
BuildRequires:  xorg-x11-Mesa-devel
BuildRequires:  xorg-x11-devel
BuildRequires:  xorg-x11-libs
BuildRequires:  zlib-devel
Requires:       xterm
Recommends:     MozillaFirefox
Recommends:     fbreader
Recommends:     gimp
Recommends:     gv
Recommends:     inkscape
Recommends:     p7zip
Recommends:     xarchiver
Recommends:     xfe-themes
Recommends:     xine
Recommends:     xpdf
%endif
#
# Fedora Requires
#
%if 0%{?fedora_version}
BuildRequires:  cups-devel
BuildRequires:  cups-libs
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  xorg-x11-devel
%endif
#
# Mandriva Requires
#
%if 0%{?mandriva_version}
BuildRequires:  cups
BuildRequires:  cups-common
BuildRequires:  xorg-x11
%endif
#
Source:         %{name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=311018
Patch1:         06_no-mount-warning.patch 
Patch3:         13_webm-support-in-xferc.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
X File Explorer (Xfe) is a filemanager for X. It is based on the X
Win Commander, which is discontinued. Xfe is desktop-independent and
is written with the C++ Fox Toolkit. It has Windows Commander or
MS-Explorer look. The main features are: file associations,
mount/umount devices, directory tree for quick cd, change file
attributes, auto save registry, compressed archives
view/creation/extraction.

%package themes
Summary:        Xfe themes for KDE, GNOME and Xfce
Group:          Productivity/File utilities
Requires:       xfe >= %{version}

%description themes
This package contains xfe themes for KDE, GNOME and Xfce.

X File Explorer (Xfe) is a filemanager for X. It is based on the X
Win Commander, which is discontinued. Xfe is desktop-independent and
is written with the C++ Fox Toolkit. It has Windows Commander or
MS-Explorer look.

%prep
%setup -q
%patch1 -p1
%patch3 -p1
# fix the search path for xfs themes:
sed -i "s|usr/local/share|usr/share|" src/xfedefs.h
# fix default theme
sed -i "s|^iconpath.*|iconpath = @prefix@/share/xfe/icons/xfe-theme|" xferc.in
# fix encoding
for i in BUGS ChangeLog README; do
	iconv -f iso-8859-1 -t utf-8 <"$i" >"$i.tmp"
	mv "$i.tmp" "$i"
done
# fix categories in desktop files
sed -i "s|Categories=.*|Categories=Graphics;Viewer;|" xfi.desktop.in.in
sed -i "s|Categories=.*|Categories=Settings;System;SystemSetup;|" xfp.desktop.in.in
#sed -i "s|Categories=.*|Categories=Utility;TextEditor;|" xfv.desktop.in.in
sed -i "s|Categories=.*|Categories=Utility;TextEditor;|" xfw.desktop.in.in

%build
%if 0%{?fedora_version}
%ifarch ix86
CFLAGS='-O2 -g -march=i586 -mtune=i686'
export CFLAGS
CXXFLAGS='-O2 -g -march=i586 -mtune=i686'
export CXXFLAGS
FFLAGS='-O2 -g -march=i586 -mtune=i686'
export FFLAGS
%endif
%endif
autoreconf -fi
%configure --without-included-gettext \
           --with-static=no \
           --with-x \
           --with-xrandr \
           --enable-sn \
           --disable-rpath \
           --enable-threads='posix' \
           --enable-release
make %{?_smp_mflags}

%install
%make_install
# move the xferc to _sysconfidir to follow the FHS
mkdir -p %{buildroot}%{_sysconfdir}/xfe
mv %{buildroot}%{_datadir}/xfe/xferc %{buildroot}%{_sysconfdir}/xfe/
ln -s %{_sysconfdir}/xfe/xferc %{buildroot}%{_datadir}/xfe/xferc
#
# SUSE specials
#
%if 0%{?suse_version} > 1020
# wrong locale dir
mv %{buildroot}%{_datadir}/locale/pt_PT %{buildroot}%{_datadir}/locale/pt
mv %{buildroot}%{_datadir}/locale/no %{buildroot}%{_datadir}/locale/nb
%suse_update_desktop_file -c %{name} "X File Explorer" "File Manager" xfe xfe.png Application System FileManager
for file in xfi xfp xfw; do
	%suse_update_desktop_file $file
done
if [ -f %{buildroot}%{_datadir}/locale/locale.alias ]; then
    rm %{buildroot}%{_datadir}/locale/locale.alias
fi
%fdupes %{buildroot}
%find_lang %{name}
%endif

%if 0%{?fedora_version}
%files
%else
%files -f %{name}.lang
%endif
%defattr(644,root,root,755)
%doc ABOUT-NLS AUTHORS BUGS ChangeLog README TODO
%if 0%{?suse_version} > 1500
%license COPYING
%else
%doc COPYING
%endif
%dir %{_sysconfdir}/xfe
%config(noreplace) %{_sysconfdir}/xfe/xferc
%attr(755,root,root) %{_bindir}/*
%{_datadir}/pixmaps/*
%{_mandir}/man1/*
%dir %{_datadir}/xfe/
%{_datadir}/xfe/xferc
%dir %{_datadir}/xfe/icons
%{_datadir}/applications/*.desktop
%if 0%{?fedora_version}
%{_datadir}/locale/*/LC_MESSAGES/xfe.mo
%endif

%files themes
%defattr(644,root,root,755)
%{_datadir}/xfe/icons/*

%changelog
openSUSE Build Service is sponsored by