| 1 | #define svn_url e:/trees/cmake/trunk
|
|---|
| 2 | %define svn_url http://svn.netlabs.org/repos/ports/cmake/trunk
|
|---|
| 3 | %define svn_rev 1949
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 | # Set to bcond_with or use --without gui to disable qt4 gui build
|
|---|
| 7 | %bcond_without gui
|
|---|
| 8 |
|
|---|
| 9 | # Set to bcond_without or use --with desktop to enable desktopn stuff
|
|---|
| 10 | %bcond_with desktop
|
|---|
| 11 |
|
|---|
| 12 | # Place rpm-macros into proper location
|
|---|
| 13 | %global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
|
|---|
| 14 |
|
|---|
| 15 | # Setup _pkgdocdir if not defined already
|
|---|
| 16 | %{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}}
|
|---|
| 17 |
|
|---|
| 18 | # enable this when we have Sphinx-build
|
|---|
| 19 | %bcond_with sphinx
|
|---|
| 20 |
|
|---|
| 21 | %global major_version 3
|
|---|
| 22 | %global minor_version 7
|
|---|
| 23 | %global orig_name cmake
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | Name: %{orig_name}%{?name_suffix}
|
|---|
| 27 | Version: %{major_version}.%{minor_version}.0
|
|---|
| 28 | Release: 2%{?dist}
|
|---|
| 29 | Summary: Cross-platform make system
|
|---|
| 30 |
|
|---|
| 31 | # most sources are BSD
|
|---|
| 32 | # Source/CursesDialog/form/ a bunch is MIT
|
|---|
| 33 | # Source/kwsys/MD5.c is zlib
|
|---|
| 34 | # some GPL-licensed bison-generated files, which all include an
|
|---|
| 35 | # exception granting redistribution under terms of your choice
|
|---|
| 36 | License: BSD and MIT and zlib
|
|---|
| 37 | URL: http://www.cmake.org
|
|---|
| 38 | Vendor: bww bitwise works GmbH
|
|---|
| 39 | Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
|
|---|
| 40 | Source2: macros.%{name}
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 | #BuildRequires: gcc-gfortran
|
|---|
| 44 | #BuildRequires: ncurses-devel, libX11-devel
|
|---|
| 45 | BuildRequires: bzip2-devel
|
|---|
| 46 | BuildRequires: curl-devel
|
|---|
| 47 | BuildRequires: expat-devel
|
|---|
| 48 | #BuildRequires: jsoncpp-devel
|
|---|
| 49 | #BuildRequires: libarchive-devel
|
|---|
| 50 | #BuildRequires: libuv-devel
|
|---|
| 51 | %if 0%{?with_sphinx:1}
|
|---|
| 52 | BuildRequires: /@unixroot/usr/bin/sphinx-build
|
|---|
| 53 | %endif
|
|---|
| 54 | BuildRequires: xz-devel
|
|---|
| 55 | BuildRequires: zlib-devel
|
|---|
| 56 | #BuildRequires: emacs
|
|---|
| 57 | BuildRequires: python2-devel
|
|---|
| 58 | %if %{with gui}
|
|---|
| 59 | BuildRequires: libqt4-devel
|
|---|
| 60 | #BuildRequires: desktop-file-utils
|
|---|
| 61 | %global qt_gui --qt-gui
|
|---|
| 62 | %endif
|
|---|
| 63 |
|
|---|
| 64 | Requires: %{name}-data = %{version}-%{release}
|
|---|
| 65 | Requires: rpm
|
|---|
| 66 |
|
|---|
| 67 | # Provide the major version name
|
|---|
| 68 | Provides: %{orig_name}%{major_version} = %{version}-%{release}
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 | %description
|
|---|
| 72 | CMake is used to control the software compilation process using simple
|
|---|
| 73 | platform and compiler independent configuration files. CMake generates
|
|---|
| 74 | native makefiles and workspaces that can be used in the compiler
|
|---|
| 75 | environment of your choice. CMake is quite sophisticated: it is possible
|
|---|
| 76 | to support complex environments requiring system configuration, preprocessor
|
|---|
| 77 | generation, code generation, and template instantiation.
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 | %package data
|
|---|
| 81 | Summary: Common data-files for %{name}
|
|---|
| 82 | Requires: %{name} = %{version}-%{release}
|
|---|
| 83 | BuildArch: noarch
|
|---|
| 84 |
|
|---|
| 85 | %description data
|
|---|
| 86 | This package contains common data-files for %{name}.
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 | %package doc
|
|---|
| 90 | Summary: Documentation for %{name}
|
|---|
| 91 | BuildArch: noarch
|
|---|
| 92 |
|
|---|
| 93 | %description doc
|
|---|
| 94 | This package contains documentation for %{name}.
|
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 | %package gui
|
|---|
| 98 | Summary: Qt GUI for %{name}
|
|---|
| 99 |
|
|---|
| 100 | Requires: %{name} = %{version}-%{release}
|
|---|
| 101 | #Requires: hicolor-icon-theme
|
|---|
| 102 | #Requires: shared-mime-info
|
|---|
| 103 |
|
|---|
| 104 | %description gui
|
|---|
| 105 | The %{name}-gui package contains the Qt based GUI for %{name}.
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 | %debug_package
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 | %prep
|
|---|
| 112 | %if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
|
|---|
| 113 | %setup -q
|
|---|
| 114 | %else
|
|---|
| 115 | %setup -n "%{name}-%{version}" -Tc
|
|---|
| 116 | svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
|
|---|
| 117 | rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
|
|---|
| 118 | (cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
|
|---|
| 119 | %endif
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 | %build
|
|---|
| 123 | export CFLAGS="%{optflags}"
|
|---|
| 124 | export CXXFLAGS="%{optflags}"
|
|---|
| 125 | export LDFLAGS="-Zomf -Zhigh-mem -lcx %{?__global_ldflags}"
|
|---|
| 126 | export VENDOR="%{vendor}"
|
|---|
| 127 | mkdir build
|
|---|
| 128 | cd build
|
|---|
| 129 | # --%{?with_bootstrap:no-}system-libs \
|
|---|
| 130 | ../bootstrap --prefix=%{_prefix} --datadir=/share/%{name} \
|
|---|
| 131 | --docdir=/share/doc/%{name} --mandir=/share/man \
|
|---|
| 132 | --verbose --system-bzip2 --system-curl --system-expat \
|
|---|
| 133 | --system-liblzma --system-zlib \
|
|---|
| 134 | %{?with_sphinx:--sphinx-man --sphinx-html} \
|
|---|
| 135 | %{?qt_gui} -- \
|
|---|
| 136 | -DCMAKE_USE_OPENSSL:BOOL=ON
|
|---|
| 137 |
|
|---|
| 138 | make
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 | %install
|
|---|
| 142 | cd build
|
|---|
| 143 | make install DESTDIR=%{buildroot}
|
|---|
| 144 | find %{buildroot}/%{_datadir}/%{name}/Modules -type f | xargs chmod -x
|
|---|
| 145 | [ -n "$(find %{buildroot}/%{_datadir}/%{name}/Modules -name \*.orig)" ] &&
|
|---|
| 146 | echo "Found .orig files in %{_datadir}/%{name}/Modules, rebase patches" &&
|
|---|
| 147 | exit 1
|
|---|
| 148 | cd ..
|
|---|
| 149 |
|
|---|
| 150 | # RPM macros
|
|---|
| 151 | install -p -m0644 -D %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name}
|
|---|
| 152 | sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" -e "s|@@CMAKE_MAJOR_VERSION@@|%{major_version}|" %{buildroot}%{rpm_macros_dir}/macros.%{name}
|
|---|
| 153 | touch -r %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name}
|
|---|
| 154 |
|
|---|
| 155 | mkdir -p %{buildroot}%{_libdir}/%{name}
|
|---|
| 156 | # Install copyright files for main package
|
|---|
| 157 | find Source Utilities -type f -iname copy\* | while read f
|
|---|
| 158 | do
|
|---|
| 159 | fname=$(basename $f)
|
|---|
| 160 | dir=$(dirname $f)
|
|---|
| 161 | dname=$(basename $dir)
|
|---|
| 162 | cp -p $f ./${fname}_${dname}
|
|---|
| 163 | done
|
|---|
| 164 |
|
|---|
| 165 | # Cleanup pre-installed documentation
|
|---|
| 166 | %if 0%{?with_sphinx:1}
|
|---|
| 167 | mv %{buildroot}%{_docdir}/%{name}/html .
|
|---|
| 168 | %endif
|
|---|
| 169 | rm -rf %{buildroot}%{_docdir}/%{name}
|
|---|
| 170 | # Install documentation to _pkgdocdir
|
|---|
| 171 | mkdir -p %{buildroot}%{_pkgdocdir}
|
|---|
| 172 | cp -pr %{buildroot}%{_datadir}/%{name}/Help %{buildroot}%{_pkgdocdir}
|
|---|
| 173 | mv %{buildroot}%{_pkgdocdir}/Help %{buildroot}%{_pkgdocdir}/rst
|
|---|
| 174 | %if 0%{?with_sphinx:1}
|
|---|
| 175 | mv html %{buildroot}%{_pkgdocdir}
|
|---|
| 176 | %endif
|
|---|
| 177 |
|
|---|
| 178 | %if %{with desktop}
|
|---|
| 179 | # Desktop file
|
|---|
| 180 | desktop-file-install --delete-original \
|
|---|
| 181 | --dir=%{buildroot}%{_datadir}/applications \
|
|---|
| 182 | %{buildroot}/%{_datadir}/applications/CMake%{?name_suffix}.desktop
|
|---|
| 183 | %endif
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 | %check
|
|---|
| 187 | #cd build
|
|---|
| 188 | #CMake.FileDownload, and CTestTestUpload require internet access
|
|---|
| 189 | #bin/ctest%{?name_suffix} -V -E 'CMake.FileDownload|CTestTestUpload' %{?_smp_mflags}
|
|---|
| 190 | #cd ..
|
|---|
| 191 |
|
|---|
| 192 |
|
|---|
| 193 | %if %{with desktop}
|
|---|
| 194 | %post gui
|
|---|
| 195 | update-desktop-database &> /dev/null || :
|
|---|
| 196 | /bin/touch --no-create %{_datadir}/mime || :
|
|---|
| 197 | /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
|---|
| 198 |
|
|---|
| 199 | %postun gui
|
|---|
| 200 | update-desktop-database &> /dev/null || :
|
|---|
| 201 | if [ $1 -eq 0 ] ; then
|
|---|
| 202 | /bin/touch --no-create %{_datadir}/mime || :
|
|---|
| 203 | update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
|
|---|
| 204 | /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
|---|
| 205 | /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
|---|
| 206 | fi
|
|---|
| 207 |
|
|---|
| 208 | %posttrans gui
|
|---|
| 209 | update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
|
|---|
| 210 | /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
|---|
| 211 | %endif
|
|---|
| 212 |
|
|---|
| 213 |
|
|---|
| 214 | %files
|
|---|
| 215 | %doc %dir %{_pkgdocdir}
|
|---|
| 216 | %license Copyright.txt*
|
|---|
| 217 | %license COPYING*
|
|---|
| 218 | #%{_bindir}/c%{name}.exe
|
|---|
| 219 | %{_bindir}/%{name}.exe
|
|---|
| 220 | %{_bindir}/cpack.exe
|
|---|
| 221 | %{_bindir}/ctest.exe
|
|---|
| 222 | %if 0%{?with_sphinx:1}
|
|---|
| 223 | #%{_mandir}/man1/c%{name}.1.*
|
|---|
| 224 | %{_mandir}/man1/%{name}.1.*
|
|---|
| 225 | %{_mandir}/man1/cpack.1.*
|
|---|
| 226 | %{_mandir}/man1/ctest.1.*
|
|---|
| 227 | %{_mandir}/man7/*.7.*
|
|---|
| 228 | %endif
|
|---|
| 229 | %{_libdir}/%{name}/
|
|---|
| 230 |
|
|---|
| 231 |
|
|---|
| 232 | %files data
|
|---|
| 233 | %{_datadir}/aclocal/%{name}.m4
|
|---|
| 234 | %{_datadir}/%{name}/
|
|---|
| 235 | %{rpm_macros_dir}/macros.%{name}
|
|---|
| 236 |
|
|---|
| 237 |
|
|---|
| 238 | %files doc
|
|---|
| 239 | # Pickup license-files from main-pkg's license-dir
|
|---|
| 240 | # If there's no license-dir they are picked up by %%doc previously
|
|---|
| 241 | %{?_licensedir:%license %{_datadir}/licenses/%{name}*}
|
|---|
| 242 | %doc %{_pkgdocdir}/
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 | %if %{with gui}
|
|---|
| 246 | %files gui
|
|---|
| 247 | %{_bindir}/%{name}-gui.exe
|
|---|
| 248 | %if %{with desktop}
|
|---|
| 249 | %{_datadir}/applications/CMake%{?name_suffix}.desktop
|
|---|
| 250 | %{_datadir}/mime/packages/
|
|---|
| 251 | %{_datadir}/icons/hicolor/*/apps/CMake%{?name_suffix}Setup.png
|
|---|
| 252 | %endif
|
|---|
| 253 | %if 0%{?with_sphinx:1}
|
|---|
| 254 | %{_mandir}/man1/%{name}-gui.1.*
|
|---|
| 255 | %endif
|
|---|
| 256 | %endif
|
|---|
| 257 |
|
|---|
| 258 |
|
|---|
| 259 | %changelog
|
|---|
| 260 | * Wed Jan 25 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 3.7.0-2
|
|---|
| 261 | - adjust def file creation
|
|---|
| 262 |
|
|---|
| 263 | * Mon Dec 05 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> 3.7.0-1
|
|---|
| 264 | - initial rpm version
|
|---|