File libfm.spec of Package libfm

#
# spec file for package libfm
#
# Copyright (c) 2011 SUSE LINUX Products 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/
#

# norootforbuild


Name:           libfm
Summary:        A glib/gio-based lib used to develop file managers
Version:        0.1.14_rc2
Release:        3
License:        GPLv2
Group:          Development/Libraries/C and C++
Url:            http://www.lxde.org/
Source0:        %name-0.1.14.tar.bz2
Source1:        %name-rpmlintrc
Patch0:         %name-default-config.patch
Patch1:         %name-0.1.14-remove_rpath.patch
# PATCH-FIX-UPSTREAM libfm-0.1.14-fix_sf3089624.patch <andrea@opensuse.org>- fixed "Filenames with spaces not supported in copy/paste"
Patch2:         %name-0.1.14-fix_sf3089624.patch
Patch3:         %name-0.1.14-disable-gio-extension.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  gcc-c++
BuildRequires:  gtk2-devel
BuildRequires:  gtk-doc
BuildRequires:  intltool
BuildRequires:  menu-cache-devel >= 0.3.2
BuildRequires:  desktop-file-utils
BuildRequires:  update-desktop-files
BuildRequires:  fdupes
BuildRequires:  autoconf
BuildRequires:  gtk-doc

%description
A glib/gio-based lib used to develop file managers providing some
file management utilities and related-widgets missing in gtk+/glib.

%package -n libfm0
License:        GPLv2
Group:          System/Libraries
Summary:        Libfm libraries

%description  -n libfm0
libfm libraries for development

%package -n libfm-gtk0
License:        GPLv2
Group:          System/Libraries
Summary:        GTK libfm libraries

%description  -n libfm-gtk0
GTK libfm libraries for development

%package devel
License:        GPLv2
Group:          Development/Libraries/C and C++
Summary:        Devel files for libfm
Requires:       libfm0 = %version
Requires:       libfm-gtk0 = %version
Requires:       %name = %version
Requires:       gtk2-devel
Requires:       glib2-devel
Requires:       pkg-config

%description devel
A glib/gio-based lib used to develop file managers providing some
file management utilities and related-widgets missing in gtk+/glib.

%package doc
License:        GPLv2
Group:          Documentation/Other
Summary:        GTK libfm libraries
Requires:       %name >= %version

%description doc
libfm developers documentation

%prep
%setup -q -n %name-0.1.14
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build
autoreconf -fi
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"
%configure \
	--disable-static \
	--enable-debug \
	--enable-gtk-doc

# remove rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool 

%__make

%install
%makeinstall
%__rm -rf %{buildroot}/%{_datadir}/locale/{es_VE,ur_PK}
%__rm -f %{buildroot}%{_libdir}/*.la
%__rm -f %{buildroot}/%{_libdir}/gio/modules/libgiofm.la
# these settings will have no effect without the gio extension so remove them
%if 0%{?suse_version} >= 1140
%__rm -f %{buildroot}%{_sysconfdir}/xdg/%name/pref-apps.conf
%__rm -f %{buildroot}%{_bindir}/libfm-pref-apps
%__rm -f %{buildroot}%{_datadir}/applications/libfm-pref-apps.desktop
%else
%suse_update_desktop_file libfm-pref-apps
%endif
%find_lang %{name}
%fdupes -s %{buildroot}/%{_datadir}/locale

%post
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
/usr/bin/update-desktop-database                                

%postun
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
/usr/bin/update-desktop-database                                

%post -n libfm-gtk0 -p /sbin/ldconfig

%postun -n libfm-gtk0 -p /sbin/ldconfig

%post -n libfm0 -p /sbin/ldconfig

%postun -n libfm0 -p /sbin/ldconfig

%clean
rm -rf %{buildroot}

%files -f %name.lang
%defattr(-,root,root)
%dir %{_sysconfdir}/xdg/%name
%config %{_sysconfdir}/xdg/%name/%name.conf
%{_datadir}/mime/packages/%name.xml
%dir %{_libdir}/%name
%{_libdir}/%name/gnome-terminal
%if 0%{?suse_version} < 1140
%config %{_sysconfdir}/xdg/%name/pref-apps.conf
%{_bindir}/libfm-pref-apps
%{_datadir}/applications/libfm-pref-apps.desktop
%endif

%files -n libfm0
%defattr(-,root,root)
%{_libdir}/libfm.so.*
%if 0%{?suse_version} < 1140
%{_libdir}/gio/modules/libgiofm.so
%endif

%files -n libfm-gtk0
%defattr(-,root,root)
%{_libdir}/libfm-gtk.so.*
%dir %{_datadir}/%name
%dir %{_datadir}/%name/ui
%_datadir/%name/archivers.list
%{_datadir}/%name/ui/*.ui

%files devel
%defattr(-,root,root)
%dir %{_includedir}/%name
%dir %{_includedir}/%name/%name
%{_includedir}/%name/%name/*.h
%{_libdir}/pkgconfig/%name.pc
%{_libdir}/pkgconfig/%name-gtk.pc
%{_libdir}/libfm-gtk.so
%{_libdir}/libfm.so

%files doc
%defattr(-,root,root)
%_datadir/gtk-doc/html/libfm

%changelog
openSUSE Build Service is sponsored by