File libfm.spec of Package libfm

#
# spec file for package libfm
#
# Copyright (c) 2012 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/
#


Name:           libfm
Summary:        A glib/gio-based lib used to develop file managers
License:        GPL-2.0
Group:          Development/Libraries/C and C++
Version:        0.1.17_rc4
Release:        0
Url:            http://www.lxde.org/
Source0:        %name-0.1.17.tar.bz2
Source1:        %name-rpmlintrc
Patch0:         %name-default-config.patch
Patch1:         libfm-automake.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf >= 2.63
BuildRequires:  desktop-file-utils
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gtk-doc
BuildRequires:  gtk2-devel
BuildRequires:  intltool
BuildRequires:  libtool
BuildRequires:  menu-cache-devel >= 0.3.2
BuildRequires:  update-desktop-files
PreReq:         desktop-file-utils
PreReq:         shared-mime-info

%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 libfm1
Summary:        Libfm libraries
Group:          System/Libraries

%description  -n libfm1
libfm libraries for development

%package -n libfm-gtk1
Summary:        GTK libfm libraries
Group:          System/Libraries

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

%package devel
Summary:        Devel files for libfm
Group:          Development/Libraries/C and C++
Requires:       %name = %version
Requires:       glib2-devel
Requires:       gtk2-devel
Requires:       libfm-gtk1 = %version
Requires:       libfm1 = %version
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
Summary:        GTK libfm libraries
Group:          Documentation/Other
Requires:       %name >= %version

%description doc
libfm developers documentation

%prep
%setup -q -n %name-0.1.17
%patch -P 0 -P 1 -p1

%build
autoreconf -fi
%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 %{?_smp_mfalgs}

%install
%makeinstall
%__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-gtk1 -p /sbin/ldconfig

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

%post -n libfm1 -p /sbin/ldconfig

%postun -n libfm1 -p /sbin/ldconfig

%files -f %name.lang
%defattr(-,root,root)
%dir %{_sysconfdir}/xdg/%name
%config %{_sysconfdir}/xdg/%name/%name.conf
%{_datadir}/mime/packages/%name.xml
%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 libfm1
%defattr(-,root,root)
%{_libdir}/libfm.so.*
%if 0%{?suse_version} < 1140
%{_libdir}/gio/modules/libgiofm.so
%endif

%files -n libfm-gtk1
%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