/[pcsx2_0.9.7]/trunk/debian-unstable-upstream/create_pcsx2_tarball_from_svn_repository.sh
ViewVC logotype

Contents of /trunk/debian-unstable-upstream/create_pcsx2_tarball_from_svn_repository.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62 - (show annotations) (download) (as text)
Tue Sep 7 11:08:22 2010 UTC (9 years, 5 months ago) by william
File MIME type: application/x-sh
File size: 5077 byte(s)
Auto Commited Import of: pcsx2-0.9.7-r3738-debug in ./trunk
1 #!/bin/sh
2 # copyright (c) 2010 Gregory Hainaut
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU Lesser General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This package is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16
17
18 ######################################################################
19 # Global Parameters
20 ######################################################################
21 # Svn parameter
22 if [ -n "$1" ] ; then
23 SVN_CO_VERSION=$1;
24 else
25 echo "Please provide the subversion revision number as the first parameter"
26 exit 1;
27 fi
28 if [ -n "$2" ] ; then
29 # Use branch argument
30 SVN_TRUNK="http://pcsx2.googlecode.com/svn/branches/$2"
31 else
32 # by default take the trunk
33 SVN_TRUNK="http://pcsx2.googlecode.com/svn/trunk"
34 fi
35
36 # Debian name of package and tarball
37 PKG_NAME="pcsx2.snapshot-${SVN_CO_VERSION}"
38 TAR_NAME="pcsx2.snapshot_${SVN_CO_VERSION}.orig.tar"
39
40 # Directory
41 TMP_DIR=/tmp
42 ROOT_DIR=${TMP_DIR}/subversion_pcsx2_${SVN_CO_VERSION}
43 NEW_DIR=${TMP_DIR}/$PKG_NAME
44
45
46 ######################################################################
47 # Basic functions
48 ######################################################################
49 get_svn_dir()
50 {
51 for directory in $* ; do
52 # Print the directory without /
53 echo " $directory" | sed -e 's/\//\ /g'
54 if [ -e `basename ${directory}` ] ; then
55 # Directory already exist so only update
56 svn up --quiet ${SVN_TRUNK}/${directory} -r $SVN_CO_VERSION;
57 else
58 svn co --quiet ${SVN_TRUNK}/${directory} -r $SVN_CO_VERSION;
59 fi
60 done
61 }
62
63 get_svn_file()
64 {
65 for file in $* ; do
66 if [ ! -e `basename ${file}` ] ; then
67 # Versioning information is not supported for a single file
68 # therefore you can't use svn co
69 svn export --quiet ${SVN_TRUNK}/${file} -r $SVN_CO_VERSION;
70 fi
71 done
72 }
73
74 ######################################################################
75 # Main script
76 ######################################################################
77
78 ## Download the svn repository (only the useful things)
79 echo "Downloading pcsx2 source revision ${SVN_CO_VERSION}"
80 mkdir -p $ROOT_DIR;
81 (cd $ROOT_DIR;
82 get_svn_file CMakeLists.txt;
83 get_svn_dir bin common cmake pcsx2 tools;
84 get_svn_dir debian-unstable-upstream;
85 echo "Done")
86
87 echo "Downloading Linux compatible plugins for revision ${SVN_CO_VERSION}"
88 # Note: Other plugins exist but they are not 100% copyright free.
89 mkdir -p $ROOT_DIR/plugins
90 (cd $ROOT_DIR/plugins;
91 get_svn_file plugins/CMakeLists.txt;
92 # DVD
93 get_svn_dir plugins/CDVDnull;
94 # Copyright issue
95 # get_svn_dir plugins/CDVDnull plugins/CDVDiso;
96 # PAD
97 get_svn_dir plugins/PadNull plugins/onepad;
98 # AUDIO
99 get_svn_dir plugins/SPU2null plugins/spu2-x plugins/zerospu2;
100 # Graphics
101 get_svn_dir plugins/GSnull plugins/zzogl-pg;
102 # Misc
103 get_svn_dir plugins/dev9null plugins/FWnull plugins/USBnull;
104 echo "Note: some plugins are more or less deprecated CDVDisoEFP, CDVDlinuz, Zerogs, Zeropad ...";
105 echo "Done")
106
107 ## Installation
108 echo "Copy the subversion repository to a temporary directory"
109 # Copy the dir
110 rm -fr $NEW_DIR
111 cp -r $ROOT_DIR $NEW_DIR
112
113 echo "Remove .svn directories"
114 find $NEW_DIR -name ".svn" -type d -exec rm -fr {} \; 2> /dev/null
115 echo "Remove old build system (scripts and autotools)"
116 find $NEW_DIR -name "build.sh" -exec rm -f {} \;
117 find $NEW_DIR -name "install-sh" -exec rm -f {} \;
118 find $NEW_DIR -name "depcomp" -exec rm -f {} \;
119 find $NEW_DIR -name "missing" -exec rm -f {} \;
120 find $NEW_DIR -name "aclocal.m4" -exec rm -f {} \;
121 find $NEW_DIR -name "configure.ac" -exec rm -f {} \;
122 find $NEW_DIR -name "Makefile.am" -exec rm -f {} \;
123 echo "Remove 3rd party directories"
124 find $NEW_DIR -name "3rdparty" -exec rm -fr {} \; 2> /dev/null
125 # I really need to clean this mess one day
126 # echo "Remove plugins/zzogl-pg/opengl/ZeroGSShaders (some zlib source in the middle)"
127 # rm -fr $NEW_DIR/plugins/zzogl-pg/opengl/ZeroGSShaders
128 echo "Remove windows file (useless & copyright issue)"
129 find $NEW_DIR -iname "windows" -type d -exec rm -fr {} \; 2> /dev/null
130 find $NEW_DIR -name "Win32" -type d -exec rm -fr {} \; 2> /dev/null
131 rm -fr "${NEW_DIR}/plugins/zzogl-pg/opengl/Win32"
132 rm -fr "${NEW_DIR}/tools/GSDumpGUI"
133 rm -fr "${NEW_DIR}/common/vsprops"
134 echo "Remove useless files (copyright issues)"
135 rm -fr "${NEW_DIR}/plugins/zzogl-pg/opengl/ZeroGSShaders/zlib"
136 rm -fr "${NEW_DIR}/common/src/Utilities/x86/MemcpyFast.cpp"
137
138 ## BUILD
139 echo "Build the tar.gz file"
140 tar -C $TMP_DIR -czf ${TAR_NAME}.gz $PKG_NAME
141
142 ## Clean
143 rm -fr $NEW_DIR
144 rm -fr $ROOT_DIR

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.22