: ${PACKAGE_NAME=''}
: ${NETWORKING=false}
: ${TRACING=false}
+: ${WITH=}
+: ${WITHOUT=}
: ${KEEP_CONTAINER=false}
: ${TMPFS="4G"}
-v $dir/cache/poldek:/var/cache/poldek \
-v $dir/cache/ccache/$PACKAGE_NAME:$home/.ccache \
$(tmpfs) \
- $image
+ $image >/dev/null
# set the homedir
docker exec --user=root -w / $name usermod -d $home builder
}
package_build() {
+ # create default args for builder
+ set -- -nn ${WITH:+--with "${WITH# }"} ${WITHOUT:+--without "${WITHOUT# }"} "$PACKAGE_NAME"
+
while true; do
# install deps
- docker exec $name builder -g -nn -R $PACKAGE_NAME
+ docker exec $name builder -g -R "$@"
# remove .la dependencies
docker exec --user=root -w / $name $home/cleanbuild/cleanup-la
# reset findunusedbr state after deps install
docker exec --user=root -w / $name $home/cleanbuild/findunusedbr -c / $home/rpm/packages/$PACKAGE_NAME/$PACKAGE_NAME.spec
# actual build
- docker exec $name cleanbuild/teeboth $buildlog builder -nn -bb $PACKAGE_NAME --define '__spec_clean_body %{nil}' && rc=$? || rc=$?
+ docker exec $name cleanbuild/teeboth $buildlog builder -bb --define '__spec_clean_body %{nil}' "$@" && rc=$? || rc=$?
findbr=$PACKAGE_NAME.findbr.log
builddir=$(docker exec $name sh -c 'test ! -d rpm/BUILD/* || echo rpm/BUILD/*')
parse_options() {
local t
- t=$(getopt -o 'x' --long 'network,no-tmpfs,notmpfs,tmpfs:,keep-container' -n "$PROGRAM" -- "$@")
+ t=$(getopt -o 'x' --long 'network,no-tmpfs,notmpfs,tmpfs:,keep-container,with:,without:' -n "$PROGRAM" -- "$@")
[ $? != 0 ] && exit $?
eval set -- "$t"
--keep-container)
KEEP_CONTAINER=true
;;
+ --with)
+ shift
+ WITH="$WITH $1"
+ ;;
+ --without)
+ shift
+ WITHOUT="$WITHOUT $1"
+ ;;
--)
shift
break