5 Build package utility from PLD CVS repository
6 V 0.1 (C) 1999 Tomasz K³oczko".
8 PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin"
13 CVSROOT=${CVSROOT:-""}
33 echo SOURCE_DIR=%{_sourcedir}
34 echo SPECS_DIR=%{_specdir}"
36 #---------------------------------------------
42 Usage: builder [-V] [--version] [-a] [--as_anon] [-b] [--build]
43 [-d <cvsroot>] [--cvsroot <cvsroot>] [-g] [--get] [-h] [--help]
44 [-l <logfile>] [--logtofile <logfile>] [-q] [--quiet]
45 [-v] [--verbose] <package>.spec
47 -V, --version - output builder version
48 -a, --as_anon - get files via pserver as cvs@cvs.pld.org.pl,
49 -b, --build - get all files from CVS repo and build
50 package from <package>.spec,
51 -d, --cvsroot - setup \$CVSROOT,
52 -g, --get - get <package>.spec and all relayted files from
54 -h, --help - this message,
55 -l, --logtofile - log all to file,
56 -q, --quiet - be quiet,
57 -v, --verbose - be verbose,
64 sed -e "s/^Summary:*/Summary:\%dump/I" $SPECFILE > $SPECFILE.__
66 SOURCES="`rpm -bp --test $SPECFILE.__ 2>&1 | awk '/ SOURCE[0-9]+/ {print $3}'`"
67 PATCHES="`rpm -bp --test $SPECFILE.__ 2>&1 | awk '/ PATCH[0-9]+/ {print $3}'`"
68 ICON="`rpm -bp --test $SPECFILE.__ 2>&1 | awk '/^Icon:/ {print $2}' ${SPEC}`"
69 PACKAGE_NAME="`rpm -bp --test $SPECFILE.__ 2>&1 | awk '/ name/ {print $3}'`"
70 PACKAGE_VERSION="`rpm -bp --test $SPECFILE.__ 2>&1 | awk '/ PACKAGE_VERSION/ {print $3}'`"
71 PACKAGE_RELEASE="`rpm -bp --test $SPECFILE.__ 2>&1 | awk '/ PACKAGE_RELEASE/ {print $3}'`"
75 if [ "$BE_VERBOSE" != "" ]; then
76 echo -e "- Sources :\n " $SOURCES
77 echo -e "- Patches :\n " $PATCHES
78 if [ "$ICON" != "" ]; then
79 echo -e "- Icon :\n " $ICON
81 echo -e "- Icon : *no package icon*"
83 echo -e "- Name : " $PACKAGE_NAME
84 echo -e "- Version : " $PACKAGE_VERSION
85 echo -e "- Release : " $PACKAGE_RELEASE
88 DUMB_SPEC_FILE=`mktemp -q /tmp/bilder.XXXXXX`
89 echo $dumb_spec > $DUMB_SPEC_FILE
90 `rpm -bp $DUMB_SPEC_FILE | egrep -e "SOURCE_DIR|SPECS_DIR"`
111 #---------------------------------------------
114 if [ "$#" == 0 ]; then
119 while test $# -gt 0 ; do
122 COMMAND="version"; shift ;;
124 CVSROOT=":pserver:cvs@cvs.pld.org.pl:/cvsroot"; shift ;;
126 COMMAND="build"; shift ;;
128 shift; CVSROOT="${1}"; shift ;;
130 COMMAND="get"; shift ;;
132 COMMAND="usage"; shift ;;
134 shift; LOGFILE="${1}"; shift ;;
138 BE_VERBOSE="1"; shift ;;
140 SPECFILE="${1}"; shift ;;
146 if [ "$SPECFILE" != "" ]; then
152 echo "ERROR: spec file name not specified.";
158 if [ "$SPECFILE" != "" ]; then
163 echo "ERROR: spec file name not specified.";