From 7cb8976b9429d195c6c007ebe426c82186ec54e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Mon, 1 Nov 2021 10:18:07 +0100 Subject: [PATCH] RPM: switch kscope to cmake build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot --- redhat/applications/kscope/kscope.spec | 59 ++++++++++++++------------ 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/redhat/applications/kscope/kscope.spec b/redhat/applications/kscope/kscope.spec index 8375a8c4c..102c785e0 100644 --- a/redhat/applications/kscope/kscope.spec +++ b/redhat/applications/kscope/kscope.spec @@ -63,7 +63,7 @@ BuildRequires: desktop-file-utils BuildRequires: gettext Requires: cscope -BuildRequires: autoconf automake libtool m4 +BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: fdupes @@ -123,45 +123,47 @@ Main Features: %prep %setup -q -n %{name}-%{tde_version}%{?preversion:~%{preversion}} -%__cp -f "/usr/share/aclocal/libtool.m4" "admin/libtool.m4.in" -%__cp -f "/usr/share/libtool/"*"/ltmain.sh" "admin/ltmain.sh" || %__cp -f "/usr/share/libtool/ltmain.sh" "admin/ltmain.sh" -%__make -f "admin/Makefile.common" - %build unset QTDIR QTINC QTLIB export PATH="%{tde_bindir}:${PATH}" - -%configure \ - --prefix=%{tde_prefix} \ - --exec-prefix=%{tde_prefix} \ - --bindir=%{tde_bindir} \ - --libdir=%{tde_libdir} \ - --mandir=%{tde_mandir} \ - --datadir=%{tde_datadir} \ - --includedir=%{tde_tdeincludedir} \ +export PKG_CONFIG_PATH="%{tde_libdir}/pkgconfig" + +if ! rpm -E %%cmake|grep -q "cd build"; then + %__mkdir_p build + cd build +fi + +# Warning: GCC visibility causes FTBFS [Bug #1285] +%cmake \ + -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ + -DCMAKE_C_FLAGS="${RPM_OPT_FLAGS}" \ + -DCMAKE_CXX_FLAGS="${RPM_OPT_FLAGS}" \ + -DCMAKE_SKIP_RPATH=OFF \ + -DCMAKE_INSTALL_RPATH="%{tde_libdir}" \ + -DCMAKE_NO_BUILTIN_CHRPATH=ON \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DWITH_GCC_VISIBILITY=OFF \ + \ + -DBIN_INSTALL_DIR=%{tde_bindir} \ + -DCONFIG_INSTALL_DIR="%{tde_confdir}" \ + -DINCLUDE_INSTALL_DIR=%{tde_tdeincludedir} \ + -DLIB_INSTALL_DIR=%{tde_libdir} \ + -DSHARE_INSTALL_PREFIX=%{tde_datadir} \ \ - --disable-dependency-tracking \ - --disable-debug \ - --enable-new-ldflags \ - --enable-final \ - --enable-closure \ - --enable-rpath \ - --disable-gcc-hidden-visibility - -%__make %{?_smp_mflags} + -DWITH_ALL_OPTIONS=ON \ + -DBUILD_ALL=ON \ + .. + +%__make %{?_smp_mflags} || %__make %install %__rm -rf $RPM_BUILD_ROOT -%__make install DESTDIR=$RPM_BUILD_ROOT +%__make install DESTDIR=$RPM_BUILD_ROOT -C build %find_lang %{tde_pkg} -# Move desktop icon to correct location -%__mkdir_p "%{?buildroot}%{tde_tdeappdir}" -%__mv -f "%{?buildroot}%{tde_datadir}/applnk/"*"/%{tde_pkg}.desktop" "%{?buildroot}%{tde_tdeappdir}" - # Updates applications categories for openSUSE %if 0%{?suse_version} %suse_update_desktop_file %{tde_pkg} Development IDE @@ -181,6 +183,7 @@ export PATH="%{tde_bindir}:${PATH}" %{tde_tdedocdir}/HTML/en/kscope/ %{tde_datadir}/icons/hicolor/*/apps/kscope.png %{tde_datadir}/icons/locolor/*/apps/kscope.png +%{tde_mandir}/man1/kscope.1* %changelog