7 # 2 - no spec file name in cmdl parameters
8 # 3 - spec file not stored in repo
9 # 4 - some source, patch or icon files not stored in repo
10 # 5 - package build failed
11 # 6 - spec file with errors
14 # - builder -u fetches current version first
15 # - tries to get new version from distfiles without new md5
16 # - after fetching new version doesn't update md5
17 # - doesn't get sources for specs with %include /usr/lib/rpm/macros.python
18 # when there's no rpm-pythonprov (rpm's fault, but it's ugly anyway)
19 # - as above with %include /usr/lib/rpm/macros.perl and no rpm-perlprov
20 # - when Icon: field is present, -5 and -a5 doesn't work
23 Build package utility from PLD CVS repository
24 V 0.11 (C) 1999-2003 Free Penguins".
25 PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin"
41 ALWAYS_CVSUP=${ALWAYS_CVSUP:-"yes"}
42 if [ -s CVS/Root ]; then
43 CVSROOT=$(cat CVS/Root)
45 CVSROOT=${CVSROOT:-""}
47 # Example: LOGFILE='../log.$PACKAGE_NAME'
48 # Yes, you can use variable name! Note _single_ quotes!
67 WGET_RETRIES=${MAX_WGET_RETRIES:-0}
68 CVS_RETRIES=${MAX_CVS_RETRIES:-1000}
73 CVS_SERVER="cvs.pld-linux.org"
74 DISTFILES_SERVER="://distfiles.pld-linux.org"
78 FAIL_IF_NO_SOURCES="yes"
80 wget --help 2>&1 | grep -q ' \-\-inet ' && WGET_OPTS="$WGET_OPTS --inet"
81 wget --help 2>&1 | grep -q ' \-\-retry\-connrefused ' && WGET_OPTS="$WGET_OPTS --retry-connrefused"
83 GETURI="wget --passive-ftp -c -nd -t$WGET_RETRIES $WGET_OPTS"
84 GETURI2="wget -c -nd -t$WGET_RETRIES $WGET_OPTS"
87 if (rpm --version 2>&1 | grep -q '4.0.[0-2]'); then
95 if [ -f ~/etc/builderrc ]; then
97 elif [ -f ~/.builderrc ]; then
101 #---------------------------------------------
106 if [ -n "$DEBUG" ]; then set -xv; fi
108 Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build]
110 [-bb|--build-binary] [-bs|--build-source] [-u|--try-upgrade]
111 [{-B|--branch} <branch>] [{-d|--cvsroot} <cvsroot>] [-g|--get]
112 [-h|--help] [--http] [{-l,--logtofile} <logfile>] [-m|--mr-proper]
113 [-q|--quiet] [--date <yyyy-mm-dd> [-r <cvstag>] [{-T--tag <cvstag>]
114 [-Tvs|--tag-version-stable] [-Tvn|--tag-version-nest]
115 [-Ts|--tag-stable] [-Tn|--tag-nest] [-Tv|--tag-version]
116 [{-Tp|--tag-prefix} <prefix>]
117 [-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>]
118 [--with/--without <feature>] [--define <macro> <value>] <package>[.spec]
121 - update md5 comments in spec, implies -nd -ncs
122 -a5, --add-md5 - add md5 comments to URL sources, implies -nc -nd -ncs
123 -D, --debug - enable script debugging mode,
124 -V, --version - output builder version
125 -a, --as_anon - get files via pserver as cvs@$CVS_SERVER,
127 --build - get all files from CVS repo or HTTP/FTP and build
128 package from <package>.spec,
130 - get all files from CVS repo or HTTP/FTP and build
131 binary only package from <package>.spec,
133 --build-source - get all files from CVS repo or HTTP/FTP and only
134 pack them into src.rpm,
135 -B, --branch - add branch
136 -c, --clean - clean all temporarily created files (in BUILD,
137 SOURCES, SPECS and \$RPM_BUILD_ROOT),
138 -d <cvsroot>, --cvsroot <cvsroot>
140 --define <macro> <value>
141 - define a macro <macro> with value <value>,
142 --nodeps - rpm won't check any dependences
143 -g, --get - get <package>.spec and all related files from
144 CVS repo or HTTP/FTP,
145 -h, --help - this message,
146 --http - use http instead of ftp,
147 -l <logfile>, --logtofile <logfile>
149 -m, --mr-proper - only remove all files related to spec file and
151 -nc, --no-cvs - don't download sources from CVS, if source URL is
154 - don't check specs in CVS
156 - don't download from distfiles
157 -nm, --no-mirrors - don't download from mirror, if source URL is given,
158 -nu, --no-urls - don't try to download from FTP/HTTP location,
159 -ns, --no-srcs - don't download Sources
161 - don't download Source0
163 - additional options for rpm
164 -q, --quiet - be quiet,
166 - build package using resources from specified CVS
168 -r <cvstag>, --cvstag <cvstag>
169 - build package using resources from specified CVS
171 -T <cvstag> , --tag <cvstag>
172 - add cvs tag <cvstag> for files,
173 -Tvs, --tag-version-stable
174 - add cvs tags STABLE and NAME-VERSION-RELESE for files,
175 -Tvn, --tag-version-nest
176 - add cvs tags NEST and NAME-VERSION-RELESE for files,
178 - add cvs tag STABLE for files,
180 - add cvs tag NEST for files,
182 - add cvs tag NAME-VERSION-RELESE for files,
183 -Tp, --tag-prefix <prefix>
184 - add <prefix> to NAME-VERSION-RELEASE tags,
185 -v, --verbose - be verbose,
187 - check version, and try to upgrade package
188 -un, --try-upgrade-with-float-version
189 - as above, but allow float version
191 - refetch sources, don't use distfiles, and update md5
193 --with/--without <feature>
194 - conditional build package depending on
195 %_with_<feature>/%_without_<feature> macro
204 rpm -bp --nodeps --define 'prep %dump' $BCOND $SPECFILE 2>&1
207 rpmbuild --nodigest --nosignature --define 'prep %dump' $BCOND $SPECFILE 2>&1
213 if [ -z "$rpm_dump_cache" ] ; then
214 echo "internal error: cache_rpm_dump not called!" 1>&2
216 echo "$rpm_dump_cache"
221 if [ -n "$DEBUG" ]; then
230 if [ "$NOSRCS" != "yes" ]; then
231 SOURCES="`rpm_dump | awk '/SOURCEURL[0-9]+/ {print $3}'`"
233 if (rpm_dump | grep -qEi ":.*nosource.*1"); then
234 FAIL_IF_NO_SOURCES="no"
237 PATCHES="`rpm_dump | awk '/PATCHURL[0-9]+/ {print $3}'`"
238 ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`"
239 PACKAGE_NAME="`$RPM -q --qf '%{NAME}\n' --specfile ${SPECFILE} 2> /dev/null | head -1`"
240 PACKAGE_VERSION="`$RPM -q --qf '%{VERSION}\n' --specfile ${SPECFILE} 2> /dev/null| head -1`"
241 PACKAGE_RELEASE="`$RPM -q --qf '%{RELEASE}\n' --specfile ${SPECFILE} 2> /dev/null | head -1`"
243 if [ -n "$BE_VERBOSE" ]; then
244 echo "- Sources : `nourl $SOURCES`"
245 if [ -n "$PATCHES" ]; then
246 echo "- Patches : `nourl $PATCHES`"
248 echo "- Patches : *no patches needed*"
250 if [ -n "$ICONS" ]; then
251 echo "- Icon : `nourl $ICONS`"
253 echo "- Icon : *no package icon*"
255 echo "- Name : $PACKAGE_NAME"
256 echo "- Version : $PACKAGE_VERSION"
257 echo "- Release : $PACKAGE_RELEASE"
263 if [ -n "$DEBUG" ]; then
271 "err_no_spec_in_cmdl" )
272 echo "ERROR: spec file name not specified.";
274 "err_no_spec_in_repo" )
275 echo "Error: spec file not stored in CVS repo.";
277 "err_no_source_in_repo" )
278 echo "Error: some source, patch or icon files not stored in CVS repo. ($2)";
281 echo "Error: package build failed. (${2:-no more info})";
288 if [ -n "$DEBUG" ]; then
293 SOURCE_DIR="`$RPM --eval '%{_sourcedir}'`"
294 SPECS_DIR="`$RPM --eval '%{_specdir}'`"
301 if [ -n "$DEBUG" ]; then
306 if [ "$NOCVSSPEC" != "yes" ]; then
311 if [ -n "$CVSROOT" ]; then
312 OPTIONS="-d $CVSROOT $OPTIONS"
314 if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then
315 echo "warning: No cvs access defined - using local .spec file"
320 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
321 OPTIONS="$OPTIONS -A"
323 if [ -n "$CVSDATE" ]; then
324 OPTIONS="$OPTIONS -D $CVSDATE"
326 if [ -n "$CVSTAG" ]; then
327 OPTIONS="$OPTIONS -r $CVSTAG"
333 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do
334 retries_counter=$(( $retries_counter + 1 ))
335 output=$(LC_ALL=C cvs $OPTIONS $SPECFILE 2>&1)
337 [ -n "$output" ] && echo "$output"
338 if [ "$result" -ne "0" ]; then
339 if (echo "$output" | grep -qE "(Cannot connect to|connect to .* failed|Connection reset by peer|Connection timed out|Unknown host)") && [ "$retries_counter" -le "$CVS_RETRIES" ]; then
340 echo "Trying again [$SPECFILE]... ($retries_counter)"
344 Exit_error err_no_spec_in_repo;
348 if [ ! -f "$SPECFILE" ]; then
349 Exit_error err_no_spec_in_repo;
352 if [ "$CHMOD" = "yes" -a -n "$SPECFILE" ]; then
353 chmod $CHMOD_MODE $SPECFILE
356 grep -E -m 1 "^#.*Revision:.*Date" $SPECFILE
363 if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then
364 cvs update mirrors >&2
368 while read origin mirror name rest; do
369 ol=`echo -n "$origin"|wc -c`
370 prefix="`echo -n "$url" | head -c $ol`"
371 if [ "$prefix" = "$origin" ] ; then
372 suffix="`echo "$url"|cut -b $ol-`"
373 echo -n "$mirror$suffix"
384 grep "SOURCEURL[0-9]*[ ]*$1""[ ]*$" | \
385 sed -e 's/.*SOURCEURL\([0-9][0-9]*\).*/\1/' | \
392 [ -z "$no" ] && return
394 spec_rev=$(grep $SPECFILE CVS/Entries | sed -e s:/$SPECFILE/:: -e s:/.*::)
395 if [ -z "$spec_rev" ]; then
396 spec_rev="$(head -1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')"
398 spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')"
399 md5=$(grep -s -v '^#' additional-md5sums | \
400 grep -E "[ ]$(basename "$1")[ ]+${spec}([ ,]|\$)" | \
401 sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \
402 grep -E '^[0-9a-f]{32}$')
403 if [ X"$md5" = X"" ] ; then
404 grep -i "#[ ]*Source$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://' | xargs
406 if [ $(echo "$md5" | wc -l) != 1 ] ; then
407 echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2
409 echo "$md5" | tail -1
415 echo "$PROTOCOL$DISTFILES_SERVER/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
422 [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ]
429 if [ -n "$DEBUG" ]; then
434 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
438 if [ -n "$CVSROOT" ]; then
439 OPTIONS="-d $CVSROOT $OPTIONS"
441 if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
442 echo "warning: No cvs access defined for SOURCES"
446 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
447 OPTIONS="$OPTIONS -A"
449 if [ -n "$CVSDATE" ]; then
450 OPTIONS="$OPTIONS -D $CVSDATE"
452 if [ -n "$CVSTAG" ]; then
453 OPTIONS="$OPTIONS -r $CVSTAG"
456 for i in $GET_FILES; do
457 if [ -n "$UPDATE5" ]; then
458 if [ -n "$ADD5" ]; then
459 [ `nourl $i` = "$i" ] && continue
460 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE && continue
462 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE || continue
466 if [ ! -f `nourl $i` ] || [ $ALWAYS_CVSUP = "yes" ]; then
467 if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
468 echo "Warning: no URL given for $i"
471 if [ -n "$(src_md5 "$i")" ] && [ -z "$NODIST" ]; then
472 if good_md5 "$i"; then
473 echo "$(nourl "$i") having proper md5sum already exists"
477 url=$(distfiles_url "$i")
478 if [ `echo $url | grep -E '^(\.|/)'` ]; then
479 ${GETLOCAL} $url $target
482 if [ -z "$NOMIRRORS" ]; then
483 url="`find_mirror "$url"`"
485 ${GETURI} -O "$target" "$url" || \
486 if [ `echo $url | grep -E 'ftp://'` ]; then
487 ${GETURI2} -O "$target" "$url"
489 if ! test -s "$target"; then
494 elif [ -z "$(src_md5 "$i")" -a "$NOCVS" != "yes" ]; then
495 # ( echo $i | grep -qvE '(ftp|http|https)://' ); -- if CVS should be used, but URLs preferred
498 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do
499 retries_counter=$(( $retries_counter + 1 ))
500 output=$(LC_ALL=C cvs $OPTIONS `nourl $i` 2>&1)
502 [ -n "$output" ] && echo "$output"
503 if (echo "$output" | grep -qE "(Cannot connect to|connect to .* failed|Connection reset by peer|Connection timed out|Unknown host)") && [ "$result" -ne "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; then
504 echo "Trying again [`nourl $i`]... ($retries_counter)"
513 if [ -z "$NOURLS" ] && [ ! -f "`nourl $i`" -o -n "$UPDATE" ] && [ `echo $i | grep -E 'ftp://|http://|https://'` ]; then
514 if [ -z "$NOMIRRORS" ]; then
515 im="`find_mirror "$i"`"
520 if [ `echo $im | grep -E 'ftp://'` ]; then ${GETURI2} "$im" ; fi
526 if [ ! -f "`nourl $i`" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
527 Exit_error err_no_source_in_repo $i;
528 elif [ -n "$UPDATE5" ] && \
529 ( ( [ -n "$ADD5" ] && echo $i | grep -q -E 'ftp://|http://|https://' && \
530 [ -z "$(grep -E -i '^NoSource[ ]*:[ ]*'$i'([ ]|$)' $SPECS_DIR/$SPECFILE)" ] ) || \
531 grep -q -i -E '^#[ ]*source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE )
533 echo "Updating source-$srcno md5."
534 md5=$(md5sum `nourl $i` | cut -f1 -d' ')
536 print unless /^\s*#\s*Source'$srcno'-md5\s*:/i;
537 print "# Source'$srcno'-md5:\t'$md5'\n"
538 if /^Source'$srcno'\s*:\s+/;
543 if good_md5 "$i"; then
545 elif [ "$FROM_DISTFILES" = 1 ]; then
546 # wrong md5 from distfiles: remove the file and try again
548 echo "MD5 sum mismatch. Trying full fetch."
551 ${GETURI} -O "$target" "$url" || \
552 if [ `echo $url | grep -E 'ftp://'` ]; then
553 ${GETURI2} -O "$target" "$url"
555 test -s "$target" || rm -f "$target"
558 if good_md5 "$i"; then
561 echo "MD5 sum mismatch. Use -U to refetch sources,"
562 echo "or -5 to update md5 sums, if you're sure files are correct."
563 Exit_error err_no_source_in_repo $i
567 if [ "$CHMOD" = "yes" ]; then
568 CHMOD_FILES="`nourl $GET_FILES`"
569 if [ -n "$CHMOD_FILES" ]; then
570 chmod $CHMOD_MODE $CHMOD_FILES
581 if [ -n "$DEBUG" ]; then
586 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
587 echo "Version: $PACKAGE_VERSION"
588 echo "Release: $PACKAGE_RELEASE"
589 # Check whether first character of PACKAGE_NAME is legal for tag name
590 if [ -z "${PACKAGE_NAME##[_0-9]*}" -a -z "$TAG_PREFIX" ]; then
593 TAGVER=$TAG_PREFIX$PACKAGE_NAME-`echo $PACKAGE_VERSION | sed -e "s/\./\_/g" -e "s/@/#/g"`-`echo $PACKAGE_RELEASE | sed -e "s/\./\_/g" -e "s/@/#/g"`
594 # Remove #kernel.version_release from TAGVER because tagging sources
595 # could occur with different kernel-headers than kernel-headers used at build time.
596 TAGVER=$(echo "$TAGVER" | sed -e 's/#.*//g')
597 if [ "$TAG_VERSION" = "yes" ]; then
598 echo "CVS tag: $TAGVER"
600 if [ -n "$TAG" ]; then
605 if [ -n "$CVSROOT" ]; then
606 OPTIONS="-d $CVSROOT $OPTIONS"
610 for i in $TAG_FILES; do
611 # don't tag non cvs files (ie. stored on distfiles)
612 [ "`nourl $i`" != "$i" ] && continue
613 if [ -f "`nourl $i`" ]; then
614 if [ "$TAG_VERSION" = "yes" ]; then
615 cvs $OPTIONS $TAGVER `nourl $i`
617 if [ -n "$TAG" ]; then
618 cvs $OPTIONS $TAG `nourl $i`
621 Exit_error err_no_source_in_repo $i
626 if [ "$TAG_VERSION" = "yes" ]; then
627 cvs $OPTIONS $TAGVER $SPECFILE
629 if [ -n "$TAG" ]; then
630 cvs $OPTIONS $TAG $SPECFILE
640 echo "CVS branch tag: $TAG"
645 if [ -n "$DEBUG" ]; then
650 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
653 if [ -n "$CVSROOT" ]; then
654 OPTIONS="-d $CVSROOT $OPTIONS"
657 for i in $TAG_FILES; do
658 if [ -f `nourl $i` ]; then
659 cvs $OPTIONS $TAG `nourl $i`
661 Exit_error err_no_source_in_repo $i
665 cvs $OPTIONS $TAG $SPECFILE
675 if [ -n "$DEBUG" ]; then
682 if [ -n "$TRY_UPGRADE" ]; then
684 if [ -n "$FLOAT_VERSION" ]; then
685 TNOTIFY=`./pldnotify.awk $SPECFILE -n`
687 TNOTIFY=`./pldnotify.awk $SPECFILE`
690 TNEWVER=`echo $TNOTIFY | awk '{ match($4,/\[NEW\]/); print $5 }'`
692 if [ -n "$TNEWVER" ]; then
694 TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'`
696 echo "New version found, updating spec file to version " $TNEWVER
698 cp -f $SPECFILE $SPECFILE.bak
702 eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE"
703 eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t1/' $SPECFILE"
707 get_files "$SOURCES $PATCHES";
709 unset TOLDVER TNEWVER TNOTIFY
719 BUILD_SWITCH="-ba" ;;
721 BUILD_SWITCH="-bb" ;;
723 BUILD_SWITCH="-bs --nodeps" ;;
725 if [ -n "$LOGFILE" ]; then
726 LOG=`eval echo $LOGFILE`
727 if [ -n "$LASTLOG_FILE" ]; then
728 echo "LASTLOG=$LOG" > $LASTLOG_FILE
730 RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM
731 (time nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
732 RETVAL=`cat $RES_FILE`
734 if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then
735 if [ "$RETVAL" -eq "0" ]; then
742 eval nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $SPECFILE
746 if [ "$RETVAL" -ne "0" ]; then
748 if [ -n "$TRY_UPGRADE" ]; then
749 echo "\n!!! Package with new version cannot be build automagically\n"
750 mv -f $SPECFILE.bak $SPECFILE
753 Exit_error err_build_fail;
761 echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g'
764 #---------------------------------------------
767 if [ "$#" = 0 ]; then
772 while test $# -gt 0 ; do
789 DEBUG="yes"; shift ;;
791 COMMAND="version"; shift ;;
793 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;;
795 COMMAND="build"; shift ;;
796 -bb | --build-binary )
797 COMMAND="build-binary"; shift ;;
798 -bs | --build-source )
799 COMMAND="build-source"; shift ;;
801 COMMAND="branch"; shift; TAG="${1}"; shift;;
803 CLEAN="--clean --rmspec --rmsource"; shift ;;
805 shift; CVSROOT="${1}"; shift ;;
807 COMMAND="get"; shift ;;
809 COMMAND="usage"; shift ;;
811 PROTOCOL="http"; shift ;;
813 shift; LOGFILE="${1}"; shift ;;
815 shift; DEF_NICE_LEVEL=${1}; shift ;;
817 COMMAND="mr-proper"; shift ;;
819 NOCVS="yes"; shift ;;
820 -ncs | --no-cvs-specs )
821 NOCVSSPEC="yes"; shift ;;
822 -nd | --no-distfiles )
823 NODIST="yes"; shift ;;
825 NOMIRRORS="yes"; shift ;;
827 NOURLS="yes"; shift ;;
829 NOSRCS="yes"; shift ;;
830 -ns0 | --no-source0 )
831 NOSOURCE0="yes"; shift ;;
833 shift; RPMOPTS="${1}"; shift ;;
835 BCOND="$BCOND $1 $2" ; shift 2 ;;
837 QUIET="--quiet"; shift ;;
839 CVSDATE="${2}"; shift 2 ;;
841 shift; CVSTAG="${1}"; shift ;;
842 -Tvs | --tag-version-stable )
847 -Tvn | --tag-version-nest )
862 -Tv | --tag-version )
884 TRY_UPGRADE="1"; shift ;;
885 -un | --try-upgrade-with-float-version )
886 TRY_UPGRADE="1"; FLOAT_VERSION="1"; shift ;;
888 BE_VERBOSE="1"; shift ;;
894 RPMOPTS="${RPMOPTS} --define \"${MACRO} ${VALUE}\""
898 RPMOPTS="${RPMOPTS} --nodeps"
901 SPECFILE="`basename ${1} .spec`.spec"; shift ;;
905 if [ -n "$DEBUG" ]; then
911 "build" | "build-binary" | "build-source" )
913 if [ -n "$SPECFILE" ]; then
917 if [ -n "$FAIL_IF_CHANGED_BUT_NOT_BUMPED" ]; then
918 TAGVER=$PACKAGE_NAME-`echo $PACKAGE_VERSION | sed -e "s/\./\_/g" -e "s/@/#/g"`-`echo $PACKAGE_RELEASE | sed -e "s/\./\_/g" -e "s/@/#/g"`
919 CURTAGREL=$(cvs status $SPECFILE | grep "Working revision:" | awk '{ print $3 }')
920 TAGREL=$(cvs status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g')
922 if [ -n "$TAGREL" -a "$TAGREL" != "$CURTAGREL" ]; then
923 Exit_error err_build_fail "not bumped ver-rel - was already used in rev $TAGREL"
927 if [ -n "$ICONS" ]; then
931 if [ -n "$NOSOURCE0" ] ; then
932 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
934 get_files "$SOURCES $PATCHES";
937 Exit_error err_no_spec_in_cmdl;
942 if [ -n "$SPECFILE" ]; then
945 if [ -n "$ICONS" ]; then
949 get_files $SOURCES $PATCHES;
950 branch_files $TAG "$SOURCES $PATCHES $ICONS";
952 Exit_error err_no_spec_in_cmdl;
957 if [ -n "$SPECFILE" ]; then
960 if [ -n "$ICONS" ]; then
964 if [ -n "$NOSOURCE0" ] ; then
965 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
967 get_files $SOURCES $PATCHES
969 Exit_error err_no_spec_in_cmdl;
974 if [ -n "$SPECFILE" ]; then
977 if [ -n "$ICONS" ]; then
981 # don't fetch sources from remote locations
983 for file in $SOURCES; do
984 [ "`nourl $file`" != "$file" ] && continue
985 new_SOURCES="$new_SOURCES $file"
987 SOURCES="$new_SOURCES"
988 get_files $SOURCES $PATCHES;
989 tag_files "$SOURCES $PATCHES $ICONS";
991 Exit_error err_no_spec_in_cmdl;
995 $RPM --clean --rmsource --rmspec --force --nodeps $SPECFILE