- back to gtk+2 due to lxpanel problems with gtk+3
authorMarcin Krol <hawk@tld-linux.org>
Fri, 17 Jul 2015 22:08:30 +0000 (22:08 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Fri, 17 Jul 2015 22:08:30 +0000 (22:08 +0000)
- added gtk bconds

libfm.spec

index da5f572c337556107ea7421f732ef70314124811..25d449a738e0b16d7d14fc52a2837fc30e41c597 100644 (file)
@@ -1,12 +1,14 @@
 #
 # Conditional build:
-%bcond_without apidocs         # disable gtk-doc
+%bcond_without         apidocs # disable gtk-doc
+%bcond_with            gtk3    # build GTK+3 disables GTK+2
+%bcond_without         gtk2    # build with GTK+2
 
 Summary:       Helper library for pcmanfm
 Summary(pl.UTF-8):     Biblioteka pomocnicza do pcmanfm
 Name:          libfm
 Version:       1.2.3
-Release:       1
+Release:       2
 License:       GPL v2+
 Group:         Libraries
 Source0:       http://downloads.sourceforge.net/pcmanfm/%{name}-%{version}.tar.xz
@@ -17,7 +19,8 @@ BuildRequires:        cairo-devel >= 1.8.0
 BuildRequires: dbus-glib-devel
 BuildRequires: gettext-tools
 BuildRequires: glib2-devel >= 1:2.27.0
-BuildRequires: gtk+3-devel >= 3.0.0
+%{?with_gtk2:BuildRequires:    gtk+2-devel >= 2:2.12.0}
+%{?with_gtk3:BuildRequires:    gtk+3-devel}
 %{?with_apidocs:BuildRequires: gtk-doc}
 BuildRequires: intltool >= 0.40.0
 BuildRequires: libexif-devel
@@ -94,7 +97,7 @@ Dokumentacja API LIBFM.
        %{?with_apidocs:--with-html-dir=%{_gtkdocdir}} \
        --enable-exif \
        --enable-udisks \
-       --with-gtk=3
+       --with-gtk=%{!?with_gtk3:2}%{?with_gtk3:3}
 %{__make}
 
 %install
@@ -106,7 +109,7 @@ rm -rf $RPM_BUILD_ROOT
 # pkg-config present, so drop .la
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libfm.la
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libfm-extra.la
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libfm-gtk3.la
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libfm-gtk%{?with_gtk3:3}.la
 
 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/tt_RU
 
@@ -140,8 +143,8 @@ rm -rf $RPM_BUILD_ROOT
 # -gtk
 #%config(noreplace) %verify(not md5 mtime size) /etc/xdg/libfm/pref-apps.conf
 %attr(755,root,root) %{_bindir}/libfm-pref-apps
-%attr(755,root,root) %{_libdir}/libfm-gtk3.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libfm-gtk3.so.4
+%attr(755,root,root) %{_libdir}/libfm-gtk%{?with_gtk3:3}.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libfm-gtk%{?with_gtk3:3}.so.4
 %{_desktopdir}/libfm-pref-apps.desktop
 %{_desktopdir}/lxshortcut.desktop
 %{_mandir}/man1/libfm-pref-apps.1*
@@ -151,17 +154,17 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %{_includedir}/libfm
 %{_libdir}/libfm-extra.so
-%{_libdir}/libfm-gtk3.so
+%{_libdir}/libfm-gtk%{?with_gtk3:3}.so
 %{_libdir}/libfm.so
 %{_pkgconfigdir}/libfm-extra.pc
-%{_pkgconfigdir}/libfm-gtk3.pc
+%{_pkgconfigdir}/libfm-gtk%{?with_gtk3:3}.pc
 %{_pkgconfigdir}/libfm.pc
 %{_includedir}/libfm-1.0
 
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libfm-extra.a
-%{_libdir}/libfm-gtk3.a
+%{_libdir}/libfm-gtk%{?with_gtk3:3}.a
 %{_libdir}/libfm.a
 
 %if %{with apidocs}