##
##  perl-tk.spec -- OpenPKG RPM Specification
##  Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
##  Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
##  Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
##
##  Permission to use, copy, modify, and distribute this software for
##  any purpose with or without fee is hereby granted, provided that
##  the above copyright notice and this permission notice appear in all
##  copies.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
##  SUCH DAMAGE.
##

#   versions of individual parts
%define       V_tk                   800.024
%define       V_tk_tiff              0.08
%define       V_tk_jpeg              2.014
%define       V_tk_png               2.005
%define       V_tk_canvasfig         1.014
%define       V_tk_checkbuttongroup  0.2.1
%define       V_tk_collapsableframe  1.0
%define       V_tk_date              0.40
%define       V_tk_dateentry         1.35
%define       V_tk_executecommand    1.2
%define       V_tk_gbarr             2.05
%define       V_tk_graph             0.06
%define       V_tk_histentry         0.40
%define       V_tk_jcombobox         0.02
%define       V_tk_ipentry           0.03
%define       V_tk_lcd               1.1
%define       V_tk_mdi               0.2
%define       V_tk_progressbarmac    1.1
%define       V_tk_multi             1.004
%define       V_tk_objecthandler     0.03
%define       V_tk_pathentry         2.17
%define       V_tk_popentry          0.06
%define       V_tk_radiobuttongroup  0.2.1
%define       V_tk_rotcanvas         1.2
%define       V_tk_splashscreen      1.0
%define       V_tk_task              1.0
%define       V_tk_textansicolor     0.14
%define       V_tk_treegraph         1.024
%define       V_tk_workspace         1.75
%define       V_tk_worldcanvas       1.2.5

#   package information
Name:         perl-tk
Summary:      Perl Modules for use with the Tk GUI
URL:          http://www.cpan.org/
Vendor:       Perl Community
Packager:     The OpenPKG Project
Distribution: OpenPKG [EVAL]
Group:        Language
License:      GPL/Artistic
Version:      20021228
Release:      20021228

