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.16_rc3
Release:        0.<RELEASE2>
License:        GPLv2
Group:          Development/Libraries/C and C++
Url:            http://www.lxde.org/
Source0:        %name-0.1.16.tar.bz2
Source1:        %name-rpmlintrc
Patch0:         %name-default-config.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
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
License:        GPLv2
Group:          System/Libraries
Summary:        Libfm libraries

%description  -n libfm1
libfm libraries for development

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

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

%package devel
License:        GPLv2
Group:          Development/Libraries/C and C++
Summary:        Devel files for libfm
Requires:       libfm1 = %version
Requires:       libfm-gtk1 = %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.16
%patch0 -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

%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

%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
%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
openSUSE Build Service is sponsored by