Changeset 748 for rpmbuild-bot
- Timestamp:
- Apr 15, 2016, 8:00:47 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rpmbuild-bot/rpmbuild-bot.sh
r744 r748 35 35 # > [-f] 36 36 # 37 # MYAPPis the name of the RPM package spec file (extension is optional,37 # SPEC is the name of the RPM package spec file (extension is optional, 38 38 # .spec is assumed). The spec file is searched in the SPECS directory of the 39 39 # rpmbuild tree (usually $USER/rpmbuild/SPECS, rpmbuild --eval='%_specdir' … … 68 68 # log files and the corresponding package files if you are absolutely sure they 69 69 # should be discarded. 70 # 71 # The "build" command will also check if there is a directory named SPEC in the 72 # same directory where the given .spec file resides. If such a directory 73 # exists, all files in it are assumed to be auxiliary source files used by the 74 # .spec file via SourceN: directives. These files will be automatically copied 75 # to the SOURCES directory in the rpmbuild tree befure starting the build 76 # process. 70 77 # 71 78 # Doing test builds … … 100 107 # directory of the rpmbuild tree. The previous log file, if any, is given a .bak 101 108 # extension (the previous .bak file will be deleted). 109 # 110 # The "test" command will copy auxiliary source files for the .spec file, if any, 111 # to the proper location before rpmbuild execution -- the same way the "build" 112 # command does it. 102 113 # 103 114 # Uploading packages … … 242 253 } 243 254 255 sync_aux_src() 256 { 257 [ -n "$src_dir" ] || die "src_dir is empty." 258 [ -n "$spec_full" ] || die "spec_full is empty." 259 260 # Aux source dir is expected along the .spec file. 261 local aux_src_dir="${spec_full%.spec}" 262 263 # Return early if there is no aux source dir. 264 [ -d "$aux_src_dir" ] || return 265 266 echo "Copying auxiliary sources for '$spec' to $src_dir..." 267 268 for f in "$aux_src_dir"/* ; do 269 local ts=`stat -c '%Y' "$f"` 270 local trg_ts= 271 local trg_f="$src_dir/${f##*/}" 272 [ -f "$trg_f" ] && trg_ts=`stat -c '%Y' "$trg_f"` 273 if [ "$ts" != "$trg_ts" ] ; then 274 echo "Copying $f..." 275 run cp -p "$f" "$trg_f" 276 fi 277 done 278 } 279 244 280 build_cmd() 245 281 { … … 248 284 echo "Spec file: $spec_full" 249 285 echo "Targets: $RPMBUILD_BOT_ARCH_LIST + SRPM + ZIP ($base_arch)" 286 287 sync_aux_src 250 288 251 289 if [ -f "$spec_list" ] ; then … … 344 382 { 345 383 echo "Spec file: $spec_full" 384 385 sync_aux_src 346 386 347 387 local base_arch="${RPMBUILD_BOT_ARCH_LIST##* }" … … 600 640 601 641 # Query all rpmbuild macros in a single run as it may be slow. 602 eval `rpmbuild.exe --eval='rpmbuild_dir="%_topdir" ; spec_dir="%_specdir"' | tr '\\\' /` 642 eval `rpmbuild.exe --eval='rpmbuild_dir="%_topdir" ; spec_dir="%_specdir" ; src_dir="%_sourcedir"' | tr '\\\' /` 643 644 [ -n "$rpmbuild_dir" -a -d "$rpmbuild_dir" ] || die "Falied to get %_topdir from rpmbuild or not directory ($rpmbuild_dir)." 645 [ -n "$spec_dir" -a -d "$spec_dir" ] || die "Falied to get %_specdir from rpmbuild or not directory ($spec_dir)." 646 [ -n "$src_dir" -a -d "$src_dir" ] || die "Falied to get %_sourcedir from rpmbuild or not directory ($src_dir)." 603 647 604 648 log_dir="$rpmbuild_dir/logs"
Note:
See TracChangeset
for help on using the changeset viewer.