remove old todo when creating a release
[phpmyadmin/crack.git] / scripts / create-release.sh
blob171f461d7e445a08884c37bb2df86f60eb1cea81
1 #!/bin/sh
3 # $Id$
4 # vim: expandtab sw=4 ts=4 sts=4:
6 # 2005-09-13, lem9@users.sourceforge.net
7 # - no longer create a config.default.php from config.inc.php
9 # 2005-06-12, lem9@users.sourceforge.net
10 # - cvs server name changed to cvs, because cvs1 no longer works from
11 # shell.sourceforge.net
13 # 2003-08-23, nijel@users.sourceforge.net:
14 # - support for creating snapshots outside sourceforge:
15 # * cvs server name can be read from environment variable cvsserver
16 # * do not change to directories as used on sourceforge if $2 is local
18 # 2003-08-13, nijel@users.sourceforge.net:
19 # - config.default -> config.default.php
21 # 2004-08-09, lem9@users.sourceforge.net:
22 # - remember to create a new bug tracking group
24 # 2004-06-07 rabus@users.sourceforge.net
25 # - create backup config file
27 # 2004-04-29, lem9@users.sourceforge.net:
28 # - keep only the previous cvs directory created
30 # 2004-04-16, lem9@users.sourceforge.net:
31 # - daily snapshot when called with first parameter "snapshot"
32 # - remove directory used for the checkout
34 # 2003-11-18, nijel@users.sourceforge.net:
35 # - switch php3 -> php
37 # 2003-10-10, nijel@users.sourceforge.net:
38 # - cvsserver set on just one place to ease testing
39 # - echoes md5 sums to include on download page
41 # 2003-06-22, robbat2@users.sourceforge.net:
42 # - Moved to using updatedocs.sh for updating documentation
43 # - Make tarring faster by re-arranging ops
45 # 2003-01-17, rabus@users.sourceforge.net:
46 # - Changed the CVS hostname to cvs1 because cvs1.sourceforge.net is now blocked
47 # for the SF shell servers, too. Note: The script now works on the SF shell
48 # servers ONLY!
50 # 2002-11-22, rabus@users.sourceforge.net:
51 # - changed the CVS server dns to cvs1.sourceforge.net
52 # (cvs.phpmyadmin.sourceforge.net does not work at the SF shell anymore).
54 # 2002-10-03, rabus@users.sourceforge.net:
55 # - more detailed instructions
57 # 2002-09-08, robbat2@users.sourceforge.net:
58 # - Tweaked final instruction list
60 # 2002-06-17, lem9@users.sourceforge.net:
61 # - I option to tar for bzip2 is deprecated, use j
63 # 2002-27-04, loic@phpmyadmin.net:
64 # - added the cvs branch feature
66 # 2001-08-08, swix@users.sourceforge.net:
67 # - created script
68 # - added release todo list
71 KITS="all-languages-utf-8-only all-languages english"
72 COMPRESSIONS="zip-7z tbz tgz 7z"
74 if [ $# = 0 ]
75 then
76 echo "Usages:"
77 echo " create-release.sh <version> [from_branch]"
78 echo " create-release.sh snapshot [sf]"
79 echo " (no spaces allowed!)"
80 echo ""
81 echo "Examples:"
82 echo " create-release.sh 2.9.0-rc1 branches/QA_2_9"
83 echo " create-release.sh 2.9.0 tags/RELEASE_2_9_0"
84 exit 65
87 branch='trunk'
89 if [ "$1" = "snapshot" ] ; then
90 mode="snapshot"
91 date_snapshot=`date +%Y%m%d-%H%M%S`
92 target=$date_snapshot
93 else
94 if [ "$#" -ge 2 ] ; then
95 branch="$2"
97 target="$1"
98 cat <<END
100 Please ensure you have:
101 1. incremented rc count or version in subversion :
102 - in libraries/Config.class.php PMA_Config::__constructor() the line
103 " \$this->set( 'PMA_VERSION', '$1' ); "
104 - in Documentation.html the 2 lines
105 " <title>phpMyAdmin $1 - Documentation</title> "
106 " <h1>phpMyAdmin $1 Documentation</h1> "
107 - in translators.html
108 - in README
109 2. synchronized the language files:
110 cd lang
111 ./sync_lang.sh
112 and checked all language files are valid (use
113 the "./scripts/check_lang.php" script to do it).
115 Continue (y/n)?
117 read do_release
119 if [ "$do_release" != 'y' ]; then
120 exit
124 if [ "$mode" = "snapshot" -a "$2" = "sf" ] ; then
125 # Goto project dir
126 cd /home/groups/p/ph/phpmyadmin/htdocs
128 # Keep one previous version of the cvs directory
129 if [ -e svn-prev ] ; then
130 rm -rf svn-prev
132 mv svn svn-prev
135 # Do SVNcheckout
136 mkdir -p ./svn
137 cd svn
139 echo "Exporting repository from subversion"
141 svn export -q https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/$branch/phpMyAdmin
143 if [ $? -ne 0 ] ; then
144 echo "Subversion checkout failed, bailing out"
145 exit 2
148 # Cleanup release dir
149 LC_ALL=C date -u > phpMyAdmin/RELEASE-DATE-${target}
151 # Building Documentation.txt
152 LC_ALL=C w3m -dump phpMyAdmin/Documentation.html > phpMyAdmin/Documentation.txt
154 # Renaming directory
155 mv phpMyAdmin phpMyAdmin-$target
157 # Prepare all kits
158 for kit in $KITS ; do
159 # Copy all files
160 name=phpMyAdmin-$target-$kit
161 cp -r phpMyAdmin-$target $name
163 # Cleanup translations
164 cd phpMyAdmin-$target-$kit
165 scripts/lang-cleanup.sh $kit
166 cd ..
168 # Prepare distributions
169 for comp in $COMPRESSIONS ; do
170 case $comp in
171 tbz|tgz)
172 echo "Creating $name.tar"
173 tar cf $name.tar $name
174 if [ $comp = tbz ] ; then
175 echo "Creating $name.tar.bz2"
176 bzip2 -9k $name.tar
178 if [ $comp = tgz ] ; then
179 echo "Creating $name.tar.gz"
180 gzip -9c $name.tar > $name.tar.gz
182 rm $name.tar
184 zip)
185 echo "Creating $name.zip"
186 zip -q -9 -r $name.zip $name
188 zip-7z)
189 echo "Creating $name.zip"
190 7za a -bd -tzip $name.zip $name > /dev/null
193 echo "Creating $name.7z"
194 7za a -bd $name.7z $name > /dev/null
197 echo "WARNING: ignoring compression '$comp', not known!"
199 esac
200 done
202 # Remove directory with current dist set
203 rm -rf $name
204 done
206 # Cleanup
207 rm -rf phpMyAdmin-${target}
209 if [ "$mode" != "snapshot" ]
210 then
213 echo ""
214 echo ""
215 echo ""
216 echo "Files:"
217 echo "------"
219 ls -la *.gz *.zip *.bz2 *.7z
221 echo
222 echo "MD5 sums:"
223 echo "--------"
225 md5sum *.{gz,zip,bz2,7z} | sed "s/\([^ ]*\)[ ]*\([^ ]*\)/\$md5sum['\2'] = '\1';/"
227 echo
228 echo "Sizes:"
229 echo "------"
231 ls -l --block-size=k *.{gz,zip,bz2,7z} | sed -r "s/[a-z-]+[[:space:]]+[0-9]+[[:space:]]+[^[:space:]]+[[:space:]]+[^[:space:]]+[[:space:]]+([0-9]*)K.*[[:space:]]([^[:space:]]+)\$/\$size['\2'] = \1;/"
233 echo
234 echo "Add these to /home/groups/p/ph/phpmyadmin/htdocs/home_page/files.inc.php on sf"
236 cat <<END
239 Todo now:
240 ---------
241 1. tag the subversion tree with the new revision number for a plain release
242 or a release candidate:
243 version 2.7.0 gets two tags: RELEASE_2_7_0 and STABLE
244 version 2.7.1-rc1 gets RELEASE_2_7_1RC1 and TESTING
246 2. upload the files to SF:
247 ftp upload.sourceforge.net
248 cd incoming
249 binary
250 mput svn/*.gz *.zip *.bz2
251 3. add files to SF files page (cut and paste changelog since last release)
252 4. add SF news item to phpMyAdmin project
253 5. update web page:
254 - add MD5s and file sizes to /home/groups/p/ph/phpmyadmin/htdocs/home_page/includes/list_files.inc.php
255 - add release to /home/groups/p/ph/phpmyadmin/htdocs/home_page/includes/list_release.inc.php
256 6. announce release on freshmeat (http://freshmeat.net/projects/phpmyadmin/)
257 7. send a short mail (with list of major changes) to
258 phpmyadmin-devel@lists.sourceforge.net
259 phpmyadmin-news@lists.sourceforge.net
260 phpmyadmin-users@lists.sourceforge.net
262 Don't forget to update the Description section in the announcement,
263 based on Documentation.html.
265 8. increment rc count or version in subversion :
266 - in libraries/Config.class.php PMA_Config::__constructor() the line
267 " $this->set( 'PMA_VERSION', '2.7.1-dev' ); "
268 - in Documentation.html the 2 lines
269 " <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> "
270 " <h1>phpMyAdmin 2.2.2-rc1 Documentation</h1> "
271 - in translators.html
273 9. add a group for bug tracking this new version, at
274 https://sourceforge.net/tracker/admin/index.php?group_id=23067&atid=377408&add_group=1
276 10. the end :-)
282 # Removed due to not needed thanks to clever scripting by Robbat2
283 # 9. update the demo subdirectory:
284 # - in htdocs, cvs update phpMyAdmin
285 # - and don't forget to give write rights for the updated scripts to the
286 # whole group