Changeset 105006


Ignore:
Timestamp:
Apr 7, 2013, 3:02:21 PM (7 years ago)
Author:
afb@…
Message:

Make srpm work for ports without files too (duh)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/package1.0/portsrpm.tcl

    r105005 r105006  
    121121
    122122    system "cp -p ${portpath}/Portfile ${sourcespath}/$portname-Portfile"
    123     system "cd ${portpath} && zip -r -q ${sourcespath}/$portname-files.zip files -x \\*.DS_Store -x files/.svn\\*"
     123    if {[info exists ${portpath}/files]} {
     124        system "cd ${portpath} && zip -r -q ${sourcespath}/$portname-files.zip files -x \\*.DS_Store -x files/.svn\\*"
     125        set zip $portname-files.zip
     126    } else {
     127        set zip ""
     128    }
    124129    foreach dist $distfiles {
    125130        system "cp -p ${distpath}/${dist} ${sourcespath}/${dist}"
    126131    }
    127132
    128     write_port_spec ${specpath} $portname $portversion $portrevision $pkg_description $pkg_long_description $pkg_homepage $category $license $maintainer $distfiles $fetch_urls $dependencies $epoch $src
     133    write_port_spec ${specpath} $portname $portversion $portrevision $pkg_description $pkg_long_description $pkg_homepage $category $license $maintainer $distfiles $fetch_urls $dependencies $epoch $src $zip
    129134    system "rpmbuild -bs -v --nodeps ${rpmdestpath} ${specpath}"
    130135
     
    199204}
    200205
    201 proc portsrpm::write_port_spec {specfile portname portversion portrevision description long_description homepage category license maintainer distfiles fetch_urls dependencies epoch src} {
     206proc portsrpm::write_port_spec {specfile portname portversion portrevision description long_description homepage category license maintainer distfiles fetch_urls dependencies epoch src zip} {
    202207    set specfd [open ${specfile} w+]
    203208    set origportname ${portname}
     
    217222URL: ${homepage}
    218223BuildRoot: %{_tmppath}/%{name}-%{version}-root
    219 Source0: ${portname}-Portfile
    220 Source1: ${portname}-files.zip"
     224Source0: ${portname}-Portfile"
     225    if {$zip != ""} {
     226        puts $specfd "Source1: $zip"
     227    }
    221228    if {[expr ${epoch} != 0]} {
    222229            puts $specfd "Epoch: ${epoch}"
     
    251258    }
    252259    set wrap_description [word_wrap ${long_description} 72]
     260    if {$zip != ""} {
     261        set and "-a 1"
     262    } else {
     263        set and ""
     264    }
    253265    puts $specfd "
    254266%description
     
    256268
    257269%prep
    258 %setup -c -a 1 -T
     270%setup -c $and -T
    259271cp -p %{SOURCE0} Portfile
    260272#prepare work area
Note: See TracChangeset for help on using the changeset viewer.