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: 1.1.0
Release: 0
Url: http://www.lxde.org/
Source0: %name-%version.tar.gz
Source1: %name-rpmlintrc
Patch0: %name-default-config.patch
Patch1: %name-1.1.0-gtk3_doc.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: desktop-file-utils
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gtk-doc
%if 0%{?suse_version} <= 1220
BuildRequires: gtk2-devel
%else
BuildRequires: gtk3-devel
%endif
BuildRequires: intltool
BuildRequires: libexif-devel
BuildRequires: libtool
BuildRequires: menu-cache-devel >= 0.3.2
BuildRequires: update-desktop-files
BuildRequires: vala >= 0.13.0
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 libfm3
Summary: Libfm libraries
Group: System/Libraries
%description -n libfm3
libfm libraries for development
%if 0%{?suse_version} <= 1220
%package -n libfm-gtk3
Summary: GTK2 libfm libraries
Group: System/Libraries
%description -n libfm-gtk3
GTK libfm libraries for development
%else
%package -n libfm-gtk3-3
Summary: GTK3 libfm libraries
Group: System/Libraries
%description -n libfm-gtk3-3
GTK libfm libraries for development
%endif
%package devel
Summary: Devel files for libfm
Group: Development/Libraries/C and C++
Requires: %name = %version
%if 0%{?suse_version} <= 1220
Requires: gtk2-devel
Requires: libfm-gtk3 = %version
%else
Requires: gtk3-devel
Requires: libfm-gtk3-3 = %version
%endif
Requires: libfm3 = %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
%patch0 -p1
%if 0%{?suse_version} > 1220
%patch1 -p1
%endif
%build
%configure \
--disable-static \
%if 0%{?suse_version} > 1220
--with-gtk=3 \
%endif
--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
%__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
%__rm -f %{buildroot}%{_mandir}/man1/libfm-pref-apps.1
%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
%if 0%{?suse_version} <= 1220
%post -n libfm-gtk3 -p /sbin/ldconfig
%postun -n libfm-gtk3 -p /sbin/ldconfig
%else
%post -n libfm-gtk3-3 -p /sbin/ldconfig
%postun -n libfm-gtk3-3 -p /sbin/ldconfig
%endif
%post -n libfm3 -p /sbin/ldconfig
%postun -n libfm3 -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
%files -n libfm3
%defattr(-,root,root)
%{_libdir}/libfm.so.*
%if 0%{?suse_version} <= 1220
%files -n libfm-gtk3
%defattr(-,root,root)
%{_libdir}/libfm-gtk.so.*
%else
%files -n libfm-gtk3-3
%defattr(-,root,root)
%{_libdir}/libfm-gtk3.so.*
%endif
%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-1.0
%{_includedir}/%name-1.0/*.h
%{_libdir}/pkgconfig/%name.pc
%{_libdir}/pkgconfig/%name-gtk.pc
%{_libdir}/pkgconfig/%name-gtk3.pc
%if 0%{?suse_version} <= 1220
%{_libdir}/libfm-gtk.so
%else
%{_libdir}/libfm-gtk3.so
%endif
%{_libdir}/libfm.so
%files doc
%defattr(-,root,root)
%_datadir/gtk-doc/html/libfm
%changelog