2008-10-14 08:14:17 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2008-11-23 09:00:25 -05:00
|
|
|
###################### PARAMETERS ####################
|
2009-02-04 03:20:57 -05:00
|
|
|
version="0.4.12"
|
2008-10-14 08:45:05 -04:00
|
|
|
arch=`dpkg --print-architecture`
|
2008-11-23 09:00:25 -05:00
|
|
|
packager="Cyril Soler <csoler@users.sourceforge.net>"
|
|
|
|
######################################################
|
2008-10-14 08:14:17 -04:00
|
|
|
|
2009-01-04 08:22:23 -05:00
|
|
|
echo attempting to get svn revision number...
|
|
|
|
svn=`svn info | grep 'Revision:' | cut -d\ -f2`
|
|
|
|
echo done.
|
|
|
|
version="$version"."$svn"
|
2009-02-26 09:13:39 -05:00
|
|
|
pkgname=RetroShare_"$version"_ubuntu_"$arch".deb
|
|
|
|
|
2008-10-14 08:14:17 -04:00
|
|
|
echo Building retroshare debian package version $version for Ubuntu $arch.
|
|
|
|
echo Please check that:
|
|
|
|
echo " "- you have sudo access and that root has right to write in this directory and the subdirectories.
|
|
|
|
echo " "- you have compiled libretroshare and retroshare-gui in ../../libretroshare/src/
|
|
|
|
echo " "and ../../retroshare-gui/src/
|
|
|
|
echo " "- you have updated version numbers in ../../retroshare-gui/src/util/rsversion.cpp
|
|
|
|
echo " "and ../../retroshare-gui/src/retroshare.nsi
|
2009-02-26 09:13:39 -05:00
|
|
|
echo " "- version and name will be: $pkgname
|
2008-10-14 08:14:17 -04:00
|
|
|
|
|
|
|
if ! test `whoami` = "root" ; then
|
|
|
|
echo Please run this script as root.
|
|
|
|
echo
|
|
|
|
exit ;
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo Press [ENTER] when ok, else quit with Ctrl+C.
|
|
|
|
read tmp
|
|
|
|
|
2008-11-23 09:00:25 -05:00
|
|
|
echo
|
|
|
|
echo Unzipping...
|
2008-10-14 08:14:17 -04:00
|
|
|
tar zxvf retroshare.tgz
|
2008-11-23 09:00:25 -05:00
|
|
|
echo Changing ownership...
|
2008-10-14 08:14:17 -04:00
|
|
|
chown -R root.root retroshare
|
|
|
|
|
|
|
|
# setup version numbers and arch in DEBIAN/control
|
|
|
|
|
2008-11-23 09:00:25 -05:00
|
|
|
echo Setting up version numbers...
|
|
|
|
cat retroshare/DEBIAN/control | sed -e s/XXXXXX/"$version"/g | sed -e s/YYYYYY/"$arch"/g | sed -e s/ZZZZZZ/"$packager"/g > retroshare/DEBIAN/control.tmp
|
2008-10-14 08:14:17 -04:00
|
|
|
mv retroshare/DEBIAN/control.tmp retroshare/DEBIAN/control
|
|
|
|
|
|
|
|
# clean
|
|
|
|
find retroshare -name "*~" -exec \rm -f {} \;
|
|
|
|
|
|
|
|
# copy executables at the right place
|
|
|
|
if ! test -f ../../retroshare-gui/src/RetroShare; then
|
|
|
|
echo Can not find executable ../../retroshare-gui/src/RetroShare. Please fix this.
|
|
|
|
echo
|
|
|
|
exit ;
|
|
|
|
fi
|
2009-02-04 03:20:57 -05:00
|
|
|
if ! test -f ../../retroshare-nogui/src/retroshare-nogui; then
|
|
|
|
echo Can not find executable ../../retroshare-nogui/src/retroshare-nogui. Please fix this.
|
2008-10-14 08:14:17 -04:00
|
|
|
echo
|
|
|
|
exit ;
|
|
|
|
fi
|
2010-01-24 19:30:58 -05:00
|
|
|
|
2008-11-23 09:00:25 -05:00
|
|
|
echo Stripping executables...
|
2008-10-14 08:14:17 -04:00
|
|
|
cp ../../retroshare-gui/src/RetroShare retroshare/usr/bin/
|
2008-11-23 09:00:25 -05:00
|
|
|
strip retroshare/usr/bin/RetroShare
|
2009-02-04 03:20:57 -05:00
|
|
|
cp ../../retroshare-nogui/src/retroshare-nogui retroshare/usr/bin/
|
2008-11-23 09:00:25 -05:00
|
|
|
strip retroshare/usr/bin/retroshare-nogui
|
2008-10-14 08:14:17 -04:00
|
|
|
|
|
|
|
# compute md5 sums
|
2008-11-23 09:00:25 -05:00
|
|
|
echo Computing/setting md5 sums...
|
2008-10-14 08:14:17 -04:00
|
|
|
cd retroshare
|
|
|
|
find usr -type f -exec md5sum {} \; > DEBIAN/md5sums
|
|
|
|
cd ..
|
2009-02-26 09:13:39 -05:00
|
|
|
echo Creating package $pkgname
|
|
|
|
dpkg-deb -b retroshare $pkgname
|
2008-10-14 08:14:17 -04:00
|
|
|
|
|
|
|
# cleaning
|
2010-01-24 19:30:58 -05:00
|
|
|
echo Cleaning up...
|
2008-10-14 08:14:17 -04:00
|
|
|
\rm -rf retroshare
|
2008-11-23 09:00:25 -05:00
|
|
|
|
|
|
|
echo Done.
|