#   list of sources
Source0:      http://www.cpan.org/modules/by-module/Tk/Tk-%{V_tk}.tar.gz
Source1:      http://www.cpan.org/modules/by-module/Tk/Tk-TIFF-%{V_tk_tiff}.tar.gz
Source2:      http://www.cpan.org/modules/by-module/Tk/Tk-JPEG-%{V_tk_jpeg}.tar.gz
Source3:      http://www.cpan.org/modules/by-module/Tk/Tk-PNG-%{V_tk_png}.tar.gz
Source4:      http://www.cpan.org/modules/by-module/Tk/Tk-CanvasFig-%{V_tk_canvasfig}.tar.gz
Source5:      http://www.cpan.org/modules/by-module/Tk/Tk-CheckbuttonGroup-%{V_tk_checkbuttongroup}.tgz
Source6:      http://www.cpan.org/modules/by-module/Tk/Tk-CollapsableFrame-%{V_tk_collapsableframe}.tar.gz
Source7:      http://www.cpan.org/modules/by-module/Tk/Tk-Date-%{V_tk_date}.tar.gz
Source8:      http://www.cpan.org/modules/by-module/Tk/Tk-DateEntry-%{V_tk_dateentry}.tar.gz
Source9:      http://www.cpan.org/modules/by-module/Tk/Tk-ExecuteCommand-%{V_tk_executecommand}.tar.gz
Source10:     http://www.cpan.org/modules/by-module/Tk/Tk-GBARR-%{V_tk_gbarr}.tar.gz
Source11:     http://www.cpan.org/modules/by-module/Tk/Tk-Graph-%{V_tk_graph}.tar.gz
Source12:     http://www.cpan.org/modules/by-module/Tk/Tk-HistEntry-%{V_tk_histentry}.tar.gz
Source13:     http://www.cpan.org/modules/by-module/Tk/Tk-JComboBox-%{V_tk_jcombobox}.tar.gz
Source14:     http://www.cpan.org/modules/by-module/Tk/Tk-IPEntry-%{V_tk_ipentry}.tar.gz
Source15:     http://www.cpan.org/modules/by-module/Tk/Tk-LCD-%{V_tk_lcd}.tar.gz
Source16:     http://www.cpan.org/modules/by-module/Tk/Tk-MDI-%{V_tk_mdi}.tar.gz
Source17:     http://www.cpan.org/modules/by-module/Tk/Tk-ProgressBar-Mac-%{V_tk_progressbarmac}.tar.gz
Source18:     http://www.cpan.org/modules/by-module/Tk/Tk-Multi-%{V_tk_multi}.tar.gz
Source19:     http://www.cpan.org/modules/by-module/Tk/Tk-ObjectHandler-%{V_tk_objecthandler}.tar.gz
Source20:     http://www.cpan.org/modules/by-module/Tk/Tk-PathEntry-%{V_tk_pathentry}.tar.gz
Source21:     http://www.cpan.org/modules/by-module/Tk/Tk-PopEntry-%{V_tk_popentry}.tar.gz
Source22:     http://www.cpan.org/modules/by-module/Tk/Tk-RadiobuttonGroup-%{V_tk_radiobuttongroup}.tgz
Source23:     http://www.cpan.org/modules/by-module/Tk/Tk-RotCanvas-%{V_tk_rotcanvas}.tar.gz
Source24:     http://www.cpan.org/modules/by-module/Tk/Tk-Splashscreen-%{V_tk_splashscreen}.tar.gz
Source25:     http://www.cpan.org/modules/by-module/Tk/Tk-Task-%{V_tk_task}.tar.gz
Source26:     http://www.cpan.org/modules/by-module/Tk/Tk-TextANSIColor-%{V_tk_textansicolor}.tar.gz
Source27:     http://www.cpan.org/modules/by-module/Tk/Tk-TreeGraph-%{V_tk_treegraph}.tar.gz
Source28:     http://www.cpan.org/modules/by-module/Tk/Tk-Workspace-%{V_tk_workspace}.tar.gz
Source29:     http://www.cpan.org/modules/by-module/Tk/Tk-WorldCanvas-%{V_tk_worldcanvas}.tar.gz

#   build information
Prefix:       %{l_prefix}
BuildRoot:    %{l_buildroot}
BuildPreReq:  OpenPKG, openpkg >= 20020206, perl >= 5.8.0, X11, tiff, jpeg, png, zlib
PreReq:       OpenPKG, openpkg >= 20020206, perl >= 5.8.0, X11, tiff, jpeg, png, zlib
AutoReq:      no
AutoReqProv:  no

%description
    Perl modules for use with Tk GUI:
    - Tk (%{V_tk})
    - Tk::TIFF (%{V_tk_tiff})
    - Tk::JPEG (%{V_tk_jpeg})
    - Tk::PNG (%{V_tk_png})
    - Tk::CanvasFig (%{V_tk_canvasfig})
    - Tk::CheckbuttonGroup (%{V_tk_checkbuttongroup})
    - Tk::CollapsableFrame (%{V_tk_collapsableframe})
    - Tk::Date (%{V_tk_date})
    - Tk::DateEntry (%{V_tk_dateentry})
    - Tk::ExecuteCommand (%{V_tk_executecommand})
    - Tk-GBARR (%{V_tk_gbarr})
    - Tk::Graph (%{V_tk_graph})
    - Tk::HistEntry (%{V_tk_histentry})
    - Tk::JComboBox (%{V_tk_jcombobox})
    - Tk::IPEntry (%{V_tk_ipentry})
    - Tk::LCD (%{V_tk_lcd})
    - Tk::MDI (%{V_tk_mdi})
    - Tk::ProgressBar::Mac (%{V_tk_progressbarmac})
    - Tk-Multi (%{V_tk_multi})
    - Tk::ObjectHandler (%{V_tk_objecthandler})
    - Tk::PathEntry (%{V_tk_pathentry})
    - Tk::PopEntry (%{V_tk_popentry})
    - Tk::RadiobuttonGroup (%{V_tk_radiobuttongroup})
    - Tk::RotCanvas (%{V_tk_rotcanvas})
    - Tk::Splashscreen (%{V_tk_splashscreen})
    - Tk::Task (%{V_tk_task})
    - Tk::TextANSIColor (%{V_tk_textansicolor})
    - Tk::TreeGraph (%{V_tk_treegraph})
    - Tk::Workspace (%{V_tk_workspace})
    - Tk::WorldCanvas (%{V_tk_worldcanvas})

