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