[1041] | 1 | #
|
---|
| 2 | # http://svn.netlabs.org/qt4
|
---|
| 3 | #
|
---|
[1068] | 4 | # If you are a packager, please read HowToDistribute.txt for general
|
---|
| 5 | # instructions.
|
---|
| 6 | #
|
---|
[1041] | 7 |
|
---|
[1068] | 8 | Name: qt
|
---|
| 9 | Vendor: netlabs.org
|
---|
| 10 | License: LGPLv2 with exceptions or GPLv3 with exceptions
|
---|
| 11 | Url: http://www.qtsoftware.com/
|
---|
| 12 |
|
---|
[1041] | 13 | %define ver_major 4
|
---|
[1068] | 14 | %define ver_minor 7
|
---|
[1041] | 15 | %define ver_patch 3
|
---|
| 16 |
|
---|
[1068] | 17 | %define os2_release 0
|
---|
| 18 |
|
---|
[1041] | 19 | %define rpm_release 1
|
---|
| 20 |
|
---|
[1068] | 21 | %define svn_revision 1070
|
---|
[1041] | 22 |
|
---|
| 23 | %define descr_brief Qt is a software toolkit for developing applications.
|
---|
| 24 |
|
---|
| 25 | %define pkg_wps_base QT4
|
---|
| 26 | %define pkg_wps_folder_id <%{pkg_wps_base}_FOLDER>
|
---|
| 27 | %define pkg_wps_folder_create %{pkg_wps_base}_FOLDER:WPFolder|Qt 4|<WP_DESKTOP>
|
---|
| 28 | %define pkg_wps_view_txt() EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=((%*))
|
---|
| 29 |
|
---|
[1068] | 30 | %define pkg_docdir %{_docdir}/%{name}
|
---|
[1041] | 31 |
|
---|
[1068] | 32 | %if 0%{?os2_release}
|
---|
| 33 | Version: %{ver_major}.%{ver_minor}.%{ver_patch}.%{os2_release}
|
---|
| 34 | %else
|
---|
| 35 | Version: %{ver_major}.%{ver_minor}.%{ver_patch}
|
---|
| 36 | %endif
|
---|
| 37 | Release: %{rpm_release}
|
---|
| 38 |
|
---|
| 39 | Source: %{name}-%{version}.zip
|
---|
| 40 |
|
---|
| 41 | #BuildRequires: gnumake (when available)
|
---|
| 42 | BuildRequires: libc-devel
|
---|
| 43 | BuildRequires: gcc
|
---|
| 44 | BuildRequires: gcc-wlink
|
---|
| 45 | BuildRequires: gcc-wrc
|
---|
| 46 | #BuildRequires: cups-devel (when available)
|
---|
| 47 | BuildRequires: openssl-devel
|
---|
| 48 | BuildRequires: pthread-devel
|
---|
| 49 | #BuildRequires: mysql-devel (when available)
|
---|
| 50 | #BuildRequires: psql-devel (when available)
|
---|
| 51 |
|
---|
| 52 | # @todo add wrc support to Qt!
|
---|
| 53 |
|
---|
| 54 | #------------------------------------------------------------------------------
|
---|
| 55 | # commons
|
---|
| 56 | #------------------------------------------------------------------------------
|
---|
| 57 |
|
---|
| 58 | # process command line arguments
|
---|
| 59 | %if "%{?QT_SOURCE_TREE}" == ""
|
---|
| 60 | %define QT_SOURCE_TREE .
|
---|
| 61 | %endif
|
---|
| 62 |
|
---|
| 63 | %if "%{?QT_BUILD_TREE}" != ""
|
---|
| 64 | %define skip_prep 1
|
---|
| 65 | %define skip_build 1
|
---|
| 66 | %define skip_install 1
|
---|
| 67 | %endif
|
---|
| 68 |
|
---|
| 69 | # @todo temporary
|
---|
| 70 | %define skip_prep_export 1
|
---|
| 71 |
|
---|
| 72 | # installation paths
|
---|
[1041] | 73 | %define qt_prefix %{_libdir}/%{qtM}
|
---|
| 74 | %define qt_libdir %{_libdir}
|
---|
[1062] | 75 | %define qt_headerdir %{_includedir}/qt4
|
---|
[1041] | 76 | %define qt_bindir %{qt_prefix}/bin
|
---|
| 77 | %define qt_plugindir %{qt_prefix}/plugins
|
---|
[1062] | 78 | %define qt_importdir %{qt_prefix}/imports
|
---|
[1041] | 79 | %define qt_demosdir %{qt_prefix}/demos
|
---|
| 80 | %define qt_examplesdir %{qt_prefix}/examples
|
---|
[1062] | 81 | %define qt_datadir %{_datadir}/%{qtM}
|
---|
[1041] | 82 | %define qt_docdir %{qt_datadir}/doc
|
---|
| 83 | %define qt_translationdir %{qt_datadir}/translations
|
---|
| 84 | %define qt_sysconfdir %{_sysconfdir}/xdg
|
---|
| 85 |
|
---|
[1068] | 86 | %define qtM %{name}%{ver_major}
|
---|
| 87 |
|
---|
[1041] | 88 | #------------------------------------------------------------------------------
|
---|
| 89 | # main package
|
---|
| 90 | #------------------------------------------------------------------------------
|
---|
| 91 |
|
---|
| 92 | Summary: Qt runtime
|
---|
| 93 | Group: System Environment/Libraries
|
---|
| 94 |
|
---|
| 95 | Provides: %{qtM} = %{version}-%{release}
|
---|
| 96 |
|
---|
[1062] | 97 | %description
|
---|
[1041] | 98 | %{descr_brief}
|
---|
| 99 |
|
---|
| 100 | This package contains runtime Qt libraries for console applications, including
|
---|
| 101 | core, network and XML modules.
|
---|
| 102 |
|
---|
| 103 | %files
|
---|
| 104 | %defattr(-,root,root,-)
|
---|
[1068] | 105 | %{qt_libdir}/QtCore%{ver_major}.dll
|
---|
[1041] | 106 |
|
---|
| 107 | %pre
|
---|
| 108 |
|
---|
[1068] | 109 | %warpin_conflicts_begin
|
---|
| 110 | netlabs.org\Qt4\Runtime
|
---|
| 111 | %warpin_conflicts_end
|
---|
[1041] | 112 |
|
---|
| 113 | #------------------------------------------------------------------------------
|
---|
| 114 | %package pm
|
---|
| 115 | #------------------------------------------------------------------------------
|
---|
| 116 |
|
---|
| 117 | Summary: Qt GUI runtime
|
---|
| 118 | Group: System Environment/Libraries
|
---|
| 119 |
|
---|
[1068] | 120 | Requires: %{name} = %{version}-%{release}
|
---|
[1041] | 121 |
|
---|
| 122 | Provides: %{qtM}-pm = %{version}-%{release}
|
---|
| 123 |
|
---|
| 124 | %description pm
|
---|
| 125 | %{descr_brief}
|
---|
| 126 |
|
---|
| 127 | This package contains runtime Qt libraries for Presentation Manager GUI
|
---|
| 128 | applications.
|
---|
| 129 |
|
---|
| 130 | %files pm
|
---|
| 131 | %defattr(-,root,root,-)
|
---|
[1068] | 132 | %{qt_libdir}/QtGui%{ver_major}.dll
|
---|
[1041] | 133 |
|
---|
| 134 | #------------------------------------------------------------------------------
|
---|
[1068] | 135 | %package examples
|
---|
[1041] | 136 | #------------------------------------------------------------------------------
|
---|
[1068] | 137 | Summary: Example applications for Qt
|
---|
[1041] | 138 | Group: Documentation
|
---|
| 139 |
|
---|
[1068] | 140 | Requires: %{name}-pm = %{version}-%{release}
|
---|
[1041] | 141 |
|
---|
[1068] | 142 | Provides: %{qtM}-examples = %{version}-%{release}
|
---|
[1041] | 143 |
|
---|
[1068] | 144 | %description examples
|
---|
[1041] | 145 | %{descr_brief}
|
---|
| 146 |
|
---|
[1062] | 147 | This package contains the demo and example Qt applications and their
|
---|
| 148 | source code. These applications demonstrate the possibilities of the
|
---|
| 149 | Qt toolkit.
|
---|
[1041] | 150 |
|
---|
[1068] | 151 | %files examples
|
---|
[1041] | 152 | %defattr(-,root,root,-)
|
---|
| 153 | %{qt_bindir}/qtdemo.exe
|
---|
| 154 | # @todo put shortcuts to /usr/bin
|
---|
| 155 | #%if "%{qt_bindir}" != "%{_bindir}"
|
---|
| 156 | #%endif
|
---|
[1068] | 157 | #%dir %{qt_examplesdir}/
|
---|
| 158 | #%dir %{qt_demosdir}/
|
---|
[1041] | 159 |
|
---|
[1068] | 160 | %post examples
|
---|
[1062] | 161 |
|
---|
[1068] | 162 | %wps_object_create_begin -n %{name}-examples
|
---|
[1062] | 163 | %pkg_wps_folder_create%
|
---|
| 164 | %{pkg_wps_base}_DEMO:WPProgram|Examples and Demos|<QT4_FOLDER>|EXENAME=((%{qt_bindir}/qtdemo.exe))
|
---|
| 165 | #%{pkg_wps_base}_CHANGELOG:WPProgram|ChangeLog|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/ChangeLog}
|
---|
[1041] | 166 | %wps_object_create_end
|
---|
| 167 |
|
---|
[1068] | 168 | %postun examples
|
---|
| 169 | %wps_object_delete_all -n %{name}-examples
|
---|
[1041] | 170 |
|
---|
| 171 | #------------------------------------------------------------------------------
|
---|
| 172 | %package linguist
|
---|
| 173 | #------------------------------------------------------------------------------
|
---|
| 174 | Summary: Qt Linguist tool
|
---|
| 175 | Group: Development/Tools
|
---|
| 176 |
|
---|
[1068] | 177 | Requires: %{name}-pm = %{version}-%{release}
|
---|
[1041] | 178 |
|
---|
| 179 | Provides: %{qtM}-linguist = %{version}-%{release}
|
---|
| 180 |
|
---|
| 181 | %description linguist
|
---|
| 182 | %{descr_brief}
|
---|
| 183 |
|
---|
| 184 | This package contains the Qt Linguist tool used to edit the translation files
|
---|
| 185 | for Qt applications.
|
---|
| 186 |
|
---|
| 187 | %files linguist
|
---|
| 188 | %defattr(-,root,root,-)
|
---|
| 189 | %{qt_bindir}/linguist.exe
|
---|
| 190 |
|
---|
| 191 | %post linguist
|
---|
| 192 | %wps_object_create_begin -n %{name}-linguist
|
---|
| 193 | %{wps_qt4_folder}
|
---|
| 194 | QT4_LINGUIST:WPProgram|Linguist|<QT4_FOLDER>|EXENAME=((%{qt_bindir}/linguist.exe))
|
---|
| 195 | %wps_object_create_end
|
---|
| 196 |
|
---|
| 197 | %postun linguist
|
---|
| 198 | %wps_object_delete_all -n %{name}-linguist
|
---|
| 199 |
|
---|
| 200 | #------------------------------------------------------------------------------
|
---|
| 201 | %package assistant
|
---|
| 202 | #------------------------------------------------------------------------------
|
---|
| 203 | Summary: Qt Assistant tool
|
---|
| 204 | Group: Development/Tools
|
---|
| 205 |
|
---|
[1068] | 206 | Requires: %{name}-pm = %{version}-%{release}
|
---|
[1041] | 207 |
|
---|
| 208 | Provides: %{qtM}-assistant = %{version}-%{release}
|
---|
| 209 |
|
---|
| 210 | %description assistant
|
---|
| 211 | %{descr_brief}
|
---|
| 212 |
|
---|
| 213 | This package contains the Qt Assistant tool used to read and search the Qt
|
---|
| 214 | Toolkit reference documentation.
|
---|
| 215 |
|
---|
| 216 | %files assistant
|
---|
| 217 | %defattr(-,root,root,-)
|
---|
| 218 | %{qt_bindir}/assistant.exe
|
---|
| 219 |
|
---|
| 220 | #------------------------------------------------------------------------------
|
---|
[1068] | 221 | %package designer
|
---|
| 222 | #------------------------------------------------------------------------------
|
---|
| 223 | Summary: Qt Designer tool
|
---|
| 224 | Group: Development/Tools
|
---|
| 225 |
|
---|
| 226 | Requires: %{name}-pm = %{version}-%{release}
|
---|
| 227 |
|
---|
| 228 | Provides: %{qtM}-designer = %{version}-%{release}
|
---|
| 229 |
|
---|
| 230 | %description designer
|
---|
| 231 | %{descr_brief}
|
---|
| 232 |
|
---|
| 233 | This package contains the Qt Designer tool used to for designing and building
|
---|
| 234 | graphical user interfaces from Qt components.
|
---|
| 235 |
|
---|
| 236 | %files designer
|
---|
| 237 | %defattr(-,root,root,-)
|
---|
| 238 | %{qt_bindir}/designer.exe
|
---|
| 239 |
|
---|
| 240 | #------------------------------------------------------------------------------
|
---|
| 241 | %package devel-tools
|
---|
| 242 | #------------------------------------------------------------------------------
|
---|
| 243 | Summary: Qt development tools
|
---|
| 244 | Group: Development/Tools
|
---|
| 245 |
|
---|
| 246 | Requires: %{name}-pm = %{version}-%{release}
|
---|
| 247 |
|
---|
| 248 | Provides: %{qtM}-devel-tools = %{version}-%{release}
|
---|
| 249 |
|
---|
| 250 | %description devel-tools
|
---|
| 251 | %{descr_brief}
|
---|
| 252 |
|
---|
| 253 | This package contains tools used to assist in Qt development, including
|
---|
| 254 | PixelTool, QML Viewer, Help Converter and other applications.
|
---|
| 255 |
|
---|
| 256 | %files devel-tools
|
---|
| 257 | %defattr(-,root,root,-)
|
---|
| 258 | %{qt_bindir}/pixeltool.exe
|
---|
| 259 |
|
---|
| 260 | #------------------------------------------------------------------------------
|
---|
[1041] | 261 | %package doc
|
---|
| 262 | #------------------------------------------------------------------------------
|
---|
| 263 | Summary: API documentation for Qt
|
---|
| 264 | Group: Documentation
|
---|
| 265 | BuildArch: noarch
|
---|
| 266 |
|
---|
[1068] | 267 | Requires: %{name}-assistant = %{version}-%{release}
|
---|
[1041] | 268 |
|
---|
| 269 | Provides: %{qtM}-doc = %{version}-%{release}
|
---|
| 270 |
|
---|
| 271 | %description doc
|
---|
| 272 | %{descr_brief}
|
---|
| 273 |
|
---|
| 274 | This package contains the Qt Toolkit reference documentation that provides the
|
---|
| 275 | detailed description of all Qt classes and tools.
|
---|
| 276 |
|
---|
| 277 | %files doc
|
---|
| 278 | %defattr(-,root,root,-)
|
---|
| 279 | %{qt_docdir}/qch/*.qch
|
---|
| 280 |
|
---|
| 281 | # @todo assistant.exe -remove-search-index
|
---|
| 282 |
|
---|
| 283 | #------------------------------------------------------------------------------
|
---|
| 284 | %package devel
|
---|
| 285 | #------------------------------------------------------------------------------
|
---|
| 286 | Summary: Development files for Qt
|
---|
| 287 | Group: Development/Libraries
|
---|
| 288 |
|
---|
[1068] | 289 | Requires: %{name}-pm = %{version}-%{release}
|
---|
[1041] | 290 |
|
---|
| 291 | Provides: %{qtM}-devel = %{version}-%{release}
|
---|
| 292 |
|
---|
| 293 | %description devel
|
---|
| 294 | %{descr_brief}
|
---|
| 295 |
|
---|
| 296 | This package contains the headers, libraries and tools necessary to develop
|
---|
[1068] | 297 | applications using the Qt toolkit.
|
---|
[1041] | 298 |
|
---|
| 299 | %files devel
|
---|
| 300 | %defattr(-,root,root,-)
|
---|
[1068] | 301 | %{qt_bindir}/moc.exe
|
---|
[1041] | 302 |
|
---|
| 303 | #------------------------------------------------------------------------------
|
---|
[1068] | 304 | %package devel-all
|
---|
| 305 | #------------------------------------------------------------------------------
|
---|
| 306 | Summary: Qt development kit
|
---|
| 307 | Group: Development/Libraries
|
---|
| 308 |
|
---|
| 309 | Requires: %{name}-examples = %{version}-%{release}
|
---|
| 310 | Requires: %{name}-linguist = %{version}-%{release}
|
---|
| 311 | Requires: %{name}-assistant = %{version}-%{release}
|
---|
| 312 | Requires: %{name}-designer = %{version}-%{release}
|
---|
| 313 | Requires: %{name}-devel-tools = %{version}-%{release}
|
---|
| 314 | Requires: %{name}-doc = %{version}-%{release}
|
---|
| 315 |
|
---|
| 316 | Provides: %{qtM}-devel-all = %{version}-%{release}
|
---|
| 317 |
|
---|
| 318 | %description devel-all
|
---|
| 319 | %{descr_brief}
|
---|
| 320 |
|
---|
| 321 | This meta package installs all individual packages containing various Qt
|
---|
| 322 | development components, including the Qt headers and libraries, the Linguist,
|
---|
| 323 | Assistant and designer Designer applications, development tools, example
|
---|
| 324 | Qt applications and the API documentation.
|
---|
| 325 |
|
---|
| 326 | #------------------------------------------------------------------------------
|
---|
[1041] | 327 | %prep
|
---|
| 328 | #------------------------------------------------------------------------------
|
---|
| 329 |
|
---|
[1068] | 330 | %if !0%{?skip_prep}
|
---|
| 331 |
|
---|
[1062] | 332 | %if "%{?QT_SOURCE_TREE}" != ""
|
---|
[1068] | 333 | %if !0%{?skip_prep_export}
|
---|
| 334 | # get clean source tree from SVN
|
---|
| 335 | %setup -n "%{name}-%{version}" -Tc
|
---|
| 336 | svn export -r %{svn_revision} %{QT_SOURCE_TREE} .
|
---|
[1041] | 337 | %else
|
---|
[1068] | 338 | # use passed source tree as is (shadow build)
|
---|
| 339 | %setup -n "%{name}-%{version}" -TDc
|
---|
[1041] | 340 | %endif
|
---|
[1068] | 341 | %else
|
---|
| 342 | # use source zip
|
---|
| 343 | %setup -q
|
---|
| 344 | %endif
|
---|
[1041] | 345 |
|
---|
[1068] | 346 | %endif # if !0%{?skip_prep}
|
---|
| 347 |
|
---|
[1041] | 348 | #------------------------------------------------------------------------------
|
---|
| 349 | %build
|
---|
| 350 | #------------------------------------------------------------------------------
|
---|
| 351 |
|
---|
[1068] | 352 | %if !0%{?skip_build}
|
---|
[1041] | 353 |
|
---|
[1062] | 354 | die() { echo "ERROR: $@"; exit 1; }
|
---|
| 355 | check_var() { eval "[ -n \"\$$1\" ] || die \"$1 variable is not set.\""; }
|
---|
| 356 |
|
---|
[1068] | 357 | # Qt source tree (DOS format)
|
---|
[1062] | 358 | QT_SOURCE_TREE_D=$(echo "%{QT_SOURCE_TREE}" | tr '/' '\\')
|
---|
| 359 |
|
---|
| 360 | # Sanity checks (laking these would turn off features that must be ON)
|
---|
[1068] | 361 | check_var "CUPS_INCLUDEPATH"
|
---|
[1062] | 362 | check_var "MYSQL_INCLUDEPATH"
|
---|
| 363 | check_var "MYSQL_LIBS"
|
---|
| 364 | check_var "PSQL_INCLUDEPATH"
|
---|
| 365 | check_var "PSQL_LIBS"
|
---|
| 366 |
|
---|
[1068] | 367 | # Qt links to some OS/2 DLLs directly (w/o import libs)
|
---|
| 368 | export LIBRARY_PATH=%{os2_boot_drive}/OS2/DLL\;%{os2_boot_drive}/MPTN/DLL\;$LIBRARY_PATH
|
---|
| 369 |
|
---|
[1062] | 370 | # CMD.EXE is required by the build process for now
|
---|
| 371 | export MAKESHELL=%{os2_boot_drive}\\OS2\\CMD.EXE
|
---|
| 372 |
|
---|
| 373 | # Qt doesn't understand /@unixroot in library paths, replace it with $(UNIXROOT)
|
---|
| 374 | library_paths=$(echo \
|
---|
| 375 | --official-build-quiet %{svn_revision} \
|
---|
| 376 | -prefix "%{qt_prefix}" \
|
---|
| 377 | -datadir "%{qt_datadir}" \
|
---|
| 378 | -libdir "%{qt_libdir}" \
|
---|
| 379 | -headerdir "%{qt_headerdir}" \
|
---|
| 380 | -bindir "%{qt_bindir}" \
|
---|
| 381 | -plugindir "%{qt_plugindir}" \
|
---|
| 382 | -importdir "%{qt_importdir}" \
|
---|
| 383 | -demosdir "%{qt_demosdir}" \
|
---|
| 384 | -examplesdir "%{qt_examplesdir}" \
|
---|
| 385 | -docdir "%{qt_docdir}" \
|
---|
| 386 | -translationdir "%{qt_translationdir}" \
|
---|
| 387 | -sysconfdir "%{qt_sysconfdir}" \
|
---|
| 388 | | sed -re 's,/@unixroot,$(UNIXROOT),g')
|
---|
| 389 |
|
---|
| 390 | cmd /c $QT_SOURCE_TREE_D\\configure.cmd $library_paths
|
---|
| 391 |
|
---|
[1068] | 392 | make -j$MAKE_JOBS
|
---|
[1062] | 393 |
|
---|
[1068] | 394 | %if !0%{?skip_build_docs}
|
---|
| 395 | make docs -j$MAKE_JOBS
|
---|
| 396 | %endif
|
---|
| 397 |
|
---|
| 398 | %endif # if !0%{?skip_build}
|
---|
| 399 |
|
---|
[1041] | 400 | #------------------------------------------------------------------------------
|
---|
| 401 | %install
|
---|
| 402 | #------------------------------------------------------------------------------
|
---|
| 403 |
|
---|
[1068] | 404 | %if !0%{?skip_install}
|
---|
| 405 |
|
---|
[1041] | 406 | rm -rf %{buildroot}
|
---|
| 407 |
|
---|
[1062] | 408 | make install INSTALL_ROOT=%{buildroot}
|
---|
[1041] | 409 |
|
---|
[1068] | 410 | # copy READMEs (make install doesn't do that)
|
---|
| 411 | cp %{QT_SOURCE_TREE}/LICENSE.* \
|
---|
| 412 | %{QT_SOURCE_TREE}/LGPL_EXCEPTION.txt \
|
---|
| 413 | %{QT_SOURCE_TREE}/README \
|
---|
| 414 | %{QT_SOURCE_TREE}/changes-%{ver_major}.%{ver_minor}.%{ver_} \
|
---|
| 415 | %{QT_SOURCE_TREE}/README.OS2 \
|
---|
| 416 | %{QT_SOURCE_TREE}/CHANGES.OS2 \
|
---|
| 417 | %{pkg_docdir}/
|
---|
[1041] | 418 |
|
---|
[1068] | 419 | %endif # if !0%{?skip_install}
|
---|
| 420 |
|
---|
[1041] | 421 | #------------------------------------------------------------------------------
|
---|
| 422 | %clean
|
---|
| 423 | #------------------------------------------------------------------------------
|
---|
| 424 |
|
---|
[1068] | 425 | #rm -rf %{buildroot}
|
---|
[1041] | 426 |
|
---|
| 427 | #------------------------------------------------------------------------------
|
---|
| 428 | %changelog
|
---|