make_packages.sh 2.26 KB
Newer Older
1 2 3 4 5 6 7
#!/bin/bash
DIR=$(cd `dirname $0` && pwd)
PYROPATH=$(cd `dirname $0` && cd .. && pwd)

# Install build dependencies (if needed)
if [ ! -f /usr/bin/debuild ];
then
8
    sudo apt-get install devscripts equivs python-setuptools dh-python
9 10 11 12 13
fi
if [ ! -f /usr/bin/rpm ];
then
    sudo apt-get install rpm
fi
14 15 16 17
if [ ! -f /usr/lib/python2.7/dist-packages/sphinxarg/ext.py ];
then
    sudo apt install python-sphinx-argparse
fi
18 19 20 21 22 23 24 25 26 27 28 29

# Update pyromaths version
VERSION=`date +%y.%m`
echo "What is the current version number? (Default: ${VERSION})"
read touche
case "$touche" in
  "" )
  ;;
  * )
  VERSION="$touche"
  ;;
esac
30
echo "*** Update pyromaths version..."
31
sed -i "s/VERSION ?= .*/VERSION ?= ${VERSION}/" ${PYROPATH}/Makefile
32

33 34 35 36 37 38 39
# Clean-up and create Documentation
cd $PYROPATH/Doc
make clean
make doctest
make html

# Prepare Changelog
40
cd $PYROPATH
41 42 43 44 45
head -20 NEWS
dch -v ${VERSION}-1
dch -r

# Clean-up and create packages
46
make clean
47
make all
48
make repo
49 50 51 52 53

echo "*** Create Windows binary..."
echo "Hit 'enter' when Windows package is ready."
read touche

54 55 56 57 58
echo "*** Tag git develop ***"
echo "Do you want to commit and tag the git develop branch (o/N)?"
read touche
case "$touche" in
  [oO] )
59 60
  git commit -am 'Pyromaths Release'
  git tag -u B39EE5B6 version-${VERSION} -m "Pyromaths ${VERSION}"
61 62 63 64
  #git push --tags:
  ;;
esac

65
echo "*** Update pyromaths web-site links..."
66
cat > ${PYROPATH}/pyrosite.txt << EOF
67 68 69 70
:title: Version ${VERSION}
:date: $(date +"%Y-%m-%d %H:%M")
:category: telecharger
:description: Liens vers la version ${VERSION}
71

72 73 74 75 76
* |debian| `Pyromaths pour Linux - deb </telecharger/pyromaths_${VERSION}-1_all.deb>`_
* |redhat| `Pyromaths pour Linux - rpm </telecharger/pyromaths-${VERSION}-1.noarch.rpm>`_
* |macos| `Pyromaths pour Mac OS X </telecharger/pyromaths-${VERSION}-macos.dmg>`_
* |windows| `Pyromaths pour Windows </telecharger/pyromaths_${VERSION}.exe>`_
* |sources| `Sources de Pyromaths </telecharger/pyromaths-${VERSION}-sources.tar.bz2>`_
77

78 79 80 81 82 83 84 85 86 87
.. |debian| image:: images/debian.png
    :alt: Debian Linux
.. |redhat| image:: images/redhat.png
    :alt: RedHat Linux
.. |macos| image:: images/macosx.png
    :alt: Mac OS X
.. |windows| image:: images/winvista.png
    :alt: Windows
.. |sources| image:: images/source.png
    :alt: Sources
88

89 90
Nouveautés de cette version :
=============================
91 92

EOF