gerar.sh 1.07 KB
Newer Older
Danilo K. S. Yorinori's avatar
Danilo K. S. Yorinori committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
#!/bin/bash
# gerar.sh
# Copyright (c) 2006 by Bruno Ribas <ribas@ufpr.br>

DIRTMP=$(mktemp -d)
VERSAO=$(cat VERSAO)

#arrumar versao
#$1 tipo de incremento
MAJOR=$(echo $VERSAO| cut -d'.' -f1)
MINOR=$(echo $VERSAO| cut -d'.' -f2)
REVISION=$(echo $VERSAO| cut -d'.' -f3)

case $1 in
	Minor)
		((MINOR++))
		REVISION=0
		;;
	Major)
		((MAJOR++))
		MINOR=0
		REVISION=0
		;;
	help)
		echo "Uso: $0 Major|Minor|Revision"
		echo '     Major - Altera versao Major'
		echo '     Minor - Altera versao Minor'
		exit
		;;
	*)
		((REVISION++))
		;;
esac

VERSAO="${MAJOR}.${MINOR}.${REVISION}"
echo "$VERSAO" > VERSAO
		

#Compila a documentacao do pacote no diretorio doc/
#cd doc/
#hevea -text *.tex 
#hevea -text *.tex 
#cd ../

cp -r pacote $DIRTMP

#Copia a documentacao compilada para dentro do pacote.
#cp doc/*.txt $DIRTMP/pacote/usr/share/doc/prd-* 

cd $DIRTMP
find . -name ".svn" -exec rm -rf {} \; &>/dev/null
sed -i -e "s/Version:/Version: $VERSAO/" pacote/DEBIAN/control

fakeroot dpkg -b pacote .

cd -

cp $DIRTMP/*deb .
rm -rf $DIRTMP


# vim:tabstop=4:shiftwidth=4:encoding=iso-8859-1