Ticket #106: out1.diff
File out1.diff, 2.3 KB (added by , 10 years ago) |
---|
-
netlabs-rpmbuild-all.sh
52 52 test -n "$spec" || { echo "ERROR: You must specify a .spec file."; exit 1; } 53 53 54 54 spec_name="${spec##*/}" 55 logDir='.' 55 56 56 57 # Set up official netlabs.org rpmbuild environment 57 58 . netlabs-rpmbuild-env.sh 58 59 60 if test -d "$logDir" ; then 61 # already around 62 else 63 run mkdir -p "$logDir" 64 fi 65 59 66 # Override variables from the command line, if any 60 67 shift 61 68 while test "$1" != "" ; do … … 79 86 80 87 # Generate RPMs 81 88 for arch in $NETLABS_RPM_ARCH_LIST ; do 82 echo "Creating RPMs for '$arch' target (logging to $ spec_name.$arch.log)..."83 log_run "$ spec_name.$arch.log" rpmbuild --target=$arch -bb "$spec"89 echo "Creating RPMs for '$arch' target (logging to $logDir/$spec_name.$arch.log)..." 90 log_run "$logDir/$spec_name.$arch.log" rpmbuild --target=$arch -bb "$spec" 84 91 done 85 92 86 93 # Generate SRPM 87 echo "Creating SRPM (logging to $ spec_name.srpm.log)..."88 log_run "$ spec_name.srpm.log" rpmbuild -bs "$spec"94 echo "Creating SRPM (logging to $logDir/$spec_name.srpm.log)..." 95 log_run "$logDir/$spec_name.srpm.log" rpmbuild -bs "$spec" 89 96 90 97 # Generate ZIP 91 echo "Creating ZIP (logging to $ spec_name.zip.log)..."98 echo "Creating ZIP (logging to $logDir/$spec_name.zip.log)..." 92 99 create_zip() 93 100 {( 94 zip=`grep "src.rpm" "$ spec_name.srpm.log" | sed -e "s#^[a-zA-Z ]*: *##g" -e "s#.src.rpm##g" | tr . _`.zip101 zip=`grep "src.rpm" "$logDir/$spec_name.srpm.log" | sed -e "s#^[a-zA-Z ]*: *##g" -e "s#.src.rpm##g" | tr . _`.zip 95 102 zip_dir="${zip%/*}/../zip" 96 103 zip="$zip_dir/${zip##*/}" 97 104 echo "Will create '$zip'" 98 105 run mkdir -p "$zip_dir" 99 106 rm -r "@unixroot" 2> /dev/null 100 for rpm in `grep "$zip_arch.rpm\|noarch.rpm" "$ spec_name.$zip_arch.log" | sed "s#^[a-zA-Z ]*: *##g"` ; do107 for rpm in `grep "$zip_arch.rpm\|noarch.rpm" "$logDir/$spec_name.$zip_arch.log" | sed "s#^[a-zA-Z ]*: *##g"` ; do 101 108 echo "Unpacking $rpm..." 102 109 run rpm2cpio "$rpm" | cpio -idm 103 110 done 104 111 rm -f "$zip" 2> /dev/null 105 112 run zip -mry9 "$zip" "@unixroot" 106 113 )} 107 log_run "$ spec_name.zip.log" create_zip114 log_run "$logDir/$spec_name.zip.log" create_zip 108 115 109 116 echo "All done."