2010-06-15 13:07:29 +00:00
|
|
|
#!/bin/sh
|
2011-08-12 19:22:06 +00:00
|
|
|
# copyright (c) 2011 Gregory Hainaut
|
2010-07-10 12:37:18 +00:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2010-08-31 16:59:57 +00:00
|
|
|
#
|
2010-07-10 12:37:18 +00:00
|
|
|
# This package is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Lesser General Public License for more details.
|
2010-08-31 16:59:57 +00:00
|
|
|
#
|
2010-07-10 12:37:18 +00:00
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
2010-06-15 13:07:29 +00:00
|
|
|
|
|
|
|
######################################################################
|
2010-08-31 16:59:57 +00:00
|
|
|
# Global Parameters
|
2010-06-15 13:07:29 +00:00
|
|
|
######################################################################
|
2011-06-12 12:39:11 +00:00
|
|
|
help()
|
|
|
|
{
|
|
|
|
cat <<EOF
|
|
|
|
Help:
|
|
|
|
-rev <rev> : revision number
|
|
|
|
-branch <name> : branch name, take trunk otherwise
|
|
|
|
-local : download the svn repository into $HOME/.cache (not deleted by the script)
|
|
|
|
EOF
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
# Default value
|
|
|
|
SVN_CO_VERSION=0;
|
|
|
|
BRANCH="trunk"
|
|
|
|
LOCAL=0
|
|
|
|
while [ -n "$1" ]; do
|
|
|
|
case $1 in
|
|
|
|
-help|-h) help;shift 1;;
|
|
|
|
-rev|-r) SVN_CO_VERSION=$2; shift 2;;
|
2011-08-14 14:38:26 +00:00
|
|
|
-branch|-b) BRANCH=$2; shift 2;;
|
2011-06-12 12:39:11 +00:00
|
|
|
-local|-l) LOCAL=1;shift 1;;
|
|
|
|
--) shift;break;;
|
|
|
|
-*) echo "ERROR: $1 option does not exists. Use -h for help";exit 1;;
|
|
|
|
*) break;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$SVN_CO_VERSION" = "0" ] ; then
|
|
|
|
help
|
2010-06-15 13:07:29 +00:00
|
|
|
fi
|
2011-06-12 12:39:11 +00:00
|
|
|
|
|
|
|
if [ "$BRANCH" = "trunk" ] ; then
|
2010-08-30 20:32:59 +00:00
|
|
|
SVN_TRUNK="http://pcsx2.googlecode.com/svn/trunk"
|
2011-06-12 12:39:11 +00:00
|
|
|
else
|
|
|
|
SVN_TRUNK="http://pcsx2.googlecode.com/svn/branches/$BRANCH"
|
2010-08-30 20:32:59 +00:00
|
|
|
fi
|
2010-06-15 13:07:29 +00:00
|
|
|
|
|
|
|
# Debian name of package and tarball
|
|
|
|
PKG_NAME="pcsx2.snapshot-${SVN_CO_VERSION}"
|
|
|
|
TAR_NAME="pcsx2.snapshot_${SVN_CO_VERSION}.orig.tar"
|
|
|
|
|
|
|
|
# Directory
|
|
|
|
TMP_DIR=/tmp
|
2011-06-12 12:39:11 +00:00
|
|
|
if [ "$LOCAL" = 1 ] ; then
|
|
|
|
ROOT_DIR=${HOME}/.cache/svn_pcsx2__${BRANCH}
|
|
|
|
else
|
|
|
|
ROOT_DIR=${TMP_DIR}/subversion_pcsx2_${SVN_CO_VERSION}
|
|
|
|
fi
|
2010-06-15 13:07:29 +00:00
|
|
|
NEW_DIR=${TMP_DIR}/$PKG_NAME
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
2010-08-31 16:59:57 +00:00
|
|
|
# Basic functions
|
2010-06-15 13:07:29 +00:00
|
|
|
######################################################################
|
|
|
|
get_svn_dir()
|
|
|
|
{
|
|
|
|
for directory in $* ; do
|
|
|
|
# Print the directory without /
|
|
|
|
echo " $directory" | sed -e 's/\//\ /g'
|
|
|
|
if [ -e `basename ${directory}` ] ; then
|
|
|
|
# Directory already exist so only update
|
|
|
|
svn up --quiet ${SVN_TRUNK}/${directory} -r $SVN_CO_VERSION;
|
|
|
|
else
|
|
|
|
svn co --quiet ${SVN_TRUNK}/${directory} -r $SVN_CO_VERSION;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
get_svn_file()
|
|
|
|
{
|
|
|
|
for file in $* ; do
|
2011-06-12 12:39:11 +00:00
|
|
|
# Versioning information is not supported for a single file
|
|
|
|
# therefore you can't use svn co
|
|
|
|
svn export --quiet ${SVN_TRUNK}/${file} -r $SVN_CO_VERSION;
|
2010-06-15 13:07:29 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Main script
|
|
|
|
######################################################################
|
|
|
|
|
2010-08-31 16:59:57 +00:00
|
|
|
## Download the svn repository (only the useful things)
|
|
|
|
echo "Downloading pcsx2 source revision ${SVN_CO_VERSION}"
|
2010-06-15 13:07:29 +00:00
|
|
|
mkdir -p $ROOT_DIR;
|
|
|
|
(cd $ROOT_DIR;
|
|
|
|
get_svn_file CMakeLists.txt;
|
2012-05-11 20:21:44 +00:00
|
|
|
get_svn_dir common cmake locales pcsx2;
|
2011-09-04 20:39:19 +00:00
|
|
|
get_svn_dir debian-unstable-upstream linux_various;
|
2010-06-15 13:07:29 +00:00
|
|
|
echo "Done")
|
|
|
|
|
2011-08-12 19:22:06 +00:00
|
|
|
# separate bin to avoid downloading the .mo file
|
|
|
|
mkdir -p $ROOT_DIR/bin;
|
|
|
|
(cd $ROOT_DIR/bin;
|
|
|
|
get_svn_file bin/GameIndex.dbf;
|
|
|
|
get_svn_dir bin/docs;)
|
|
|
|
|
2011-08-14 14:38:26 +00:00
|
|
|
echo "Downloading Linux compatible plugins for revision ${SVN_CO_VERSION}"
|
2010-08-31 16:59:57 +00:00
|
|
|
# Note: Other plugins exist but they are not 100% copyright free.
|
2010-06-15 13:07:29 +00:00
|
|
|
mkdir -p $ROOT_DIR/plugins
|
|
|
|
(cd $ROOT_DIR/plugins;
|
|
|
|
get_svn_file plugins/CMakeLists.txt;
|
2010-07-08 19:03:55 +00:00
|
|
|
get_svn_dir plugins/CDVDnull;
|
2011-08-14 14:38:26 +00:00
|
|
|
# Potential copyright issue. Optional anyway
|
2010-07-08 19:03:55 +00:00
|
|
|
# get_svn_dir plugins/CDVDnull plugins/CDVDiso;
|
2012-06-02 08:01:04 +00:00
|
|
|
get_svn_dir plugins/onepad;
|
|
|
|
get_svn_dir plugins/spu2-x;
|
|
|
|
get_svn_dir plugins/zzogl-pg plugins/zzogl-pg-cg plugins/GSdx;
|
2010-06-15 13:07:29 +00:00
|
|
|
get_svn_dir plugins/dev9null plugins/FWnull plugins/USBnull;
|
|
|
|
echo "Note: some plugins are more or less deprecated CDVDisoEFP, CDVDlinuz, Zerogs, Zeropad ...";
|
|
|
|
echo "Done")
|
|
|
|
|
2011-08-12 19:22:06 +00:00
|
|
|
## Download the internal sdl 1.3 for gsdx
|
2012-05-11 20:21:44 +00:00
|
|
|
# echo "Downloading 3rdpary SDL 1.3 (need by gsdx) revision ${SVN_CO_VERSION}"
|
|
|
|
# mkdir -p $ROOT_DIR/3rdparty
|
|
|
|
# (cd $ROOT_DIR/3rdparty/;
|
|
|
|
# get_svn_file 3rdparty/CMakeLists.txt;
|
|
|
|
# get_svn_dir 3rdparty/SDL-1.3.0-5387;)
|
|
|
|
# echo "Done"
|
2011-08-12 19:22:06 +00:00
|
|
|
|
|
|
|
|
2010-06-15 13:07:29 +00:00
|
|
|
## Installation
|
2010-08-31 16:59:57 +00:00
|
|
|
echo "Copy the subversion repository to a temporary directory"
|
2010-06-15 13:07:29 +00:00
|
|
|
# Copy the dir
|
|
|
|
rm -fr $NEW_DIR
|
|
|
|
cp -r $ROOT_DIR $NEW_DIR
|
|
|
|
|
2010-08-31 16:59:57 +00:00
|
|
|
echo "Remove .svn directories"
|
2010-06-15 13:07:29 +00:00
|
|
|
find $NEW_DIR -name ".svn" -type d -exec rm -fr {} \; 2> /dev/null
|
2011-08-14 14:38:26 +00:00
|
|
|
echo "Remove windows files (useless & copyright issues)"
|
2010-08-30 20:32:59 +00:00
|
|
|
find $NEW_DIR -iname "windows" -type d -exec rm -fr {} \; 2> /dev/null
|
|
|
|
find $NEW_DIR -name "Win32" -type d -exec rm -fr {} \; 2> /dev/null
|
2010-07-05 12:10:15 +00:00
|
|
|
rm -fr "${NEW_DIR}/plugins/zzogl-pg/opengl/Win32"
|
2010-07-08 19:03:55 +00:00
|
|
|
rm -fr "${NEW_DIR}/common/vsprops"
|
2010-08-31 16:59:57 +00:00
|
|
|
echo "Remove useless files (copyright issues)"
|
2010-10-09 11:37:41 +00:00
|
|
|
rm -fr "${NEW_DIR}/plugins/zzogl-pg/opengl/ZeroGSShaders"
|
2010-07-08 19:03:55 +00:00
|
|
|
rm -fr "${NEW_DIR}/common/src/Utilities/x86/MemcpyFast.cpp"
|
2011-08-12 19:22:06 +00:00
|
|
|
rm -fr "${NEW_DIR}/plugins/GSdx/baseclasses"
|
|
|
|
rm -fr "${NEW_DIR}/plugins/GSdx/vtune"
|
2010-06-15 13:07:29 +00:00
|
|
|
|
|
|
|
## BUILD
|
2010-08-31 16:59:57 +00:00
|
|
|
echo "Build the tar.gz file"
|
2010-08-30 20:32:59 +00:00
|
|
|
tar -C $TMP_DIR -czf ${TAR_NAME}.gz $PKG_NAME
|
2010-06-15 13:07:29 +00:00
|
|
|
|
|
|
|
## Clean
|
|
|
|
rm -fr $NEW_DIR
|
2011-06-12 12:39:11 +00:00
|
|
|
if [ "$LOCAL" = 0 ] ; then
|
|
|
|
rm -fr $ROOT_DIR
|
|
|
|
fi
|