source: spec/trunk/SPECS/cmake.spec@ 1695

Last change on this file since 1695 was 1695, checked in by tellie, 5 years ago

spec: fribidi: Release version 0.19.5-1

File size: 13.1 KB
Line 
1# Do we add appdata-files? (disabled)
2# consider conditional on whether %%_metainfodir is defined or not instead -- rex
3%bcond_with appdata
4
5# Set to bcond_without or use --with bootstrap if bootstrapping a new release
6# or architecture
7%bcond_without bootstrap
8
9# Build with Emacs support (disabled)
10%bcond_with emacs
11
12# Run git tests (disabled)
13%bcond_with git_test
14
15# Set to bcond_with or use --without gui to disable qt4 gui build
16%bcond_without gui
17
18# Use ncurses for colorful output
19%bcond_without ncurses
20
21# Setting the Python-version used by default
22%bcond_with python3
23
24# Enable RPM dependency generators for cmake files written in Python
25%bcond_without rpm
26
27# enable this when we have Sphinx-build (disabled)
28%bcond_with sphinx
29
30# Run tests (disabled)
31%bcond_with test
32
33# Enable X11 tests (disabled)
34%bcond_with X11_test
35
36# Place rpm-macros into proper location
37%global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
38
39# Setup _pkgdocdir if not defined already
40%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}}
41
42%global major_version 3
43%global minor_version 10
44# Set to RC version if building RC, else %%{nil}
45#global rcsuf rc3
46%{?rcsuf:%global relsuf .%{rcsuf}}
47%{?rcsuf:%global versuf -%{rcsuf}}
48
49# Uncomment if building for EPEL
50#global name_suffix %%{major_version}
51%global orig_name cmake
52
53
54Name: %{orig_name}%{?name_suffix}
55Version: %{major_version}.%{minor_version}.3
56Release: 1%{?dist}
57Summary: Cross-platform make system
58
59# most sources are BSD
60# Source/CursesDialog/form/ a bunch is MIT
61# Source/kwsys/MD5.c is zlib
62# some GPL-licensed bison-generated files, which all include an
63# exception granting redistribution under terms of your choice
64License: BSD and MIT and zlib
65URL: http://www.cmake.org
66Vendor: bww bitwise works GmbH
67%scm_source github http://github.com/bitwiseworks/cmake-os2 master
68Source2: macros.%{name}
69# See https://bugzilla.redhat.com/show_bug.cgi?id=1202899
70Source3: %{name}.attr
71Source4: %{name}.prov
72Source5: %{name}.req
73
74BuildRequires: coreutils
75BuildRequires: findutils
76BuildRequires: gcc
77#BuildRequires: gcc-gfortran
78BuildRequires: sed
79BuildRequires: git
80%if %{with X11_test}
81BuildRequires: libX11-devel
82%endif
83%if %{with ncurses}
84BuildRequires: ncurses-devel
85%endif
86%if %{with sphinx}
87BuildRequires: %{_bindir}/sphinx-build
88%endif
89%if %{without bootstrap}
90BuildRequires: bzip2-devel
91BuildRequires: curl-devel
92BuildRequires: expat-devel
93#BuildRequires: jsoncpp-devel
94#BuildRequires: libarchive-devel
95#BuildRequires: libuv-devel
96#BuildRequires: rhash-devel
97BuildRequires: xz-devel
98BuildRequires: zlib-devel
99%endif
100%if %{with emacs}
101BuildRequires: emacs
102%endif
103%if %{with rpm}
104%if %{with python3}
105%{!?python3_pkgversion: %global python3_pkgversion 3}
106BuildRequires: python%{python3_pkgversion}-devel
107%else
108BuildRequires: python2-devel
109%endif
110%endif
111%if %{with gui}
112BuildRequires: pkgconfig(Qt5Widgets)
113%if %{with appdata}
114BuildRequires: desktop-file-utils
115%endif
116%endif
117
118%if %{without bootstrap}
119# Ensure we have our own rpm-macros in place during build.
120BuildRequires: %{name}-rpm-macros
121%endif
122
123Requires: %{name}-data = %{version}-%{release}
124Requires: %{name}-rpm-macros = %{version}-%{release}
125Requires: %{name}-filesystem = %{version}-%{release}
126
127# Provide the major version name
128Provides: %{orig_name}%{major_version} = %{version}-%{release}
129
130
131%description
132CMake is used to control the software compilation process using simple
133platform and compiler independent configuration files. CMake generates
134native makefiles and workspaces that can be used in the compiler
135environment of your choice. CMake is quite sophisticated: it is possible
136to support complex environments requiring system configuration, preprocessor
137generation, code generation, and template instantiation.
138
139
140%package data
141Summary: Common data-files for %{name}
142Requires: %{name} = %{version}-%{release}
143Requires: %{name}-filesystem = %{version}-%{release}
144Requires: %{name}-rpm-macros = %{version}-%{release}
145%if %{with emacs}
146Requires: emacs-filesystem%{?_emacs_version: >= %{_emacs_version}}
147%endif
148
149BuildArch: noarch
150
151%description data
152This package contains common data-files for %{name}.
153
154
155%package doc
156Summary: Documentation for %{name}
157BuildArch: noarch
158
159%description doc
160This package contains documentation for %{name}.
161
162
163%package filesystem
164Summary: Directories used by CMake modules
165
166%description filesystem
167This package owns all directories used by CMake modules.
168
169
170%if %{with gui}
171%package gui
172Summary: Qt GUI for %{name}
173
174Requires: %{name} = %{version}-%{release}
175%if %{with appdata}
176Requires: hicolor-icon-theme
177Requires: shared-mime-info
178%endif
179
180%description gui
181The %{name}-gui package contains the Qt based GUI for %{name}.
182%endif
183
184
185%package rpm-macros
186Summary: Common RPM macros for %{name}
187Requires: rpm
188# when subpkg introduced
189Conflicts: cmake-data < 3.10.1-2
190
191BuildArch: noarch
192
193%description rpm-macros
194This package contains common RPM macros for %{name}.
195
196
197%debug_package
198
199
200%prep
201%scm_setup
202
203%if %{with rpm}
204%if %{with python3}
205echo '#!%{__python3}' > %{name}.prov
206echo '#!%{__python3}' > %{name}.req
207%else
208echo '#!%{__python2}' > %{name}.prov
209echo '#!%{__python2}' > %{name}.req
210%endif
211tail -n +2 %{SOURCE4} >> %{name}.prov
212tail -n +2 %{SOURCE5} >> %{name}.req
213%endif
214
215
216%build
217export CFLAGS="%{optflags}"
218export CXXFLAGS="%{optflags}"
219export LDFLAGS="-Zomf -Zhigh-mem -lcx %{?__global_ldflags}"
220export VENDOR="%{vendor}"
221mkdir build
222cd build
223# --%{?with_bootstrap:no-}system-libs \
224# --parallel=`/usr/bin/getconf _NPROCESSORS_ONLN` \
225../bootstrap --prefix=%{_prefix} --datadir=/share/%{name} \
226 --docdir=/share/doc/%{name} --mandir=/share/man \
227 --verbose --system-bzip2 --system-curl --system-expat \
228 --system-liblzma --system-zlib \
229%if %{with sphinx}
230 --sphinx-man --sphinx-html} \
231%else
232 --sphinx-build=%{_bindir}/false \
233%endif
234 --%{!?with_gui:no-}qt-gui \
235 -- -DCMAKE_USE_OPENSSL:BOOL=ON \
236;
237make VERBOSE=1
238
239
240%install
241rm -rf %{buildroot}
242mkdir -p %{buildroot}%{_pkgdocdir}
243%make_install -C build CMAKE_DOC_DIR=%{buildroot}%{_pkgdocdir}
244find %{buildroot}/%{_datadir}/%{name}/Modules -type f | xargs chmod -x
245[ -n "$(find %{buildroot}/%{_datadir}/%{name}/Modules -name \*.orig)" ] &&
246 echo "Found .orig files in %{_datadir}/%{name}/Modules, rebase patches" &&
247 exit 1
248# Install major_version name links
249%{!?name_suffix:for f in ccmake cmake cpack ctest; do ln -s ${f}.exe %{buildroot}%{_bindir}/${f}%{major_version}; done}
250# Install bash completion symlinks
251#mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
252#for f in %{buildroot}%{_datadir}/%{name}/completions/*
253#do
254# ln -s ../../%{name}/completions/$(basename $f) %{buildroot}%{_datadir}/bash-completion/completions
255#done
256%if %{with emacs}
257# Install emacs cmake mode
258mkdir -p %{buildroot}%{_emacs_sitelispdir}/%{name}
259install -p -m 0644 Auxiliary/cmake-mode.el %{buildroot}%{_emacs_sitelispdir}/%{name}/%{name}-mode.el
260%{_emacs_bytecompile} %{buildroot}%{_emacs_sitelispdir}/%{name}/%{name}-mode.el
261mkdir -p %{buildroot}%{_emacs_sitestartdir}
262install -p -m 0644 %SOURCE1 %{buildroot}%{_emacs_sitestartdir}
263%endif
264# RPM macros
265install -p -m0644 -D %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name}
266sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" -e "s|@@CMAKE_MAJOR_VERSION@@|%{major_version}|" %{buildroot}%{rpm_macros_dir}/macros.%{name}
267touch -r %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name}
268%if %{with rpm} && 0%{?_rpmconfigdir:1}
269# RPM auto provides
270install -p -m0644 -D %{SOURCE3} %{buildroot}%{_prefix}/lib/rpm/fileattrs/%{name}.attr
271install -p -m0755 -D %{name}.prov %{buildroot}%{_prefix}/lib/rpm/%{name}.prov
272install -p -m0755 -D %{name}.req %{buildroot}%{_prefix}/lib/rpm/%{name}.req
273%endif
274mkdir -p %{buildroot}%{_libdir}/%{orig_name}
275# Install copyright files for main package
276find Source Utilities -type f -iname copy\* | while read f
277do
278 fname=$(basename $f)
279 dir=$(dirname $f)
280 dname=$(basename $dir)
281 cp -p $f ./${fname}_${dname}
282done
283# Cleanup pre-installed documentation
284%if %{with sphinx}
285mv %{buildroot}%{_docdir}/%{name}/html .
286%endif
287rm -rf %{buildroot}%{_docdir}/%{name}
288# Install documentation to _pkgdocdir
289mkdir -p %{buildroot}%{_pkgdocdir}
290cp -pr %{buildroot}%{_datadir}/%{name}/Help %{buildroot}%{_pkgdocdir}
291mv %{buildroot}%{_pkgdocdir}/Help %{buildroot}%{_pkgdocdir}/rst
292%if %{with sphinx}
293mv html %{buildroot}%{_pkgdocdir}
294%endif
295
296%if %{with gui}
297# Desktop file
298%if %{with appdata}
299desktop-file-install --delete-original \
300 --dir=%{buildroot}%{_datadir}/applications \
301 %{buildroot}%{_datadir}/applications/%{name}-gui.desktop
302
303# Register as an application to be visible in the software center
304#
305# NOTE: It would be *awesome* if this file was maintained by the upstream
306# project, translated and installed into the right place during `make install`.
307#
308# See http://www.freedesktop.org/software/appstream/docs/ for more details.
309#
310mkdir -p %{buildroot}%{_metainfodir}
311cat > %{buildroot}%{_metainfodir}/cmake-gui.appdata.xml <<EOF
312<?xml version="1.0" encoding="UTF-8"?>
313<!-- Copyright 2014 Ryan Lerch <rlerch@redhat.com> -->
314<!--
315EmailAddress: kitware@kitware.com
316SentUpstream: 2014-09-17
317-->
318<application>
319 <id type="desktop">cmake-gui.desktop</id>
320 <metadata_license>CC0-1.0</metadata_license>
321 <name>CMake GUI</name>
322 <summary>Create new CMake projects</summary>
323 <description>
324 <p>
325 CMake is an open source, cross platform build system that can build, test,
326 and package software. CMake GUI is a graphical user interface that can
327 create and edit CMake projects.
328 </p>
329 </description>
330 <url type="homepage">http://www.cmake.org</url>
331 <screenshots>
332 <screenshot type="default">https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/CMake/a.png</screenshot>
333 </screenshots>
334 <!-- FIXME: change this to an upstream email address for spec updates
335 <updatecontact>someone_who_cares@upstream_project.org</updatecontact>
336 -->
337</application>
338EOF
339%endif
340%endif
341
342# create manifests for splitting files and directories for filesystem-package
343find %{buildroot}%{_datadir}/%{name} -type d | \
344 sed -e 's!^%{buildroot}!%%dir "!g' -e 's!$!"!g' > data_dirs.mf
345find %{buildroot}%{_datadir}/%{name} -type f | \
346 sed -e 's!^%{buildroot}!"!g' -e 's!$!"!g' > data_files.mf
347find %{buildroot}%{_libdir}/%{orig_name} -type d | \
348 sed -e 's!^%{buildroot}!%%dir "!g' -e 's!$!"!g' > lib_dirs.mf
349find %{buildroot}%{_libdir}/%{orig_name} -type f | \
350 sed -e 's!^%{buildroot}!"!g' -e 's!$!"!g' > lib_files.mf
351find %{buildroot}%{_bindir} -type f -or -type l -or -xtype l | \
352 sed -e '/.*-gui.exe$/d' -e '/^$/d' -e 's!^%{buildroot}!"!g' -e 's!$!"!g' >> lib_files.mf
353
354
355%if %{with test}
356%check
357cd build
358#CMake.FileDownload, CTestTestUpload, and curl require internet access
359# RunCMake.CPack_RPM is broken if disttag contains "+", bug #1499151
360NO_TEST="CMake.FileDownload|CTestTestUpload|curl|RunCMake.CPack_RPM"
361NO_TEST="$NO_TEST|CPackComponentsForAll-RPM-IgnoreGroup"
362# RunCMake.File_Generate fails on S390X
363%ifarch s390x
364NO_TEST="$NO_TEST|RunCMake.File_Generate"
365%endif
366export NO_TEST
367bin/ctest%{?name_suffix} -V -E "$NO_TEST" %{?_smp_mflags}
368cd ..
369%endif
370
371
372%files -f lib_files.mf
373%doc %dir %{_pkgdocdir}
374%license Copyright.txt*
375%license COPYING*
376%if %{with sphinx}
377%{_mandir}/man1/c%{name}.1.*
378%{_mandir}/man1/%{name}.1.*
379%{_mandir}/man1/cpack%{?name_suffix}.1.*
380%{_mandir}/man1/ctest%{?name_suffix}.1.*
381%{_mandir}/man7/*.7.*
382%endif
383
384
385%files data -f data_files.mf
386%{_datadir}/aclocal/%{name}.m4
387#%{_datadir}/bash-completion
388%if %{with emacs}
389%{_emacs_sitelispdir}
390%{_emacs_sitestartdir}
391%endif
392
393
394%files doc
395# Pickup license-files from main-pkg's license-dir
396# If there's no license-dir they are picked up by %%doc previously
397#%{?_licensedir:%license %{_datadir}/licenses/%{name}*}
398%doc %{_pkgdocdir}
399
400
401%files filesystem -f data_dirs.mf -f lib_dirs.mf
402
403
404%if %{with gui}
405%files gui
406%{_bindir}/%{name}-gui.exe
407%if %{with appdata}
408%{_metainfodir}/*.appdata.xml
409%{_datadir}/applications/CMake%{?name_suffix}.desktop
410%{_datadir}/mime/packages/
411%{_datadir}/icons/hicolor/*/apps/CMake%{?name_suffix}Setup.png
412%endif
413%if %{with sphinx}
414%{_mandir}/man1/%{name}-gui.1.*
415%endif
416%endif
417
418
419%files rpm-macros
420%{rpm_macros_dir}/macros.%{name}
421%if %{with rpm} && 0%{?_rpmconfigdir:1}
422%{_rpmconfigdir}/fileattrs/%{name}.attr
423%{_rpmconfigdir}/%{name}.prov
424%{_rpmconfigdir}/%{name}.req
425%endif
426
427
428%changelog
429* Mon Sep 16 2019 Silvan Scherrer <silvan.scherrer@aroa.ch> 3.10.3-1
430- update to vendor version 3.10.3
431
432* Wed Jan 25 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 3.7.0-2
433- adjust def file creation
434
435* Mon Dec 05 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> 3.7.0-1
436- initial rpm version
Note: See TracBrowser for help on using the repository browser.