File cmake.spec of Package cmake.1425

#
# spec file for package cmake
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           cmake
Version:        2.8.12.1
Release:        0
Url:            http://www.cmake.org/
Source0:        http://www.cmake.org/files/v2.8/%{name}-%{version}.tar.gz
Source1:        cmake.macros
Source2:        opensuse_rules.cmake
Source3:        cmake.attr
Source4:        cmake.prov
Patch2:         cmake-fix-ruby-test.patch
# PATCH-FIX-UPSTREAM fix-check-for-freetype251.patch -- http://www.cmake.org/Bug/view.php?id=13959, http://www.cmake.org/Bug/view.php?id=14601
Patch3:         fix-check-for-freetype251.patch
# PATCH-FIX-UPSTREAM cmake-jni-ppc64le.patch -- https://github.com/Kitware/CMake/pull/90
Patch4:         cmake-jni-ppc64le.patch
# PATCH-FIX-UPSTREAM cmake-jni-ppc64le-ppc64.patch https://github.com/Kitware/CMake/pull/111
Patch5:         cmake-jni-ppc64le-ppc64.patch
Summary:        Cross-platform, open-source make system
License:        BSD-3-Clause
Group:          Development/Tools/Building
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
%if 0%{?suse_version} > 1010
BuildRequires:  fdupes
%endif
%if 0%{?suse_version} > 1110
BuildRequires:  libarchive-devel
BuildRequires:  libbz2-devel
%endif
BuildRequires:  libexpat-devel
%endif
BuildRequires:  gcc-c++
BuildRequires:  ncurses-devel
BuildRequires:  zlib-devel

Requires:       make
Requires:       python-base

%description
CMake is a cross-platform, open-source make system

%prep
%setup -q -n %{name}-%{version}
%patch2
%patch3 -p1
%patch4 -p1
%patch5 -p1

%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 \
    --no-system-curl \
%if 0%{?suse_version} <= 1110
    --no-system-libarchive \
%endif
    --parallel=0%jobs \
    --verbose \
    --no-qt-gui
make VERBOSE=1 %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install
mkdir -p %{buildroot}%{_libdir}/cmake
find %{buildroot}/usr/share/cmake -type f -print0 | xargs -0 chmod 644
cp ChangeLog.manual %{buildroot}/usr/share/doc/packages/%{name}/Changelog
# rpm macros
install -m644 %{SOURCE1} -D %{buildroot}%{_sysconfdir}/rpm/macros.cmake
# buildrules
install -m644 %{SOURCE2} -D %{buildroot}%{_datadir}/cmake/Modules/opensuse_rules.cmake
sed -i \
    -e 's:OPTFLAGS:%{optflags}:g' \
    %{buildroot}%{_datadir}/cmake/Modules/opensuse_rules.cmake

# RPM auto provides
install -p -m0644 -D %{SOURCE3} %{buildroot}%{_libexecdir}/rpm/fileattrs/cmake.attr
install -p -m0755 -D %{SOURCE4} %{buildroot}%{_libexecdir}/rpm/cmake.prov

%if 0%{?suse_version} > 1010
%fdupes %{buildroot}/usr/share/cmake
%endif

%files
%defattr(-,root,root)
%config %{_sysconfdir}/rpm/macros.cmake
%{_libexecdir}/rpm
%{_bindir}/cpack
%{_bindir}/cmake
%{_bindir}/ctest
%{_bindir}/ccmake
%{_datadir}/cmake
%{_libdir}/cmake
%dir %{_datadir}/aclocal
%{_datadir}/aclocal/cmake.m4
%doc %{_datadir}/doc/packages/%{name}
%doc %{_mandir}/man1/cmakepolicies.1.*
%doc %{_mandir}/man1/cmake.1.*
%doc %{_mandir}/man1/ctest.1.*
%doc %{_mandir}/man1/ccmake.1.*
%doc %{_mandir}/man1/cmakecommands.1.*
%doc %{_mandir}/man1/cmakecompat.1.*
%doc %{_mandir}/man1/cmakemodules.1.*
%doc %{_mandir}/man1/cmakeprops.1.*
%doc %{_mandir}/man1/cmakevars.1.*
%doc %{_mandir}/man1/cpack.1.*

%changelog
openSUSE Build Service is sponsored by