From 503a3d9b486c36b8a1c52f9628af8ce2224c0849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Thu, 3 Feb 2022 16:32:40 +0100 Subject: [PATCH] RPM: switch kopete-otr, ktechlab, qalculate-tde and twin-style-crystal to cmake build --- .../applications/kopete-otr/kopete-otr.spec | 53 +++++++++++-------- redhat/applications/ktechlab/ktechlab.spec | 53 +++++++++---------- .../qalculate-tde/qalculate-tde.spec | 48 ++++++++--------- .../twin-style-crystal.spec | 46 ++++++++-------- 4 files changed, 103 insertions(+), 97 deletions(-) diff --git a/redhat/applications/kopete-otr/kopete-otr.spec b/redhat/applications/kopete-otr/kopete-otr.spec index 5d13e0ed9..f8d4e27d4 100644 --- a/redhat/applications/kopete-otr/kopete-otr.spec +++ b/redhat/applications/kopete-otr/kopete-otr.spec @@ -68,7 +68,7 @@ BuildRequires: trinity-tdenetwork-devel >= %{tde_version} # Kopete is provided by tdenetwork Requires: trinity-kopete >= %{tde_version} -BuildRequires: autoconf automake libtool m4 +BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig @@ -104,39 +104,46 @@ users with IM-Cients supporting the OTR encryption method. %prep %setup -q -n %{name}-%{tde_version}%{?preversion:~%{preversion}} -%__cp "/usr/share/aclocal/libtool.m4" "admin/libtool.m4.in" -%__cp "/usr/share/libtool/"*"/ltmain.sh" "admin/ltmain.sh" || %__cp "/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} \ - --datadir=%{tde_datadir} \ - --libdir=%{tde_libdir} \ - --mandir=%{tde_mandir} \ - --includedir=%{tde_tdeincludedir} \ +export PKG_CONFIG_PATH="%{tde_libdir}/pkgconfig:${PKG_CONFIG_PATH}" + +if ! rpm -E %%cmake|grep -q "cd build"; then + %__mkdir_p build + cd build +fi + +%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=ON \ + \ + -DCMAKE_LIBRARY_PATH=%{tde_libdir} \ + -DKOPETE_INCLUDE_DIR=%{tde_tdeincludedir}/kopete \ + \ + -DBIN_INSTALL_DIR=%{tde_bindir} \ + -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 + -DBUILD_ALL=ON \ + -DWITH_ALL_OPTIONS=ON \ + .. -%__make %{_smp_mflags} || %__make +%__make %{?_smp_mflags} || %__make %install export PATH="%{tde_bindir}:${PATH}" %__rm -rf %{buildroot} -%__make install DESTDIR=%{buildroot} +%__make install DESTDIR=%{buildroot} -C build # Unwanted files %__rm -f %{?buildroot}%{tde_libdir}/libkotr.so diff --git a/redhat/applications/ktechlab/ktechlab.spec b/redhat/applications/ktechlab/ktechlab.spec index 1cd12833b..d32fb18b8 100644 --- a/redhat/applications/ktechlab/ktechlab.spec +++ b/redhat/applications/ktechlab/ktechlab.spec @@ -61,7 +61,7 @@ BuildRequires: trinity-tdebase-devel >= %{tde_version} BuildRequires: desktop-file-utils BuildRequires: gettext -BuildRequires: autoconf automake libtool m4 +BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: fdupes @@ -101,47 +101,44 @@ Homepage: http://ktechlab.org/ %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}" -# Warning: --enable-final causes FTBFS -%configure \ - --prefix=%{tde_prefix} \ - --exec-prefix=%{tde_prefix} \ - --bindir=%{tde_bindir} \ - --datadir=%{tde_datadir} \ - --libdir=%{tde_libdir} \ - --mandir=%{tde_mandir} \ - --includedir=%{tde_tdeincludedir} \ +if ! rpm -E %%cmake|grep -q "cd build"; then + %__mkdir_p build + cd build +fi + +%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=ON \ + \ + -DBIN_INSTALL_DIR=%{tde_bindir} \ + -DSHARE_INSTALL_PREFIX=%{tde_datadir} \ \ - --disable-dependency-tracking \ - --disable-debug \ - --disable-final \ - --enable-new-ldflags \ - --enable-closure \ - --enable-rpath \ - --disable-gcc-hidden-visibility + -DBUILD_ALL=ON \ + -DWITH_ALL_OPTIONS=ON \ + -DWITH_GPSIM=OFF \ + .. -%__make %{?_smp_mflags} +%__make %{?_smp_mflags} || %__make %install export PATH="%{tde_bindir}:${PATH}" %__rm -rf %{buildroot} -%__make install DESTDIR=%{buildroot} +%__make install DESTDIR=%{buildroot} -C build %find_lang %{tde_pkg} -%__mkdir_p "%{?buildroot}%{tde_tdeappdir}" -%__mv -f "%{?buildroot}%{tde_datadir}/applnk/Development/ktechlab.desktop" "%{?buildroot}%{tde_tdeappdir}" -%__rm -rf "%{?buildroot}%{tde_datadir}/applnk" - # Updates applications categories for openSUSE %if 0%{?suse_version} %suse_update_desktop_file -r -n ktechlab Science Math @@ -166,6 +163,8 @@ export PATH="%{tde_bindir}:${PATH}" %{tde_datadir}/mimelnk/application/x-flowcode.desktop %{tde_datadir}/mimelnk/application/x-ktechlab.desktop %{tde_datadir}/mimelnk/application/x-microbe.desktop +%{tde_mandir}/man1/ktechlab.1* +%{tde_mandir}/man1/microbe.1* %changelog diff --git a/redhat/applications/qalculate-tde/qalculate-tde.spec b/redhat/applications/qalculate-tde/qalculate-tde.spec index 052d12324..9eba37157 100644 --- a/redhat/applications/qalculate-tde/qalculate-tde.spec +++ b/redhat/applications/qalculate-tde/qalculate-tde.spec @@ -61,7 +61,7 @@ BuildRequires: trinity-tdelibs-devel >= %{tde_version} BuildRequires: trinity-tdebase-devel >= %{tde_version} BuildRequires: desktop-file-utils -BuildRequires: autoconf automake libtool m4 +BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: libtool @@ -109,32 +109,32 @@ This package contains the TDE user interface of qalculate. %prep %setup -q -n %{name}-%{tde_version}%{?preversion:~%{preversion}} -%__cp "/usr/share/aclocal/libtool.m4" "admin/libtool.m4.in" -%__cp "/usr/share/libtool/"*"/ltmain.sh" "admin/ltmain.sh" || %__cp "/usr/share/libtool/ltmain.sh" "admin/ltmain.sh" -%__make -f "admin/Makefile.common" - %build unset QTDIR QTINC QTLIB export PATH="%{tde_bindir}:${PATH}" -export PKG_CONFIG_PATH="%{tde_libdir}/pkgconfig:${PKG_CONFIG_PATH}" - -%configure \ - --prefix=%{tde_prefix} \ - --exec-prefix=%{tde_prefix} \ - --bindir=%{tde_bindir} \ - --datadir=%{tde_datadir} \ - --includedir=%{tde_tdeincludedir} \ - --libdir=%{tde_libdir} \ - --mandir=%{tde_mandir} \ + +if ! rpm -E %%cmake|grep -q "cd build"; then + %__mkdir_p build + cd build +fi + +%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=ON \ + \ + -DBIN_INSTALL_DIR=%{tde_bindir} \ + -DSHARE_INSTALL_PREFIX=%{tde_datadir} \ \ - --disable-dependency-tracking \ - --disable-debug \ - --enable-new-ldflags \ - --enable-final \ - --enable-closure \ - --enable-rpath \ - --disable-gcc-hidden-visibility + -DBUILD_ALL=ON \ + -DWITH_ALL_OPTIONS=ON \ + .. %__make %{?_smp_mflags} || %__make @@ -142,7 +142,7 @@ export PKG_CONFIG_PATH="%{tde_libdir}/pkgconfig:${PKG_CONFIG_PATH}" %install export PATH="%{tde_bindir}:${PATH}" %__rm -rf %{buildroot} -%__make install DESTDIR=%{buildroot} +%__make install DESTDIR=%{buildroot} -C build %find_lang qalculate_tde @@ -158,13 +158,13 @@ export PATH="%{tde_bindir}:${PATH}" %files -f qalculate_tde.lang %defattr(-,root,root,-) -%{tde_bindir}/qalculate %{tde_bindir}/qalculate-tde %{tde_datadir}/apps/qalculate_tde/ %{tde_tdeappdir}/qalculate_tde.desktop %{tde_tdedocdir}/HTML/en/qalculate_tde/ %{tde_datadir}/icons/hicolor/*/apps/qalculate_tde.png %{tde_datadir}/icons/hicolor/*/actions/qalculate_convert.png +%{tde_mandir}/man1/qalculate-tde.1* %changelog diff --git a/redhat/applications/twin-style-crystal/twin-style-crystal.spec b/redhat/applications/twin-style-crystal/twin-style-crystal.spec index ae0be24da..3b5db45e3 100644 --- a/redhat/applications/twin-style-crystal/twin-style-crystal.spec +++ b/redhat/applications/twin-style-crystal/twin-style-crystal.spec @@ -61,7 +61,7 @@ BuildRequires: trinity-tdebase-devel >= %{tde_version} BuildRequires: desktop-file-utils BuildRequires: gettext -BuildRequires: autoconf automake libtool m4 +BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig BuildRequires: fdupes @@ -100,40 +100,40 @@ And it is of course nice to look at. Upstream says: %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}" -# Warning: --enable-gcc-visibility makes decoration unusable. -%configure \ - --prefix=%{tde_prefix} \ - --exec-prefix=%{tde_prefix} \ - --bindir=%{tde_bindir} \ - --datadir=%{tde_datadir} \ - --includedir=%{tde_tdeincludedir} \ - --libdir=%{tde_libdir} \ - --mandir=%{tde_mandir} \ +if ! rpm -E %%cmake|grep -q "cd build"; then + %__mkdir_p build + cd build +fi + +%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=ON \ + \ + -DLIB_INSTALL_DIR=%{tde_libdir} \ + -DSHARE_INSTALL_PREFIX=%{tde_datadir} \ \ - --disable-dependency-tracking \ - --disable-debug \ - --enable-final \ - --enable-new-ldflags \ - --enable-closure \ - --enable-rpath \ - --disable-gcc-hidden-visibility + -DBUILD_ALL=ON \ + -DWITH_ALL_OPTIONS=ON \ + .. -%__make %{?_smp_mflags} +%__make %{?_smp_mflags} || %__make %install export PATH="%{tde_bindir}:${PATH}" %__rm -rf %{buildroot} -%__make install DESTDIR=%{buildroot} +%__make install DESTDIR=%{buildroot} -C build %clean