Changeset 1068


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

packaging: Further work on .spec.

Location:
packaging
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • packaging/CreateRPMs.sh

    r1061 r1068  
    1111# Defaults
    1212#
     13
     14qt_spec=qt.spec
    1315
    1416#
     
    2527}
    2628
    27 cmd_create()
     29cmd_all()
    2830{
    2931    local src_base="$1"
     
    3133    [ -d "$src_base" ] || die "'$src_base' is not a directory."
    3234
    33     run cmd /c env.cmd rpmbuild -D "QT_SOURCE_TREE $src_base" -bc qt.spec
     35    run $env_cmd rpmbuild \
     36        -D "QT_SOURCE_TREE $src_base" \
     37        -ba $qt_spec
     38}
     39
     40cmd_build()
     41{
     42    local src_base="$1"
     43
     44    [ -d "$src_base" ] || die "'$src_base' is not a directory."
     45
     46    run $env_cmd rpmbuild \
     47        -D "QT_SOURCE_TREE $src_base" -D "skip_prep_export 1" \
     48        -bc $qt_spec
     49}
     50
     51cmd_rpm()
     52{
     53    local inst_base="$1"
     54
     55    [ -d "$inst_base" ] || die "'$inst_base' is not a directory."
     56
     57    run $env_cmd rpmbuild \
     58        -D "QT_BUILD_TREE $inst_base" \
     59        --short-circuit -bi $qt_spec
    3460}
    3561
     
    4470start_dir=$(pwd)
    4571
     72[ -f "$start_dir/env.sh" ] && . "$start_dir/env.sh"
     73
     74env_cmd=
     75[ -f "$start_dir/env.cmd" ] && env_cmd="cmd /c env.cmd"
     76
    4677# Parse arguments
    4778
     
    5182"
    5283Usage:
    53   $script_name test [options]   ...
     84  $script_name all <srcdir>     Do everything (RPM, SRPM, ZIP)
     85  $script_name build <srcdir>   Build product (shadow build)
     86  $script_name rpm [<instdir>]  Build RPMs only
    5487
    5588Options:
    56   <srcdir>      (*) Qt SVN source tree location
     89  <srcdir>      Qt SVN source tree location
     90  <instdir>     Qt installation tree location
     91                (default: $HOME/rpmbuild/BUILDROOT/qt-X.Y.Z)
    5792"
    5893}
    5994
    6095case "$1" in
    61     test)
     96    all|build)
    6297        if [ -n "$2" ]; then
    63             cmd_create $(echo "$2" | tr '\\' '/')
     98            cmd_$1 $(echo "$2" | tr '\\' '/')
    6499        else
    65100            cmd_help
     101        fi;;
     102    rpm)
     103        if [ -n "$2" ]; then
     104            cmd_rpm $(echo "$2" | tr '\\' '/')
     105        else
     106            cmd_rpm
    66107        fi;;
    67108    -h|-?|--help|*) cmd_help;;
  • packaging/env.tpl.cmd

    r1061 r1068  
    1414'set BEGINLIBPATH=%UNIXROOT%\usr\lib;%BEGINLIBPATH%'
    1515
    16 /* Qt links to some OS/2 DLLs directly (w/o import libs) */
    17 'set LIBRARY_PATH=C:\OS2\DLL;C:\MPTN\DLL;%LIBRARY_PATH%'
    18 
    1916/* CUPS libraries */
    2017'set CUPS_ROOT=C:\cups'
     
    2219'set CUPS_LIBS='
    2320
    24 /* OpenSSL libraries */
    25 'set OPENSSL_ROOT=D:\Coding\openssl\openssl-1.0.0a-os2knix-20100706'
    26 'set OPENSSL_INCLUDEPATH=%OPENSSL_ROOT%\include'
    27 'set OPENSSL_LIBS='
    28 'set BEGINLIBPATH=%OPENSSL_ROOT%\dll;%BEGINLIBPATH%'
    29 
    3021/* MySQL libraries */
    3122'set MYSQL_ROOT=D:\Coding\mysql\mysql51'
    3223'set MYSQL_INCLUDEPATH=%MYSQL_ROOT%\include'
    33 'set MYSQL_LIBS=-L%MYSQL_ROOT%\lib -lmysqlclient_r -L%OPENSSL_ROOT%\lib -llibssl -llibcrypto -LD:\Dev\lib -lpthread'
     24'set MYSQL_LIBS=-L%MYSQL_ROOT%\lib -lmysqlclient_r -llibssl -llibcrypto -lpthread'
    3425
    3526/* PostgresSQL libraries */
    3627'set PSQL_ROOT=D:\Coding\pgsql\pgsql901'
    3728'set PSQL_INCLUDEPATH=%PSQL_ROOT%\include'
    38 'set PSQL_LIBS=-L%PSQL_ROOT%\lib -llibpq -L%OPENSSL_ROOT%\lib -llibssl -llibcrypto -LD:\Dev\lib -lpthread'
     29'set PSQL_LIBS=-L%PSQL_ROOT%\lib -llibpq -llibssl -llibcrypto -lpthread'
    3930
    4031/* Number of make jobs, normally # of CPUs + 1 */
     
    4435if (strip(args) \== '') then
    4536    'cmd /c' args
    46 else
    47     'rpmbuild -D "ttt" -bc qt.spec'
    48 
    4937exit rc
  • packaging/qt.spec

    r1062 r1068  
    22# http://svn.netlabs.org/qt4
    33#
     4# If you are a packager, please read HowToDistribute.txt for general
     5# instructions.
     6#
     7
     8Name:       qt
     9Vendor:     netlabs.org
     10License:    LGPLv2 with exceptions or GPLv3 with exceptions
     11Url:        http://www.qtsoftware.com/
    412
    513%define ver_major   4
    6 %define ver_minore  7
     14%define ver_minor   7
    715%define ver_patch   3
    816
     17%define os2_release 0
     18
    919%define rpm_release 1
    1020
    11 %define svn_revision    0
     21%define svn_revision    1070
    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%define qtM                 %{name}%{ver_major}
     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:   %{name} = %{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%{qt_libdir}/QtGui%{ver_major}.dll
     133
     134#------------------------------------------------------------------------------
     135%package examples
     136#------------------------------------------------------------------------------
     137Summary:    Example applications for Qt
    150138Group:      Documentation
    151139
    152 Requires:   %{qt_}-pm = %{version}-%{release}
    153 
    154 Provides:   %{qtM}-demos = %{version}-%{release}
    155 
    156 %description demos
     140Requires:   %{name}-pm = %{version}-%{release}
     141
     142Provides:   %{qtM}-examples = %{version}-%{release}
     143
     144%description examples
    157145%{descr_brief}
    158146
     
    161149Qt toolkit.
    162150
    163 %files demos
     151%files examples
    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 examples
     169%wps_object_delete_all -n %{name}-examples
    182170
    183171#------------------------------------------------------------------------------
     
    187175Group:      Development/Tools
    188176
    189 Requires:   %{qt_}-pm = %{version}-%{release}
     177Requires:   %{name}-pm = %{version}-%{release}
    190178
    191179Provides:   %{qtM}-linguist = %{version}-%{release}
     
    216204Group:      Development/Tools
    217205
    218 Requires:   %{qt_}-pm = %{version}-%{release}
     206Requires:   %{name}-pm = %{version}-%{release}
    219207
    220208Provides:   %{qtM}-assistant = %{version}-%{release}
     
    229217%defattr(-,root,root,-)
    230218%{qt_bindir}/assistant.exe
     219
     220#------------------------------------------------------------------------------
     221%package designer
     222#------------------------------------------------------------------------------
     223Summary:    Qt Designer tool
     224Group:      Development/Tools
     225
     226Requires:   %{name}-pm = %{version}-%{release}
     227
     228Provides:   %{qtM}-designer = %{version}-%{release}
     229
     230%description designer
     231%{descr_brief}
     232
     233This package contains the Qt Designer tool used to for designing and building
     234graphical 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#------------------------------------------------------------------------------
     243Summary:    Qt development tools
     244Group:      Development/Tools
     245
     246Requires:   %{name}-pm = %{version}-%{release}
     247
     248Provides:   %{qtM}-devel-tools = %{version}-%{release}
     249
     250%description devel-tools
     251%{descr_brief}
     252
     253This package contains tools used to assist in Qt development, including
     254PixelTool, QML Viewer, Help Converter and other applications.
     255
     256%files devel-tools
     257%defattr(-,root,root,-)
     258%{qt_bindir}/pixeltool.exe
    231259
    232260#------------------------------------------------------------------------------
     
    237265BuildArch:  noarch
    238266
    239 Requires:   %{qt_}-assistant = %{version}-%{release}
     267Requires:   %{name}-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%if !0%{?skip_prep}
     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# Qt links to some OS/2 DLLs directly (w/o import libs)
     368export LIBRARY_PATH=%{os2_boot_drive}/OS2/DLL\;%{os2_boot_drive}/MPTN/DLL\;$LIBRARY_PATH
    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%if !0%{?skip_install}
     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}
     425#rm -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.