Can I use rpm to expand the macros in a specfile?

后端 未结 5 1659
时光取名叫无心
时光取名叫无心 2021-02-01 20:06

The concrete example being I have lots of specfiles with Source0: or other Source lines containing macros. How can I have these macros expanded without

5条回答
  •  鱼传尺愫
    2021-02-01 20:55

    If its only the source lines you need parsed, spectool will do that for you. It's part of Fedora's rpmdevtools.

    $ spectool ./mg.spec 
    Source0: http://homepage.boetes.org/software/mg/mg-20110120.tar.gz
    $ 
    

    Here's its help screen

    Usage: spectool [] 
    Options:
    operating mode:
    -l, --lf, --list-files        lists the expanded sources/patches (default)
    -g, --gf, --get-files         gets the sources/patches that are listed with
                                  a URL
    -h, --help                    display this help screen
    
    files on which to operate:
    -A, --all                     all files, sources and patches (default)
    -S, --sources                 all sources
    -P, --patches                 all patches
    -s, --source x[,y[,...]]      specified sources
    -p, --patch a[,b[,...]]       specified patches
    
    misc:
    -d, --define 'macro value'    defines RPM macro 'macro' to be 'value'
    -C, --directory dir           download into specified directory (default '.')
    -R, --sourcedir               download into rpm's %{_sourcedir}
    -n, --dryrun, --dry-run       don't download anything, just show what would be
                                  done
    -D, --debug                   output debug info, don't clean up when done
    

提交回复
热议问题