summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-13 10:04:53 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-13 10:05:11 +0900
commitc73381c6edfa8b7666bb26cbf283f9aa059eccbe (patch)
treeb0bade40976bead98cbb62696a3215c418b55957
parent75fbd180f415adee05f2600161fffb13a2087cc2 (diff)
downloadcmake-c73381c6edfa8b7666bb26cbf283f9aa059eccbe.tar.gz
cmake-c73381c6edfa8b7666bb26cbf283f9aa059eccbe.tar.bz2
cmake-c73381c6edfa8b7666bb26cbf283f9aa059eccbe.zip
Change-Id: I04d8c73cb6fd7e255f510144a2fb7ac94f06f8f1 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
-rw-r--r--packaging/TizenCommon.cmake36
-rw-r--r--packaging/cmake.manifest5
-rw-r--r--packaging/cmake.spec79
-rw-r--r--packaging/macros.cmake24
4 files changed, 144 insertions, 0 deletions
diff --git a/packaging/TizenCommon.cmake b/packaging/TizenCommon.cmake
new file mode 100644
index 000000000..2a8378557
--- /dev/null
+++ b/packaging/TizenCommon.cmake
@@ -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
index 000000000..017d22d3a
--- /dev/null
+++ b/packaging/cmake.manifest
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/cmake.spec b/packaging/cmake.spec
new file mode 100644
index 000000000..f3fc8bd11
--- /dev/null
+++ b/packaging/cmake.spec
@@ -0,0 +1,79 @@
+Name: cmake
+Version: 3.21.3
+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(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"
+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}/cpack
+%{_bindir}/ctest
+%{_datadir}/%{name}
diff --git a/packaging/macros.cmake b/packaging/macros.cmake
new file mode 100644
index 000000000..42ada2327
--- /dev/null
+++ b/packaging/macros.cmake
@@ -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