2010-06-15 13:07:29 +00:00
|
|
|
#!/bin/sh
|
2014-04-13 08:48:37 +00:00
|
|
|
# copyright (c) 2011-2014 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
|
|
|
|
EOF
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
# Default value
|
2014-04-13 08:48:37 +00:00
|
|
|
GIT_SHA1=0;
|
|
|
|
BRANCH="master"
|
2011-06-12 12:39:11 +00:00
|
|
|
while [ -n "$1" ]; do
|
|
|
|
case $1 in
|
2014-04-13 08:48:37 +00:00
|
|
|
-help|-h ) help;shift 1;;
|
|
|
|
-rev|-r ) GIT_SHA1=$2; shift 2;;
|
|
|
|
-branch|-b ) BRANCH=$2; shift 2;;
|
2011-06-12 12:39:11 +00:00
|
|
|
--) shift;break;;
|
|
|
|
-*) echo "ERROR: $1 option does not exists. Use -h for help";exit 1;;
|
|
|
|
*) break;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2010-06-15 13:07:29 +00:00
|
|
|
# Directory
|
2014-04-13 08:48:37 +00:00
|
|
|
TMP_DIR=/tmp/pcsx2_git
|
|
|
|
mkdir -p $TMP_DIR
|
|
|
|
|
|
|
|
REMOTE_REPO="https://github.com/PCSX2/pcsx2.git"
|
|
|
|
LOCAL_REPO="$TMP_DIR/pcsx2"
|
2010-06-15 13:07:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
2010-08-31 16:59:57 +00:00
|
|
|
# Basic functions
|
2010-06-15 13:07:29 +00:00
|
|
|
######################################################################
|
2014-04-13 08:48:37 +00:00
|
|
|
date=
|
|
|
|
version=
|
|
|
|
release=
|
|
|
|
get_pcsx2_version()
|
2010-06-15 13:07:29 +00:00
|
|
|
{
|
2014-04-13 08:48:37 +00:00
|
|
|
local major=`grep -o "VersionHi.*" $LOCAL_REPO/pcsx2/SysForwardDefs.h | grep -o "[0-9]*"`
|
|
|
|
local mid=`grep -o "VersionMid.*" $LOCAL_REPO/pcsx2/SysForwardDefs.h | grep -o "[0-9]*"`
|
|
|
|
local minor=`grep -o "VersionLo.*" $LOCAL_REPO/pcsx2/SysForwardDefs.h | grep -o "[0-9]*"`
|
|
|
|
release=`grep -o "isReleaseVersion.*" $LOCAL_REPO/pcsx2/SysForwardDefs.h | grep -o "[0-9]*"`
|
|
|
|
version="$major.$mid.$minor"
|
|
|
|
}
|
|
|
|
|
|
|
|
get_git_version()
|
|
|
|
{
|
|
|
|
date=`git -C $LOCAL_REPO show -s --format=%ci HEAD | sed -e 's/[\:\-]//g' -e 's/ /./' -e 's/ .*//'`
|
|
|
|
}
|
|
|
|
|
|
|
|
download_orig()
|
|
|
|
{
|
|
|
|
(cd $TMP_DIR && git clone --branch $1 $REMOTE_REPO pcsx2)
|
|
|
|
if [ "$SVN_CO_VERSION" = "1" ] ; then
|
|
|
|
(cd $TMP_DIR/pcsx2 && git checkout $GIT_SHA1)
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
remove_3rdparty()
|
|
|
|
{
|
|
|
|
echo "Remove 3rdparty code"
|
|
|
|
rm -fr $LOCAL_REPO/3rdparty
|
|
|
|
rm -fr $LOCAL_REPO/fps2bios
|
|
|
|
rm -fr $LOCAL_REPO/tools
|
2010-06-15 13:07:29 +00:00
|
|
|
}
|
|
|
|
|
2014-04-13 08:48:37 +00:00
|
|
|
remove_not_yet_free_plugin()
|
2010-06-15 13:07:29 +00:00
|
|
|
{
|
2014-04-13 08:48:37 +00:00
|
|
|
echo "Remove non free plugins"
|
|
|
|
# remove also deprecated plugins
|
2018-10-07 11:14:28 +00:00
|
|
|
for plugin in CDVDiso CDVDisoEFP CDVDlinuz CDVDolio CDVDpeops PeopsSPU2 SSSPSXPAD USBqemu xpad zerogs zerospu2
|
2014-04-13 08:48:37 +00:00
|
|
|
do
|
|
|
|
rm -fr $LOCAL_REPO/plugins/$plugin
|
2010-06-15 13:07:29 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2014-04-13 08:48:37 +00:00
|
|
|
remove_remaining_non_free_file()
|
|
|
|
{
|
|
|
|
echo "Remove remaining non free file. TODO UPSTREAM"
|
2015-11-12 09:37:12 +00:00
|
|
|
rm -fr $LOCAL_REPO/unfree
|
2014-04-13 08:48:37 +00:00
|
|
|
rm -fr $LOCAL_REPO/plugins/GSdx/baseclasses
|
|
|
|
rm -f $LOCAL_REPO/plugins/zzogl-pg/opengl/Win32/aviUtil.h
|
|
|
|
rm -f $LOCAL_REPO/common/src/Utilities/x86/MemcpyFast.cpp
|
|
|
|
}
|
|
|
|
remove_dot_git()
|
|
|
|
{
|
|
|
|
# To save 66% of the package size
|
|
|
|
rm -fr $LOCAL_REPO/.git
|
|
|
|
}
|
|
|
|
|
2010-06-15 13:07:29 +00:00
|
|
|
######################################################################
|
|
|
|
# Main script
|
|
|
|
######################################################################
|
2014-04-13 08:48:37 +00:00
|
|
|
download_orig $BRANCH
|
|
|
|
remove_3rdparty
|
|
|
|
remove_not_yet_free_plugin
|
|
|
|
remove_remaining_non_free_file
|
|
|
|
|
|
|
|
get_git_version
|
|
|
|
get_pcsx2_version
|
2010-06-15 13:07:29 +00:00
|
|
|
|
2014-04-13 08:48:37 +00:00
|
|
|
# must be done after getting the git version
|
|
|
|
remove_dot_git
|
|
|
|
|
|
|
|
# Debian name of package and tarball
|
|
|
|
if [ $release -eq 1 ]
|
|
|
|
then
|
|
|
|
PKG_NAME="pcsx2-${version}"
|
|
|
|
TAR_NAME="pcsx2_${version}.orig.tar"
|
|
|
|
else
|
|
|
|
PKG_NAME="pcsx2.snapshot-${version}~git${date}"
|
|
|
|
TAR_NAME="pcsx2.snapshot_${version}~git${date}.orig.tar"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
NEW_DIR=${TMP_DIR}/$PKG_NAME
|
2010-06-15 13:07:29 +00:00
|
|
|
rm -fr $NEW_DIR
|
2014-04-13 08:48:37 +00:00
|
|
|
mv $LOCAL_REPO $NEW_DIR
|
|
|
|
|
2010-08-31 16:59:57 +00:00
|
|
|
echo "Build the tar.gz file"
|
2014-04-13 08:48:37 +00:00
|
|
|
tar -C $TMP_DIR -cJf ${TAR_NAME}.xz $PKG_NAME
|
2010-06-15 13:07:29 +00:00
|
|
|
|
|
|
|
## Clean
|
2014-04-13 08:48:37 +00:00
|
|
|
rm -fr $TMP_DIR
|
|
|
|
|
|
|
|
exit 0
|