#!/bin/bash
set -e
. /var/lib/jenkins/jobs/master.get_branch_repo/workspace/big-data/pack-funcs

productName=hadoop
downloadHadoopAndMakeChanges() {
	initializeVariables $1
	confDirectory=$BASE/$fileName/etc/$productName
	hadoopTarFile=hadoop-1.2.1-bin.tar.gz
	# Create directories that are required for the debian package
        mkdir -p $confDirectory

	wget http://www.apache.org/dist/hadoop/core/hadoop-1.2.1/$hadoopTarFile -P $tempDirectory
	if [ -f $BASE/$fileName/opt/README ]; then
	        rm $BASE/$fileName/opt/README
	fi
	# unpack tar ball and make changes 
	pushd $tempDirectory
	tar -xpf $hadoopTarFile -C .
	rm $hadoopTarFile
	mv hadoop*/conf/* $confDirectory
	ln -s $confDirectory/* hadoop*/conf/	
	popd
}

# 2) Get the sources which are downloaded from version control system to local machine to relevant directories to generate the debian package
getSourcesToRelevantDirectories $productName
# 3) Download hadoop tar file and make necessary changes
downloadHadoopAndMakeChanges $productName
# 4) Create the Debian package
generateDebianPackage $productName

#!/bin/bash
set -e
. /var/lib/jenkins/jobs/master.get_branch_repo/workspace/big-data/pack-funcs

productName=hadoop
downloadHadoopAndMakeChanges() {
	initializeVariables $1
	confDirectory=$BASE/$fileName/etc/$productName
	hadoopTarFile=hadoop-1.2.1-bin.tar.gz
	# Create directories that are required for the debian package
        mkdir -p $confDirectory

	wget http://www.apache.org/dist/hadoop/core/hadoop-1.2.1/$hadoopTarFile -P $tempDirectory
	if [ -f $BASE/$fileName/opt/README ]; then
	        rm $BASE/$fileName/opt/README
	fi
	# unpack tar ball and make changes 
	pushd $tempDirectory
	tar -xpf $hadoopTarFile -C .
	rm $hadoopTarFile
	mv hadoop*/conf/* $confDirectory
	rm -r hadoop*/conf
	popd
}

# 2) Get the sources which are downloaded from version control system to local machine to relevant directories to generate the debian package
getSourcesToRelevantDirectories $productName
# 3) Download hadoop tar file and make necessary changes
downloadHadoopAndMakeChanges $productName
# 4) Create the Debian package
generateDebianPackage $productName

--- 
+++ 
@@ -19,7 +19,7 @@
 	tar -xpf $hadoopTarFile -C .
 	rm $hadoopTarFile
 	mv hadoop*/conf/* $confDirectory
-	ln -s $confDirectory/* hadoop*/conf/	
+	rm -r hadoop*/conf
 	popd
 }
 
SUBUTAI-1024: Move hadoop configurations under /etc directory

Former-commit-id: 41deb88871f0af1d50d5941c96ca8575777bf6e9