F-23: build also gtk2 library

- Move data files to main package
This commit is contained in:
Mamoru TASAKA 2015-07-11 23:59:03 +09:00
parent b726ca65c1
commit f89117d2cf
2 changed files with 217 additions and 27 deletions

View File

@ -0,0 +1,95 @@
--- libfm-8f38f90e04b648637509f2fa2d4208027ae59b5c/configure.ac.moduledir 2015-05-26 01:14:45.000000000 +0900
+++ libfm-8f38f90e04b648637509f2fa2d4208027ae59b5c/configure.ac 2015-06-01 16:59:15.758431997 +0900
@@ -117,12 +117,14 @@ if test x"$ac_with_gtk" != xno; then
LIBFM_GTK_LTLIBRARIES=libfm-gtk3.la
LIBFM_GTK_PC=libfm-gtk3.pc
ac_with_gtk="3.0"
+ LIBFM_GTK_MODULE_DIR_SUFFIX="gtk3"
;;
*)
pkg_modules="$gio_modules gtk+-2.0 >= 2.18.0 pango >= 1.16.0 cairo >= 1.8.0"
LIBFM_GTK_LTLIBRARIES=libfm-gtk.la
LIBFM_GTK_PC=libfm-gtk.pc
ac_with_gtk="2.0"
+ LIBFM_GTK_MODULE_DIR_SUFFIX="gtk"
;;
esac
PKG_CHECK_MODULES(GTK, [$pkg_modules])
@@ -134,6 +136,7 @@ else
LIBFM_GTK_LTLIBRARIES=
LIBFM_GTK_PC=
ac_with_gtk="none"
+ LIBFM_GTK_MODULE_DIR_SUFFIX=""
LIBFM_PREF_APPS=
fi
AC_SUBST(GTK_CFLAGS)
@@ -141,6 +144,7 @@ AC_SUBST(GTK_LIBS)
AC_SUBST(LIBFM_GTK_LTLIBRARIES)
AC_SUBST(LIBFM_PREF_APPS)
AC_SUBST(LIBFM_GTK_PC)
+AC_SUBST(LIBFM_GTK_MODULE_DIR_SUFFIX)
AM_CONDITIONAL([ENABLE_GTK], [test x$ac_with_gtk != xnone])
dnl pango_modules="pango >= 1.16.0"
--- libfm-8f38f90e04b648637509f2fa2d4208027ae59b5c/src/Makefile.am.moduledir 2015-05-26 01:14:45.000000000 +0900
+++ libfm-8f38f90e04b648637509f2fa2d4208027ae59b5c/src/Makefile.am 2015-06-01 16:59:15.759431997 +0900
@@ -313,6 +313,7 @@ libfm_gtk_la_CFLAGS = \
-I$(srcdir)/gtk \
-DPACKAGE_UI_DIR=\""$(datadir)/libfm/ui"\" \
-DPACKAGE_THEME_DIR=\""$(datadir)/libfm/images"\" \
+ -DPACKAGE_MODULES_GTK_DIR=\""$(libdir)/@PACKAGE@/modules/@LIBFM_GTK_MODULE_DIR_SUFFIX@"\" \
$(GTK_CFLAGS) \
$(MENU_CACHE_CFLAGS) \
$(NULL)
--- libfm-8f38f90e04b648637509f2fa2d4208027ae59b5c/src/fm-gtk.c.moduledir 2015-06-01 17:04:33.951498868 +0900
+++ libfm-8f38f90e04b648637509f2fa2d4208027ae59b5c/src/fm-gtk.c 2015-06-01 17:04:59.933504328 +0900
@@ -57,6 +57,7 @@ gboolean fm_gtk_init(FmConfig* config)
if no theme was selected and GTK fallback isn't available then no icons
are shown - we should add folder and file icons as fallbacks theme */
gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), PACKAGE_THEME_DIR);
+ fm_modules_add_directory(PACKAGE_MODULES_GTK_DIR);
_fm_icon_pixbuf_init();
_fm_thumbnail_init();
_fm_file_properties_init();
--- libfm-8f38f90e04b648637509f2fa2d4208027ae59b5c/src/modules/Makefile.am.moduledir 2015-05-26 01:14:45.000000000 +0900
+++ libfm-8f38f90e04b648637509f2fa2d4208027ae59b5c/src/modules/Makefile.am 2015-06-01 16:59:15.759431997 +0900
@@ -18,6 +18,7 @@ LIBS += $(top_builddir)/src/libfm.la
# change default and put modules below usual place
pkglibdir = $(libdir)/@PACKAGE@/modules
+pkggtklibdir = $(libdir)/@PACKAGE@/modules/@LIBFM_GTK_MODULE_DIR_SUFFIX@
# modules to compile
pkglib_LTLIBRARIES = \
@@ -25,11 +26,14 @@ pkglib_LTLIBRARIES = \
vfs-search.la \
$(NULL)
+pkggtklib_LTLIBRARIES = \
+ $(NULL)
+
if ENABLE_GTK
if HAVE_ACTIONS
-pkglib_LTLIBRARIES += gtk-menu-actions.la
+pkggtklib_LTLIBRARIES += gtk-menu-actions.la
endif
-pkglib_LTLIBRARIES += \
+pkggtklib_LTLIBRARIES += \
gtk-fileprop-x-desktop.la \
gtk-fileprop-x-shortcut.la \
gtk-menu-trash.la \
@@ -39,10 +43,14 @@ endif
# install only .so files, we don't need .la files
install-exec-hook:
rm -f $(DESTDIR)$(pkglibdir)/*.la
+ rm -f $(DESTDIR)$(pkggtklibdir)/*.la
PLUGINS_INSTALLED = $(pkglib_LTLIBRARIES:.la=.so)
+PLUGINS_GTK_INSTALLED = $(pkggtklib_LTLIBRARIES:.la=.so)
+
uninstall-hook:
cd $(DESTDIR)$(pkglibdir) && rm -f $(PLUGINS_INSTALLED) || true
+ test -n "$(PLUGINS_GTK_INSTALLED)" && cd $(DESTDIR)$(pkggtklibdir) && rm -f $(PLUGINS_GTK_INSTALLED) || true
# module-specific parameters
vfs_menu_la_CFLAGS = $(MENU_CACHE_CFLAGS) -I$(top_srcdir)/src/extra

View File

@ -8,7 +8,7 @@
%global prerpmver %(echo "%{?prever}" | sed -e 's|-||g')
%global usegit 1
%global mainrel 9
%global mainrel 10
%global githash e1de98ccba316605e14d8cfc06df9a55752cdcec
%global shorthash %(TMP=%githash ; echo ${TMP:0:10})
@ -25,7 +25,7 @@
Name: libfm
Version: %{mainver}
Release: %{fedorarel}%{?dist}.1
Release: %{fedorarel}%{?dist}
Summary: GIO-based library for file manager-like programs
Group: System Environment/Libraries
@ -39,9 +39,14 @@ Source0: http://downloads.sourceforge.net/pcmanfm/%{name}-%{mainver}%{?pr
# Fedora specific patches
# Firefox uses firefox.desktop for desktop name, drop
#Patch0: libfm-0.1.9-pref-apps.patch
# http://sourceforge.net/p/pcmanfm/feature-requests/385/
Patch1000: http://sourceforge.net/p/pcmanfm/feature-requests/_discuss/thread/0a50a386/597e/attachment/libfm-1.2.3-moduledir-gtkspecific-v02.patch
BuildRequires: libexif-devel
BuildRequires: gtk3-devel
%if 0%{?fedora} >= 23
BuildRequires: gtk2-devel
%endif
BuildRequires: menu-cache-devel >= 0.3.2
BuildRequires: gettext
@ -91,7 +96,22 @@ related operations such as copy & paste, drag & drop, file associations or
thumbnail support. By utilizing glib/gio and gvfs, libfm can access remote
file systems supported by gvfs.
This package provides useful file manager-related GTK+ widgets.
This package provides useful file manager-related GTK+ 3 widgets.
%package gtk2
Summary: File manager-related GTK+ widgets of %{name}
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: gvfs
%description gtk2
libfm is a GIO-based library used to develop file manager-like programs. It is
developed as the core of next generation PCManFM and takes care of all file-
related operations such as copy & paste, drag & drop, file associations or
thumbnail support. By utilizing glib/gio and gvfs, libfm can access remote
file systems supported by gvfs.
This package provides useful file manager-related GTK+ 2 widgets.
%package gtk-utils
Summary: GTK+ related utility package for %{name}
@ -116,16 +136,37 @@ The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package gtk-devel-common
Summary: Common Development files for %{name}-gtk
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
BuildArch: noarch
%description gtk-devel-common
The %{name}-gtk-devel package contains common header files for
developing applications that use %{name}-gtk.
%package gtk-devel
Summary: Development files for %{name}-gtk
Group: Development/Libraries
Requires: %{name}-gtk%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-gtk-devel-common = %{version}-%{release}
%description gtk-devel
The %{name}-devel package contains libraries and header files for
The %{name}-gtk-devel package contains libraries files for
developing applications that use %{name}-gtk.
%package gtk2-devel
Summary: Development files for %{name}-gtk2
Group: Development/Libraries
Requires: %{name}-gtk2%{?_isa} = %{version}-%{release}
Requires: %{name}-gtk-devel-common = %{version}-%{release}
%description gtk2-devel
The %{name}-gtk2-devel package contains libraries files for
developing applications that use %{name}-gtk2.
%package devel-docs
Summary: Development documation for %{name}
Group: Development/Libraries
@ -139,6 +180,10 @@ This package containg development documentation files for %{name}.
#%%patch0 -p1 -b .orig
%setup -q -n %{name}-%{githash}
%if 0%{?fedora} >= 23
%patch1000 -p1
%endif
%if 0%{?usegit} >= 1
sh autogen.sh
%endif
@ -149,23 +194,34 @@ sed -i.libdir_syssearch \
configure
%build
%configure \
--enable-gtk-doc \
--enable-udisks \
--with-gtk=3 \
%if 0
--enable-demo \
for ver in \
%if 0%{?fedora} >= 23
2 \
%endif
--disable-silent-rules \
--disable-static
3 \
%{nil}
do
%configure \
--enable-gtk-doc \
--enable-udisks \
--with-gtk=${ver} \
%if 0
--enable-demo \
%endif
--disable-silent-rules \
--disable-static
# To show translation status
make -C po -j1 GMSGFMT="msgfmt --statistics"
make %{?_smp_mflags} -k
# To show translation status
make -C po -j1 GMSGFMT="msgfmt --statistics"
make %{?_smp_mflags} -k
make install DESTDIR=$(pwd)/INSTDIR-gtk${ver}
test "$ver" == 2 && make clean
done
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'
# GTK3
cp -a INSTDIR-gtk3/* $RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libfm-gtk.pc
@ -183,21 +239,40 @@ do
do
if [ -f src/$dir/$bf ]
then
echo %_includedir/%name-1.0/$bf >> base-header.files
echo %_includedir/%name-1.0/$bf >> base-header.files
fi
done
for dir in gtk
do
if [ -f src/$dir/$bf ]
then
echo %_includedir/%name-1.0/$bf >> gtk-header.files
echo %_includedir/%name-1.0/$bf >> gtk-header.files
fi
done
done
# GTK2
%if 0%{?fedora} >= 23
pushd INSTDIR-gtk2
find . -name '*.la' -exec rm -f {} ';'
rm -f .{_libdir}/pkgconfig/libfm-gtk3.pc
diff -urNp .%{_includedir}/%{name}-1.0 $RPM_BUILD_ROOT%{_includedir}/%name-1.0
diff -urNp .%{_datadir}/%{name} $RPM_BUILD_ROOT/%{_datadir}/%{name}
cp -a ./%{_libdir}/libfm-gtk* $RPM_BUILD_ROOT%{_libdir}
cp -a ./%{_libdir}/pkgconfig/libfm-gtk.pc \
$RPM_BUILD_ROOT%{_libdir}/pkgconfig/
cp -a ./%{_libdir}/libfm/modules/gtk/ \
$RPM_BUILD_ROOT%{_libdir}/libfm/modules/
popd
%endif
/usr/lib/rpm/check-rpaths
%check
find INSTDIR-gtk* -name \*.ui >> po/POTFILES.skip
make check
%post
@ -222,9 +297,12 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
%post gtk -p /sbin/ldconfig
%postun gtk -p /sbin/ldconfig
%if %{?fedora} >= 23
%post gtk2 -p /sbin/ldconfig
%postun gtk2 -p /sbin/ldconfig
%endif
%files -f %{name}.lang
%defattr(-,root,root,-)
# FIXME: Add ChangeLog if not empty
%doc AUTHORS
%doc COPYING
@ -232,6 +310,9 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
%doc README
%dir %{_sysconfdir}/xdg/libfm/
%config(noreplace) %{_sysconfdir}/xdg/libfm/libfm.conf
%{_datadir}/%{name}/
%{_libdir}/%{name}.so.4*
%{_libdir}/%{name}-extra.so.4*
%dir %{_libdir}/libfm
@ -242,13 +323,14 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
%files gtk
%{_libdir}/%{name}-gtk3.so.4*
#%%dir %%{_libdir}/libfm/
#%%{_libdir}/libfm/gnome-terminal
%{_datadir}/libfm/
%if 0%{?fedora} < 23
%{_libdir}/libfm/modules/gtk-*.so
%else
%{_libdir}/libfm/modules/gtk3/
%endif
%files gtk-utils
%defattr(-,root,root,-)
%{_mandir}/man1/libfm-pref-apps.1.*
%{_mandir}/man1/lxshortcut.1.*
%{_bindir}/libfm-pref-apps
@ -258,7 +340,6 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
%files devel -f base-header.files
%defattr(-,root,root,-)
%doc TODO
%{_includedir}/libfm
%dir %{_includedir}/libfm-1.0/
@ -267,21 +348,35 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
%{_libdir}/pkgconfig/libfm.pc
%{_libdir}/pkgconfig/libfm-extra.pc
%files gtk-devel -f gtk-header.files
%defattr(-,root,root,-)
%files gtk-devel-common -f gtk-header.files
%{_includedir}/libfm-1.0/fm-gtk.h
%files gtk-devel
%{_libdir}/%{name}-gtk3.so
%{_libdir}/pkgconfig/libfm-gtk3.pc
%if 0%{?fedora} >= 23
%files gtk2
%{_libdir}/%{name}-gtk.so.4*
%{_libdir}/libfm/modules/gtk/
%files gtk2-devel
%{_libdir}/%{name}-gtk.so
%{_libdir}/pkgconfig/libfm-gtk.pc
%endif
%if 0%{?build_doc}
%files devel-docs
%defattr(-,root,root,-)
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%{_datadir}/gtk-doc/html/%{name}
%endif
%changelog
* Sun Jun 14 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.2.3-10D20150607gite1de98ccba
- F-23: build also gtk2 library
- Move data files to main package
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-9.D20150607gite1de98ccba.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild