3 # shell script wizard to build bacula rpm using gnome dialogs
4 # requires zenity to be installed
5 # 30 Jul 2006 D. Scott Barninger
7 # Copyright (C) 2006 Free Software Foundation Europe e.V.
8 # licensed under GPL-v2
10 # usage ./rpm_wizard.sh
13 HAVE_ZENITY=`which zenity`
14 if [ -z $HAVE_ZENITY ];
16 echo You need zenity installed to run this script;
20 zenity --question --text "Bacula rpm rebuilding wizard. Do you wish to continue?"
23 if [ "$RESULT" = "1" ];
28 # get packager name and email adddress
29 PACKAGER=`zenity --text-info --editable --height=25 --width=300 --title="Enter Your Name <your_email_address>"`
31 # get location of src rpm
32 SELECTED_FILE=`zenity --file-selection --title "Choose SRPM file to rebuild"`
35 if [ "$RESULT" = "1" ];
40 # select build platform
41 PLATFORM=`zenity --title "Select Platform" --text "Please choose a build platform." --list --radiolist --column "Select" --column "Platform" False rh7 False rh8 False rh9 False fc1 False fc3 False fc4 False fc5 False fc6 False wb3 False rhel3 False rhel4 False centos3 False centos4 False sl3 False sl4 False su9 False su10 False su102 False mdk False mdv`
44 if [ "$RESULT" = "1" ];
49 # select database support
50 DATABASE=`zenity --title "Select Database" --text "Please choose database support." --list --radiolist --column "Select" --column "Database" False sqlite False mysql False mysql4 False mysql5 False postgresql False client_only`
53 if [ "$RESULT" = "1" ];
58 # select other build options
59 OPTIONS=`zenity --title "Select Options" --text "Please choose other options." --list --checklist --column "Select" --column "Other" False build_bat False build_wxconsole False nobuild_gconsole False build_x86_64 False build_python`
62 if [ "$RESULT" = "1" ];
67 OPTION1=`echo $OPTIONS|cut --delimiter=\| -f1`
68 OPTION2=`echo $OPTIONS|cut --delimiter=\| -f2`
69 OPTION3=`echo $OPTIONS|cut --delimiter=\| -f3`
70 OPTION4=`echo $OPTIONS|cut --delimiter=\| -f4`
71 OPTION5=`echo $OPTIONS|cut --delimiter=\| -f5`
73 # construct rpmbuild command
74 COMMAND="rpmbuild --rebuild --define 'build_$PLATFORM 1' --define 'build_$DATABASE 1' --define 'contrib_packager ${PACKAGER}'"
78 COMMAND="${COMMAND} --define '$OPTION1 1'";
82 COMMAND="${COMMAND} --define '$OPTION2 1'";
86 COMMAND="${COMMAND} --define '$OPTION3 1'";
90 COMMAND="${COMMAND} --define '$OPTION4 1'";
94 COMMAND="${COMMAND} --define '$OPTION5 1'";
97 COMMAND="${COMMAND} ${SELECTED_FILE}"
99 zenity --question --text "Ready to rebuild the src rpm with $COMMAND. Do you wish to continue?"
102 if [ "$RESULT" = "1" ];
111 # 30 Jul 2006 initial release
112 # 05 Aug 2006 add option for build_python
113 # 27 Jan 2007 add fc6
114 # 29 Apr 2007 add sl3 & sl4 target and bat option