Changeset 1068 for packaging/qt.spec


Ignore:
Timestamp:
Sep 9, 2011, 2:52:48 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

packaging: Further work on .spec.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packaging/qt.spec

    r1062 r1068  
    22# http://svn.netlabs.org/qt4
    33#
     4
     5
     6
     7
     8
     9
     10
     11
    412
    513%define ver_major   4
    6 %define ver_minore  7
     14%define ver_minor  7
    715%define ver_patch   3
    816
     17
     18
    919%define rpm_release 1
    1020
    11 %define svn_revision    0
     21%define svn_revision    0
    1222
    1323%define descr_brief Qt is a software toolkit for developing applications.
     
    1828%define pkg_wps_view_txt()      EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=((%*))
    1929
    20 %define qt_         qt
    21 %define qtM         %{qt_}%{ver_major}
    22 
     30%define pkg_docdir      %{_docdir}/%{name}
     31
     32%if 0%{?os2_release}
     33Version:    %{ver_major}.%{ver_minor}.%{ver_patch}.%{os2_release}
     34%else
     35Version:    %{ver_major}.%{ver_minor}.%{ver_patch}
     36%endif
     37Release:    %{rpm_release}
     38
     39Source:     %{name}-%{version}.zip
     40
     41#BuildRequires: gnumake (when available)
     42BuildRequires: libc-devel
     43BuildRequires: gcc
     44BuildRequires: gcc-wlink
     45BuildRequires: gcc-wrc
     46#BuildRequires: cups-devel (when available)
     47BuildRequires: openssl-devel
     48BuildRequires: 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
    2373%define qt_prefix           %{_libdir}/%{qtM}
    2474%define qt_libdir           %{_libdir}
     
    3484%define qt_sysconfdir       %{_sysconfdir}/xdg
    3585
     86
     87
    3688#------------------------------------------------------------------------------
    3789# main package
    3890#------------------------------------------------------------------------------
    3991
    40 Name:       %{qt_}
    4192Summary:    Qt runtime
    4293Group:      System Environment/Libraries
    43 Version:    %{ver_major}.%{ver_minore}.%{ver_patch}
    44 Release:    %{rpm_release}
    45 Vendor:     netlabs.org
    4694
    4795Provides:   %{qtM} = %{version}-%{release}
    48 
    49 License:    LGPLv2 with exceptions or GPLv3 with exceptions
    50 Url:        http://www.qtsoftware.com/
    51 
    52 Source:     qt.zip
    5396
    5497%description
     
    60103%files
    61104%defattr(-,root,root,-)
    62 %doc README
    63 %{_libdir}/QtCore%{ver_major}.dll
     105%{qt_libdir}/QtCore%{ver_major}.dll
    64106
    65107%pre
    66 /*.cmd*/
    67 
    68     packages.1 = 'netlabs.org\Qt4\Runtime'
    69     packages.0 = 1
    70 
    71     ver = ''
    72     do i = 1 to packages.0
    73         ver = GetPkgVersion(packages.i)
    74         if (ver \== '') then leave
    75     end
    76     if (ver == '') then exit 0
    77 
    78     say; say 'ERROR:'; say
    79     say 'You have a WPI package "'packages.i'" version 'ver
    80     say 'installed on your system.'; say
    81     say 'You cannot have both the WPI and RPM package installed at the same time.'
    82     say 'Please de-install the specified WPI package using the WarpIn utility'
    83     say 'and try again.'; say
    84     exit 1
    85 
    86     GetPkgVersion: procedure
    87         parse arg aPkgId
    88         rc = rxFuncAdd('SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs')
    89         rc = SysLoadFuncs()
    90         WarpInDir = strip(SysIni('USER', 'WarpIN', 'Path'), 'T', '0'x)
    91         if (WarpInDir \== '') then do
    92             rc = SysFileTree(WarpInDir'\DATBAS_?.INI', 'inis', 'FO')
    93             if (rc == 0) then do
    94                 do i = 1 to inis.0
    95                     rc = SysIni(inis.i, 'ALL:', 'apps')
    96                     if (rc == '') then do
    97                         do j = 1 to apps.0
    98                             apps.j = strip(apps.j, 'T', '0'x)
    99                             if (left(apps.j, length(aPkgId)) == aPkgId) then do
    100                                 /* found the app */
    101                                 ver = right(apps.j, length(apps.j) - length(aPkgId) - 1)
    102                                 ver = translate(ver, '.', '\')
    103                                 return ver
    104                             end
    105                         end
    106                     end
    107                     else do
    108                         say; say 'ERROR:'; say
    109                         say 'Failed to access the file "'inis.i'".'; say
    110                         say 'Please close the WarpIn application or, if it is not running, make sure'
    111                         say 'that this file is not locked by another process and try again.'; say
    112                         exit 5
    113                     end
    114                 end
    115             end
    116         end
    117         return ''
    118 
    119 %post
    120 
    121 %postun
    122 
    123 %wps_object_delete_all
     108
     109%warpin_conflicts_begin
     110netlabs.org\Qt4\Runtime
     111%warpin_conflicts_end
    124112
    125113#------------------------------------------------------------------------------
     
    130118Group:      System Environment/Libraries
    131119
    132 Requires:   %{qt_} = %{version}-%{release}
     120Requires:   %{} = %{version}-%{release}
    133121
    134122Provides:   %{qtM}-pm = %{version}-%{release}
     
    142130%files pm
    143131%defattr(-,root,root,-)
    144 %{_libdir}/QtGui%{ver_major}.dll
    145 
    146 #------------------------------------------------------------------------------
    147 %package demos
    148 #------------------------------------------------------------------------------
    149 Summary:    Demonstration applications for Qt
     132%{_libdir}/QtGui%{ver_major}.dll
     133
     134#------------------------------------------------------------------------------
     135%package s
     136#------------------------------------------------------------------------------
     137Summary:    applications for Qt
    150138Group:      Documentation
    151139
    152 Requires:   %{qt_}-pm = %{version}-%{release}
    153 
    154 Provides:   %{qtM}-demos = %{version}-%{release}
    155 
    156 %description demos
     140Requires:   %{}-pm = %{version}-%{release}
     141
     142Provides:   %{qtM}-s = %{version}-%{release}
     143
     144%description s
    157145%{descr_brief}
    158146
     
    161149Qt toolkit.
    162150
    163 %files demos
     151%files s
    164152%defattr(-,root,root,-)
    165153%{qt_bindir}/qtdemo.exe
    166154# @todo put shortcuts to /usr/bin
    167155#%if "%{qt_bindir}" != "%{_bindir}"
    168 #%{_bindir}/qtdemo.exe copied from launcher.exe
    169156#%endif
    170 %{qt_demosdir}/
    171 
    172 %post demos
    173 
    174 %wps_object_create_begin -n %{name}-demos
     157#%dir %{qt_examplesdir}/
     158#%dir %{qt_demosdir}/
     159
     160%post examples
     161
     162%wps_object_create_begin -n %{name}-examples
    175163%pkg_wps_folder_create%
    176164%{pkg_wps_base}_DEMO:WPProgram|Examples and Demos|<QT4_FOLDER>|EXENAME=((%{qt_bindir}/qtdemo.exe))
     
    178166%wps_object_create_end
    179167
    180 %postun demos
    181 %wps_object_delete_all -n %{name}-demos
     168%postun s
     169%wps_object_delete_all -n %{name}-s
    182170
    183171#------------------------------------------------------------------------------
     
    187175Group:      Development/Tools
    188176
    189 Requires:   %{qt_}-pm = %{version}-%{release}
     177Requires:   %{}-pm = %{version}-%{release}
    190178
    191179Provides:   %{qtM}-linguist = %{version}-%{release}
     
    216204Group:      Development/Tools
    217205
    218 Requires:   %{qt_}-pm = %{version}-%{release}
     206Requires:   %{}-pm = %{version}-%{release}
    219207
    220208Provides:   %{qtM}-assistant = %{version}-%{release}
     
    229217%defattr(-,root,root,-)
    230218%{qt_bindir}/assistant.exe
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
    231259
    232260#------------------------------------------------------------------------------
     
    237265BuildArch:  noarch
    238266
    239 Requires:   %{qt_}-assistant = %{version}-%{release}
     267Requires:   %{}-assistant = %{version}-%{release}
    240268
    241269Provides:   %{qtM}-doc = %{version}-%{release}
     
    259287Group:      Development/Libraries
    260288
    261 Requires:   %{qt_}-pm = %{version}-%{release}
    262 
    263 Provides:   %{qt_}-designer = %{version}-%{release}
     289Requires:   %{name}-pm = %{version}-%{release}
    264290
    265291Provides:   %{qtM}-devel = %{version}-%{release}
    266 Provides:   %{qtM}-designer = %{version}-%{release}
    267292
    268293%description devel
     
    270295
    271296This package contains the headers, libraries and tools necessary to develop
    272 applications using the Qt toolkit. Includes the Qt Designer tool.
     297applications using the Qt toolkit.
    273298
    274299%files devel
    275300%defattr(-,root,root,-)
    276 %{qt_bindir}/designer.exe
     301%{qt_bindir}/moc.exe
     302
     303#------------------------------------------------------------------------------
     304%package devel-all
     305#------------------------------------------------------------------------------
     306Summary:    Qt development kit
     307Group:      Development/Libraries
     308
     309Requires:   %{name}-examples = %{version}-%{release}
     310Requires:   %{name}-linguist = %{version}-%{release}
     311Requires:   %{name}-assistant = %{version}-%{release}
     312Requires:   %{name}-designer = %{version}-%{release}
     313Requires:   %{name}-devel-tools = %{version}-%{release}
     314Requires:   %{name}-doc = %{version}-%{release}
     315
     316Provides:   %{qtM}-devel-all = %{version}-%{release}
     317
     318%description devel-all
     319%{descr_brief}
     320
     321This meta package installs all individual packages containing various Qt
     322development components, including the Qt headers and libraries, the Linguist,
     323Assistant and designer Designer applications, development tools, example
     324Qt applications and the API documentation.
    277325
    278326#------------------------------------------------------------------------------
     
    280328#------------------------------------------------------------------------------
    281329
     330
     331
    282332%if "%{?QT_SOURCE_TREE}" != ""
    283 %setup -n "%{qt_}-%{version}-%{release}" -Tc
     333%if !0%{?skip_prep_export}
     334# get clean source tree from SVN
     335%setup -n "%{name}-%{version}" -Tc
     336svn export -r %{svn_revision} %{QT_SOURCE_TREE} .
    284337%else
    285 %setup -n "%{qt_}-%{version}-%{release}" -q
    286 %endif
     338# use passed source tree as is (shadow build)
     339%setup -n "%{name}-%{version}" -TDc
     340%endif
     341%else
     342# use source zip
     343%setup -q
     344%endif
     345
     346%endif # if !0%{?skip_prep}
    287347
    288348#------------------------------------------------------------------------------
     
    290350#------------------------------------------------------------------------------
    291351
    292 # @todo add to BuildRequires:
    293 #   libc-devel
    294 #   gcc
    295 #   cups-devel
    296 #   openssl-devel
    297 #   mysql-devel
    298 #   psql-devel
    299 #   pthread-devel
     352%if !0%{?skip_build}
    300353
    301354die() { echo "ERROR: $@"; exit 1; }
    302355check_var() { eval "[ -n \"\$$1\" ] || die \"$1 variable is not set.\""; }
    303356
    304 # Define Qt source tree
    305 if [ -z "%{QT_SOURCE_TREE}" ]; then QT_SOURCE_TREE=.
    306 else QT_SOURCE_TREE="%{QT_SOURCE_TREE}"
    307 fi
    308 
     357# Qt source tree (DOS format)
    309358QT_SOURCE_TREE_D=$(echo "%{QT_SOURCE_TREE}" | tr '/' '\\')
    310359
    311360# Sanity checks (laking these would turn off features that must be ON)
    312 check_var "CUPS_INCLUDEPATHH"
    313 check_var "OPENSSL_INCLUDEPATH"
     361check_var "CUPS_INCLUDEPATH"
    314362check_var "MYSQL_INCLUDEPATH"
    315363check_var "MYSQL_LIBS"
    316364check_var "PSQL_INCLUDEPATH"
    317365check_var "PSQL_LIBS"
     366
     367
     368
    318369
    319370# CMD.EXE is required by the build process for now
     
    339390cmd /c $QT_SOURCE_TREE_D\\configure.cmd $library_paths
    340391
    341 make -j%MAKE_JOBS%
    342 make docs -j%MAKE_JOBS%
     392make -j$MAKE_JOBS
     393
     394%if !0%{?skip_build_docs}
     395make docs -j$MAKE_JOBS
     396%endif
     397
     398%endif # if !0%{?skip_build}
    343399
    344400#------------------------------------------------------------------------------
     
    346402#------------------------------------------------------------------------------
    347403
     404
     405
    348406rm -rf %{buildroot}
    349407
    350408make install INSTALL_ROOT=%{buildroot}
    351409
    352 # @todo remove
    353 #mkdir -p %{buildroot}/%{qt_libdir}
    354 #cp QtCore4.dll %{buildroot}/%{qt_libdir}/
    355 #cp QtGui4.dll %{buildroot}/%{qt_libdir}/
    356 #mkdir -p %{buildroot}/%{qt_bindir}
    357 #cp qtdemo.exe %{buildroot}/%{qt_bindir}/
    358 #cp designer.exe %{buildroot}/%{qt_bindir}/
    359 #cp linguist.exe %{buildroot}/%{qt_bindir}/
    360 #cp assistant.exe %{buildroot}/%{qt_bindir}/
    361 #mkdir -p %{buildroot}/%{qt_demosdir}
    362 #cp -R demos/* %{buildroot}/%{qt_demosdir}/
    363 #mkdir -p %{buildroot}/%{qt_examplesdir}
    364 #cp -R examples/* %{buildroot}/%{qt_examplesdir}/
    365 #mkdir -p %{buildroot}/%{qt_docdir}
    366 #cp -R doc/* %{buildroot}/%{qt_docdir}/
     410# copy READMEs (make install doesn't do that)
     411cp %{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}/
     418
     419%endif # if !0%{?skip_install}
    367420
    368421#------------------------------------------------------------------------------
     
    370423#------------------------------------------------------------------------------
    371424
    372 rm -rf %{buildroot}
     425rm -rf %{buildroot}
    373426
    374427#------------------------------------------------------------------------------
    375428%changelog
    376 
    377 * Sun Oct 31 2010 Dmitry A. Kuminov <coding/dmik.org> - 4.6.3-1
    378 - test version
Note: See TracChangeset for help on using the changeset viewer.