summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinWang An <jinwang.an@samsung.com>2023-02-10 16:31:30 +0900
committerJinWang An <jinwang.an@samsung.com>2023-02-10 16:33:22 +0900
commit13f191761ceaf3fc7ba6b64297d6c1e43eca56b7 (patch)
tree21fc103a2648edf67faa8eaff9b5d11578832f2f
parent093a937511a119ac536f3941a1c08a7ab347a13d (diff)
downloadcmake-tizen_9.0_base.tar.gz
cmake-tizen_9.0_base.tar.bz2
cmake-tizen_9.0_base.zip
Change-Id: If5782dceb4278c263303211818c3941a3a8eaa95 Signed-off-by: JinWang An <jinwang.an@samsung.com>
-rw-r--r--packaging/TizenCommon.cmake36
-rw-r--r--packaging/cmake.manifest5
-rw-r--r--packaging/cmake.spec81
-rw-r--r--packaging/macros.cmake24
4 files changed, 146 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..c8e46813a
--- /dev/null
+++ b/packaging/cmake.spec
@@ -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
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