Bump to cmake 3.25.2 76/288076/1 accepted/tizen_8.0_base accepted/tizen_base accepted/tizen_base_riscv accepted/tizen_base_tool sandbox/jinwang.an/cmake_3.25.2-20230210 tizen_8.0_base accepted/tizen/8.0/base/20231005.044628 accepted/tizen/base/20230714.003252 accepted/tizen/base/20230802.221840 accepted/tizen/base/asan/20240305.000515 accepted/tizen/base/riscv/20231123.094506 accepted/tizen/base/tool/20230211.150847 submit/tizen_base/20230210.080112 submit/tizen_base/20230210.080621 tizen_8.0_m2_release
authorJinWang An <jinwang.an@samsung.com>
Fri, 10 Feb 2023 07:31:30 +0000 (16:31 +0900)
committerJinWang An <jinwang.an@samsung.com>
Fri, 10 Feb 2023 07:33:22 +0000 (16:33 +0900)
Change-Id: If5782dceb4278c263303211818c3941a3a8eaa95
Signed-off-by: JinWang An <jinwang.an@samsung.com>
packaging/TizenCommon.cmake [new file with mode: 0644]
packaging/cmake.manifest [new file with mode: 0644]
packaging/cmake.spec [new file with mode: 0644]
packaging/macros.cmake [new file with mode: 0644]

diff --git a/packaging/TizenCommon.cmake b/packaging/TizenCommon.cmake
new file mode 100644 (file)
index 0000000..2a83785
--- /dev/null
@@ -0,0 +1,36 @@
+# Copied from libzypp
+# Library
+IF ( DEFINED LIB )
+  SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
+ELSE ( DEFINED  LIB )
+  IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+    SET( LIB_SUFFIX "64" )
+  ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
+  SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
+ENDIF ( DEFINED  LIB )
+MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" )
+
+# system configuration dir (etc)
+IF( NOT DEFINED SYSCONFDIR )
+  IF ( ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr" )
+    # if installing in usr, set sysconfg to etc
+    SET( SYSCONFDIR /etc )
+  ELSE ( ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr" )
+    SET ( SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc" )
+  ENDIF ( ${CMAKE_INSTALL_PREFIX} STREQUAL "/usr" )
+ENDIF( NOT DEFINED SYSCONFDIR )
+MESSAGE(STATUS "Config files will be installed in ${SYSCONFDIR}" )
+
+# usr INSTALL_PREFIX
+
+IF( DEFINED CMAKE_INSTALL_PREFIX )
+  SET( INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} )
+ELSE( DEFINED CMAKE_INSTALL_PREFIX )
+  SET( INSTALL_PREFIX /usr )
+ENDIF( DEFINED CMAKE_INSTALL_PREFIX )
+
+# system configuration dir (etc)
+IF( NOT DEFINED MANDIR )
+  SET( MANDIR ${INSTALL_PREFIX}/share/man )
+ENDIF( NOT DEFINED MANDIR )
+MESSAGE( "** Manual files will be installed in ${MANDIR}" )
diff --git a/packaging/cmake.manifest b/packaging/cmake.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/cmake.spec b/packaging/cmake.spec
new file mode 100644 (file)
index 0000000..c8e4681
--- /dev/null
@@ -0,0 +1,81 @@
+Name:           cmake
+Version:        3.25.2
+Release:        0
+License:        BSD-3-Clause
+Summary:        Cross-platform make system
+Url:            http://www.cmake.org
+Group:          Platfrom Development/Tools
+Source0:        %{name}-%{version}.tar.gz
+Source1:        macros.cmake
+Source2:        TizenCommon.cmake
+Source1001:     cmake.manifest
+
+BuildRequires:  fdupes
+BuildRequires:  pkgconfig(ncurses)
+BuildRequires:  pkgconfig(expat)
+BuildRequires:  pkgconfig(zlib)
+BuildRequires:  pkgconfig(bzip2)
+BuildRequires:  pkgconfig(liblzma)
+BuildRequires:  pkgconfig(libzstd)
+BuildRequires:  pkgconfig(libarchive)
+BuildRequires:  pkgconfig(openssl1.1)
+
+%description
+CMake is used to control the software compilation process using simple platform
+and compiler independent configuration files. CMake generates native makefiles
+and workspaces that can be used in the compiler environment of your choice.
+CMake is quite sophisticated: it is possible to support complex environments
+requiring system configuration, pre-processor generation, code generation, and
+template instantiation.
+
+
+%prep
+%setup -q -n cmake-%{version}
+cp %{SOURCE1001} .
+
+%build
+export CXXFLAGS="$RPM_OPT_FLAGS -fPIC -pie"
+export CFLAGS="$CXXFLAGS"
+./configure \
+    --prefix=%{_prefix} \
+    --datadir=/share/%{name} \
+    --docdir=/share/doc/packages/%{name} \
+    --mandir=/share/man \
+    --system-libs \
+    --parallel=0%jobs \
+    --no-qt-gui \
+    --no-system-curl \
+    --no-system-librhash \
+    --no-system-nghttp2 \
+    --no-system-jsoncpp \
+    --no-system-libuv
+%__make VERBOSE=1 %{?_smp_mflags}
+
+%install
+%make_install
+mkdir -p %{buildroot}%{_libdir}/%{name}
+find %{buildroot}%{_datadir}/%{name} -type f -print0 | xargs -0 chmod 644
+cp %{SOURCE2} %{buildroot}%{_datadir}/%{name}/Modules
+
+# Install cmake rpm macros
+install -D -p -m 0644 %{S:1} \
+  %{buildroot}%{_sysconfdir}/rpm/macros.cmake
+
+fdupes %{buildroot}%{_datadir}/%{name}
+
+rm -rf %{buildroot}%{_datadir}/bash-completion
+rm -rf %{buildroot}%{_datadir}/emacs
+rm -rf %{buildroot}%{_datadir}/vim
+%docs_package
+
+%files
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%config(noreplace) %{_sysconfdir}/rpm/macros.cmake
+%doc %{_datadir}/doc/packages/%{name}
+%{_datadir}/aclocal/cmake.m4
+%{_bindir}/cmake
+%{_bindir}/ccmake
+%{_bindir}/cpack
+%{_bindir}/ctest
+%{_datadir}/%{name}
diff --git a/packaging/macros.cmake b/packaging/macros.cmake
new file mode 100644 (file)
index 0000000..42ada23
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# Macros for cmake
+#
+%_cmake_lib_suffix64 -DLIB_SUFFIX=64
+%_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON
+%__cmake %{_bindir}/cmake
+
+%cmake \
+  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
+  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
+  FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ; \
+  %__cmake \\\
+        -DCMAKE_VERBOSE_MAKEFILE=ON \\\
+        -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\
+        -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \\\
+        -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\
+        -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\
+        -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\
+        -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\
+%if "%{?_lib}" == "lib64" \
+        %{?_cmake_lib_suffix64} \\\
+%endif \
+        %{?_cmake_skip_rpath} \\\
+        -DBUILD_SHARED_LIBS:BOOL=ON