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

Last change on this file since 1566 was 936, checked in by Silvan Scherrer, 9 years ago

spec: cmake: Release version 3.7.0-2.

File size: 7.7 KB
Line 
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
26Name: %{orig_name}%{?name_suffix}
27Version: %{major_version}.%{minor_version}.0
28Release: 2%{?dist}
29Summary: 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
36License: BSD and MIT and zlib
37URL: http://www.cmake.org
38Vendor: bww bitwise works GmbH
39Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
40Source2: macros.%{name}
41
42
43#BuildRequires: gcc-gfortran
44#BuildRequires: ncurses-devel, libX11-devel
45BuildRequires: bzip2-devel
46BuildRequires: curl-devel
47BuildRequires: expat-devel
48#BuildRequires: jsoncpp-devel
49#BuildRequires: libarchive-devel
50#BuildRequires: libuv-devel
51%if 0%{?with_sphinx:1}
52BuildRequires: /@unixroot/usr/bin/sphinx-build
53%endif
54BuildRequires: xz-devel
55BuildRequires: zlib-devel
56#BuildRequires: emacs
57BuildRequires: python2-devel
58%if %{with gui}
59BuildRequires: libqt4-devel
60#BuildRequires: desktop-file-utils
61%global qt_gui --qt-gui
62%endif
63
64Requires: %{name}-data = %{version}-%{release}
65Requires: rpm
66
67# Provide the major version name
68Provides: %{orig_name}%{major_version} = %{version}-%{release}
69
70
71%description
72CMake is used to control the software compilation process using simple
73platform and compiler independent configuration files. CMake generates
74native makefiles and workspaces that can be used in the compiler
75environment of your choice. CMake is quite sophisticated: it is possible
76to support complex environments requiring system configuration, preprocessor
77generation, code generation, and template instantiation.
78
79
80%package data
81Summary: Common data-files for %{name}
82Requires: %{name} = %{version}-%{release}
83BuildArch: noarch
84
85%description data
86This package contains common data-files for %{name}.
87
88
89%package doc
90Summary: Documentation for %{name}
91BuildArch: noarch
92
93%description doc
94This package contains documentation for %{name}.
95
96
97%package gui
98Summary: Qt GUI for %{name}
99
100Requires: %{name} = %{version}-%{release}
101#Requires: hicolor-icon-theme
102#Requires: shared-mime-info
103
104%description gui
105The %{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
116svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
117rm -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
123export CFLAGS="%{optflags}"
124export CXXFLAGS="%{optflags}"
125export LDFLAGS="-Zomf -Zhigh-mem -lcx %{?__global_ldflags}"
126export VENDOR="%{vendor}"
127mkdir build
128cd 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
138make
139
140
141%install
142cd build
143make install DESTDIR=%{buildroot}
144find %{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
148cd ..
149
150# RPM macros
151install -p -m0644 -D %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name}
152sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" -e "s|@@CMAKE_MAJOR_VERSION@@|%{major_version}|" %{buildroot}%{rpm_macros_dir}/macros.%{name}
153touch -r %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name}
154
155mkdir -p %{buildroot}%{_libdir}/%{name}
156# Install copyright files for main package
157find Source Utilities -type f -iname copy\* | while read f
158do
159 fname=$(basename $f)
160 dir=$(dirname $f)
161 dname=$(basename $dir)
162 cp -p $f ./${fname}_${dname}
163done
164
165# Cleanup pre-installed documentation
166%if 0%{?with_sphinx:1}
167mv %{buildroot}%{_docdir}/%{name}/html .
168%endif
169rm -rf %{buildroot}%{_docdir}/%{name}
170# Install documentation to _pkgdocdir
171mkdir -p %{buildroot}%{_pkgdocdir}
172cp -pr %{buildroot}%{_datadir}/%{name}/Help %{buildroot}%{_pkgdocdir}
173mv %{buildroot}%{_pkgdocdir}/Help %{buildroot}%{_pkgdocdir}/rst
174%if 0%{?with_sphinx:1}
175mv html %{buildroot}%{_pkgdocdir}
176%endif
177
178%if %{with desktop}
179# Desktop file
180desktop-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
195update-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
200update-desktop-database &> /dev/null || :
201if [ $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 || :
206fi
207
208%posttrans gui
209update-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
Note: See TracBrowser for help on using the repository browser.