diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-10-30 15:40:46 -0700 |
---|---|---|
committer | Philippe Coval <philippe.coval@open.eurogiciel.org> | 2015-01-06 11:16:51 +0100 |
commit | f3a58fa741749431b4b76f06a5bd7da7e4dd1771 (patch) | |
tree | 7265c5877a4cd2b2403ee521b0dd50392009a7c9 | |
parent | 317dbdb79761ef65e45c7358cfc7571c6afa54ad (diff) | |
download | cmake-f3a58fa741749431b4b76f06a5bd7da7e4dd1771.tar.gz cmake-f3a58fa741749431b4b76f06a5bd7da7e4dd1771.tar.bz2 cmake-f3a58fa741749431b4b76f06a5bd7da7e4dd1771.zip |
packaging: Initial packaging
Change-Id: I1e253912caf690c56d827a993e2b5bee18747cf6
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
-rw-r--r-- | packaging/cmake.spec | 80 | ||||
-rw-r--r-- | packaging/macros.cmake | 24 | ||||
-rw-r--r-- | packaging/tinfo.patch | 12 |
3 files changed, 116 insertions, 0 deletions
diff --git a/packaging/cmake.spec b/packaging/cmake.spec new file mode 100644 index 000000000..504a5e98a --- /dev/null +++ b/packaging/cmake.spec @@ -0,0 +1,80 @@ +Name: cmake +Version: 2.8.9 +Release: 1 +License: BSD +Summary: Cross-platform make system +Url: http://www.cmake.org +Group: Development/Tools +Source0: http://www.cmake.org/files/v2.8/cmake-%{version}.tar.gz +Source1: macros.cmake +BuildRequires: expat-devel +BuildRequires: pkgconfig(libarchive) >= 2.8.0 +BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(zlib) +BuildRequires: procps +BuildRequires: pkgconfig(ncurses) +BuildRequires: gcc-c++ + +%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} + +# Fixup permissions +find -name \*.h -o -name \*.cxx -print0 | xargs -0 chmod -x + +%build +cat > %{buildroot}build-flags.cmake << EOF +set(CMAKE_SKIP_RPATH YES CACHE BOOL "Skip rpath" FORCE) +set(CMAKE_USE_RELATIVE_PATHS YES CACHE BOOL "Use relative paths" FORCE) +set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Verbose build" FORCE) +set(CMAKE_C_FLAGS "%{optflags}" CACHE STRING "C flags" FORCE) +set(CMAKE_CXX_FLAGS "%{optflags}" CACHE STRING "C++ flags" FORCE) +set(CMAKE_SKIP_BOOTSTRAP_TEST ON CACHE BOOL "Skip BootstrapTest" FORCE) +set(BUILD_CursesDialog YES CACHE BOOL "Build curses GUI" FORCE) +set(MINGW_CC_LINUX2WIN_EXECUTABLE "" CACHE FILEPATH "Never detect mingw" FORCE) +set(CMAKE_USE_SYSTEM_LIBARCHIVE YES CACHE BOOL "" FORCE) +EOF +rm -rf %{_target_platform} && mkdir %{_target_platform} +cd %{_target_platform} && ../bootstrap \ + --prefix=%{_prefix} \ + --docdir=/share/doc/packages/%{name} \ + --mandir=/share/man \ + --datadir=/share/cmake \ + --%{?with_bootstrap:no-}system-libs \ + --parallel=`/usr/bin/getconf _NPROCESSORS_ONLN` \ + --init=%{buildroot}build-flags.cmake \ + --system-libs + +make VERBOSE=1 %{?_smp_mflags} + +%install +%makeinstall -C %{_target_platform} DESTDIR=%{buildroot} +find %{buildroot}%{_datadir}/%{name}/Modules -name '*.sh*' -type f | xargs chmod -x +mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp +cp -a Example %{buildroot}%{_datadir}/doc/%{name}-%{version}/ +install -m 0644 Docs/cmake-mode.el %{buildroot}%{_datadir}/emacs/site-lisp/ +# Install cmake rpm macros +install -D -p -m 0644 %{_sourcedir}/macros.cmake \ + %{buildroot}%{_sysconfdir}/rpm/macros.cmake + +%remove_docs +rm -rf %{buildroot}/usr/share/doc + +%files +%defattr(-,root,root,-) +%config(noreplace) %{_sysconfdir}/rpm/macros.cmake +%{_datadir}/aclocal/cmake.m4 +%{_bindir}/ccmake +%{_bindir}/cmake +%{_bindir}/cpack +%{_bindir}/ctest +%{_datadir}/%{name}/* +%{_datadir}/emacs/* 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 diff --git a/packaging/tinfo.patch b/packaging/tinfo.patch new file mode 100644 index 000000000..8f09832ca --- /dev/null +++ b/packaging/tinfo.patch @@ -0,0 +1,12 @@ +Index: cmake-2.8.3/Source/CursesDialog/CMakeLists.txt +=================================================================== +--- cmake-2.8.3.orig/Source/CursesDialog/CMakeLists.txt ++++ cmake-2.8.3/Source/CursesDialog/CMakeLists.txt +@@ -32,6 +32,6 @@ INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PAT + + ADD_EXECUTABLE(ccmake ${CURSES_SRCS} ) + TARGET_LINK_LIBRARIES(ccmake CMakeLib) +-TARGET_LINK_LIBRARIES(ccmake cmForm) ++TARGET_LINK_LIBRARIES(ccmake cmForm tinfo) + + INSTALL_TARGETS(/bin ccmake) |