+%patch0 -p1
+%patch1 -p1
+
+cat <<'EOF' > %{name}.sh
+# check for bash
+[ -z "$BASH_VERSION" ] && return
+
+# must be interactive shell, not script
+[[ $- = *i* ]] || return
+
+# check for correct version of bash
+bash=${BASH_VERSION%%.*}; bmajor=${bash%%.*}; bminor=${bash#*.}
+if [ "$bmajor" -eq 2 -a "$bminor" '>' 04 ] || [ "$bmajor" -gt 2 ]; then
+ if [ "$PS1" ]; then # interactive shell
+ # Source completion code
+ . %{_sysconfdir}/bash_completion
+ fi
+fi
+unset bash bminor bmajor
+EOF