Woody1987
May 17th, 2009, 08:20 PM
Im trying to write a bash script that will download the source code for a program, in this example it is banshee. The script will then download the build dependencies and then configure and make, lastly install.
The script so far:
#!/bin/bash
cd /tmp
apt-get source <help>
sudo apt-get build-dep <help>
cd <help>
./configure CFLAGS="-march=core2 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" MAKEOPTS="j5" -prefix=/usr
make
sudo checkinstall -D make install
sudo dpkg -i <help>.deb
Where <help> is shown is where i need the help. What i want to be able to do is pass an argument to the script i.e. banshee so that <help> will read banshee or any other program i desire. This will work partly, but on lines 5 and 10 (cd <help> sudo dpkg -i <help>.deb) this wont work as this will be not just the program name but also the version.
This is what the script needs to look like:
#!/bin/bash
cd /tmp
apt-get source banshee
sudo apt-get build-dep banshee
cd banshee-1.4.3
./configure CFLAGS="-march=core2 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" MAKEOPTS="j5" -prefix=/usr
make
sudo checkinstall -D make install
sudo dpkg -i banshee-1.4.3_amd64.deb
This would be fine if the only program i wanted to compile was banshee, but i want to be able to pass any program into the script and for it to compile.
The script so far:
#!/bin/bash
cd /tmp
apt-get source <help>
sudo apt-get build-dep <help>
cd <help>
./configure CFLAGS="-march=core2 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" MAKEOPTS="j5" -prefix=/usr
make
sudo checkinstall -D make install
sudo dpkg -i <help>.deb
Where <help> is shown is where i need the help. What i want to be able to do is pass an argument to the script i.e. banshee so that <help> will read banshee or any other program i desire. This will work partly, but on lines 5 and 10 (cd <help> sudo dpkg -i <help>.deb) this wont work as this will be not just the program name but also the version.
This is what the script needs to look like:
#!/bin/bash
cd /tmp
apt-get source banshee
sudo apt-get build-dep banshee
cd banshee-1.4.3
./configure CFLAGS="-march=core2 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" MAKEOPTS="j5" -prefix=/usr
make
sudo checkinstall -D make install
sudo dpkg -i banshee-1.4.3_amd64.deb
This would be fine if the only program i wanted to compile was banshee, but i want to be able to pass any program into the script and for it to compile.