%prep
    %setup0  -q -c
    %setup1  -q -T -D -a 1
    %setup2  -q -T -D -a 2
    %setup3  -q -T -D -a 3
    %setup4  -q -T -D -a 4
    %setup5  -q -T -D -a 5
    %setup6  -q -T -D -a 6
    %setup7  -q -T -D -a 7
    %setup8  -q -T -D -a 8
    %setup9  -q -T -D -a 9
    %setup10 -q -T -D -a 10
    %setup11 -q -T -D -a 11
    %setup12 -q -T -D -a 12
    %setup13 -q -T -D -a 13
    %setup14 -q -T -D -a 14
    %setup15 -q -T -D -a 15
    %setup16 -q -T -D -a 16
    %setup17 -q -T -D -a 17
    %setup18 -q -T -D -a 18
    %setup19 -q -T -D -a 19
    %setup20 -q -T -D -a 20
    %setup21 -q -T -D -a 21
    %setup22 -q -T -D -a 22
    %setup23 -q -T -D -a 23
    %setup24 -q -T -D -a 24
    %setup25 -q -T -D -a 25
    %setup26 -q -T -D -a 26
    %setup27 -q -T -D -a 27
    %setup28 -q -T -D -a 28
    %setup29 -q -T -D -a 29

%build

%install
    #   perform common prolog operations
    %{l_prefix}/bin/perl-openpkg prolog

    #   build Tk
    ( cd Tk%{V_tk}
      %{l_prefix}/bin/perl-openpkg install \
          X11INC=`%{l_prefix}/etc/rc --query x11_incdir` \
          X11LIB=`%{l_prefix}/etc/rc --query x11_libdir`
    )

    #   build Tk::TIFF
    ( cd Tk-TIFF-%{V_tk_tiff}
      %{l_shtool} subst \
          -e 's;-I/usr/local/include;-I%{l_prefix}/include/tiff -I%{l_prefix}/include;' \
          -e 's;-L/usr/local/lib;-L%{l_prefix}/lib;' \
          Makefile.PL
      %{l_prefix}/bin/perl-openpkg install
    )

    #   build Tk::JPEG
    ( cd Tk-JPEG-%{V_tk_jpeg}
      %{l_prefix}/bin/perl-openpkg install
    )

    #   build Tk::PNG
    ( cd Tk-PNG-%{V_tk_png}
      %{l_shtool} subst \
          -e 's;-I/usr/local/include;-I%{l_prefix}/include;' \
          -e 's;-lpng -lz;-L%{l_prefix}/lib -lpng -lz;' \
          Makefile.PL
      %{l_prefix}/bin/perl-openpkg install
    )

    #   build remaining modules
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE4}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE5}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE6}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE7}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE8}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE9}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE10}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE11}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE12}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE13}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE14}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE15}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE16}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE17}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE18}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE19}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE20}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE21}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE22}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE23}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE24}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE25}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE26}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE27}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE28}
    %{l_prefix}/bin/perl-openpkg install -d %{SOURCE29}

    #   perform common epilog operations
    %{l_prefix}/bin/perl-openpkg epilog

%files -f files

%clean
    rm -rf $RPM_BUILD_ROOT

