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

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

spec: cmake preview version

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