Ticket #618: rpmdestpath.patch

File rpmdestpath.patch, 2.1 KB (added by ranger@…, 21 years ago)

rpmdestpath.patch

  • portrpmpackage.tcl

    RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/port1.0/portrpmpackage.tcl,v
    retrieving revision 1.1
    diff -u -r1.1 portrpmpackage.tcl
     
    3737target_provides ${com.apple.rpmpackage} rpmpackage
    3838target_requires ${com.apple.rpmpackage} install
    3939
     40options package.destpath
     41
    4042set UI_PREFIX "---> "
    4143
    4244proc rpmpackage_main {args} {
     
    4850}
    4951
    5052proc rpmpackage_pkg {portname portversion portrevision} {
    51     global portdbpath destpath workpath prefix portresourcepath categories maintainers description long_description homepage epoch
     53    global package.destpath portdbpath destpath workpath prefix portresourcepath categories maintainers description long_description homepage epoch
     54
     55    set rpmdestpath ""
     56    if {![string equal ${package.destpath} ${workpath}] && ![string equal ${package.destpath} ""]} {
     57        set pkgpath ${package.destpath}
     58        system "mkdir -p ${pkgpath}/BUILD"
     59        system "mkdir -p ${pkgpath}/RPMS"
     60        system "mkdir -p ${pkgpath}/SOURCES"
     61        system "mkdir -p ${pkgpath}/SPECS"
     62        system "mkdir -p ${pkgpath}/SRPMS"
     63        set rpmdestpath "--define '_topdir ${pkgpath}'"
     64    }
    5265
    5366    set specpath ${workpath}/${portname}.spec
    5467    # long_description, description, or homepage may not exist
     
    8093    system "cd '${destpath}' && find . ! -type d | grep -v /etc/ | sed -e 's/\"/\\\"/g' -e 's/^./\"/' -e 's/$/\"/' >> '${workpath}/${portname}.filelist'"
    8194    system "cd '${destpath}' && find . ! -type d | grep /etc/ | sed -e 's/\"/\\\"/g' -e 's/^./%config \"/' -e 's/$/\"/' >> '${workpath}/${portname}.filelist'"
    8295    write_spec ${specpath} $portname $portversion $portrevision $pkg_description $pkg_long_description $category $maintainer $destpath $dependencies $epoch
    83     system "DP_USERECEIPTS='${portdbpath}/receipts' rpm -bb -v ${specpath}"
     96    system "DP_USERECEIPTS='${portdbpath}/receipts' rpm -bb -v ${rpmdestpath} ${specpath}"
    8497
    8598    return 0
    8699}