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

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

spec: cmake: Release version 3.7.0-1.

File size: 7.6 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 1874
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: 1%{?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}"
126mkdir build
127cd build
128# --%{?with_bootstrap:no-}system-libs \
129../bootstrap --prefix=%{_prefix} --datadir=/share/%{name} \
130 --docdir=/share/doc/%{name} --mandir=/share/man \
131 --verbose --system-bzip2 --system-curl --system-expat \
132 --system-liblzma --system-zlib \
133 %{?with_sphinx:--sphinx-man --sphinx-html} \
134 %{?qt_gui} -- \
135 -DCMAKE_USE_OPENSSL:BOOL=ON
136
137make
138
139
140%install
141cd build
142make install DESTDIR=%{buildroot}
143find %{buildroot}/%{_datadir}/%{name}/Modules -type f | xargs chmod -x
144[ -n "$(find %{buildroot}/%{_datadir}/%{name}/Modules -name \*.orig)" ] &&
145 echo "Found .orig files in %{_datadir}/%{name}/Modules, rebase patches" &&
146 exit 1
147cd ..
148
149# RPM macros
150install -p -m0644 -D %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name}
151sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" -e "s|@@CMAKE_MAJOR_VERSION@@|%{major_version}|" %{buildroot}%{rpm_macros_dir}/macros.%{name}
152touch -r %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name}
153
154mkdir -p %{buildroot}%{_libdir}/%{name}
155# Install copyright files for main package
156find Source Utilities -type f -iname copy\* | while read f
157do
158 fname=$(basename $f)
159 dir=$(dirname $f)
160 dname=$(basename $dir)
161 cp -p $f ./${fname}_${dname}
162done
163
164# Cleanup pre-installed documentation
165%if 0%{?with_sphinx:1}
166mv %{buildroot}%{_docdir}/%{name}/html .
167%endif
168rm -rf %{buildroot}%{_docdir}/%{name}
169# Install documentation to _pkgdocdir
170mkdir -p %{buildroot}%{_pkgdocdir}
171cp -pr %{buildroot}%{_datadir}/%{name}/Help %{buildroot}%{_pkgdocdir}
172mv %{buildroot}%{_pkgdocdir}/Help %{buildroot}%{_pkgdocdir}/rst
173%if 0%{?with_sphinx:1}
174mv html %{buildroot}%{_pkgdocdir}
175%endif
176
177%if %{with desktop}
178# Desktop file
179desktop-file-install --delete-original \
180 --dir=%{buildroot}%{_datadir}/applications \
181 %{buildroot}/%{_datadir}/applications/CMake%{?name_suffix}.desktop
182%endif
183
184
185%check
186#cd build
187#CMake.FileDownload, and CTestTestUpload require internet access
188#bin/ctest%{?name_suffix} -V -E 'CMake.FileDownload|CTestTestUpload' %{?_smp_mflags}
189#cd ..
190
191
192%if %{with desktop}
193%post gui
194update-desktop-database &> /dev/null || :
195/bin/touch --no-create %{_datadir}/mime || :
196/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
197
198%postun gui
199update-desktop-database &> /dev/null || :
200if [ $1 -eq 0 ] ; then
201 /bin/touch --no-create %{_datadir}/mime || :
202 update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
203 /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
204 /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
205fi
206
207%posttrans gui
208update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
209/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
210%endif
211
212
213%files
214%doc %dir %{_pkgdocdir}
215%license Copyright.txt*
216%license COPYING*
217#%{_bindir}/c%{name}.exe
218%{_bindir}/%{name}.exe
219%{_bindir}/cpack.exe
220%{_bindir}/ctest.exe
221%if 0%{?with_sphinx:1}
222#%{_mandir}/man1/c%{name}.1.*
223%{_mandir}/man1/%{name}.1.*
224%{_mandir}/man1/cpack.1.*
225%{_mandir}/man1/ctest.1.*
226%{_mandir}/man7/*.7.*
227%endif
228%{_libdir}/%{name}/
229
230
231%files data
232%{_datadir}/aclocal/%{name}.m4
233%{_datadir}/%{name}/
234%{rpm_macros_dir}/macros.%{name}
235
236
237%files doc
238# Pickup license-files from main-pkg's license-dir
239# If there's no license-dir they are picked up by %%doc previously
240%{?_licensedir:%license %{_datadir}/licenses/%{name}*}
241%doc %{_pkgdocdir}/
242
243
244%if %{with gui}
245%files gui
246%{_bindir}/%{name}-gui.exe
247%if %{with desktop}
248%{_datadir}/applications/CMake%{?name_suffix}.desktop
249%{_datadir}/mime/packages/
250%{_datadir}/icons/hicolor/*/apps/CMake%{?name_suffix}Setup.png
251%endif
252%if 0%{?with_sphinx:1}
253%{_mandir}/man1/%{name}-gui.1.*
254%endif
255%endif
256
257
258%changelog
259* Mon Dec 05 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> 3.7.0-1
260- initial rpm version
Note: See TracBrowser for help on using the repository browser.