packaging: Initial packaging
authorAnas Nashif <anas.nashif@intel.com>
Tue, 30 Oct 2012 22:40:46 +0000 (15:40 -0700)
committerPhilippe Coval <philippe.coval@open.eurogiciel.org>
Tue, 6 Jan 2015 10:16:51 +0000 (11:16 +0100)
Change-Id: I1e253912caf690c56d827a993e2b5bee18747cf6
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
packaging/cmake.spec [new file with mode: 0644]
packaging/macros.cmake [new file with mode: 0644]
packaging/tinfo.patch [new file with mode: 0644]

diff --git a/packaging/cmake.spec b/packaging/cmake.spec
new file mode 100644 (file)
index 0000000..504a5e9
--- /dev/null
@@ -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 (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
diff --git a/packaging/tinfo.patch b/packaging/tinfo.patch
new file mode 100644 (file)
index 0000000..8f09832
--- /dev/null
@@ -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)