Fix link.
[phpmyadmin/crack.git] / scripts / create-release.sh
blobd7189eed211a6eec3213e502e370488886ab2aee
1 #!/bin/sh
3 # $Id$
4 # vim: expandtab sw=4 ts=4 sts=4:
7 KITS="all-languages english"
8 COMPRESSIONS="zip-7z tbz tgz 7z"
10 if [ $# = 0 ]
11 then
12 echo "Usages:"
13 echo " create-release.sh <version> [from_branch]"
14 echo " create-release.sh snapshot [sf]"
15 echo " (no spaces allowed!)"
16 echo ""
17 echo "Examples:"
18 echo " create-release.sh 2.9.0-rc1 branches/QA_2_9"
19 echo " create-release.sh 2.9.0 tags/RELEASE_2_9_0"
20 exit 65
23 branch='trunk'
25 if [ "$1" = "snapshot" ] ; then
26 mode="snapshot"
27 date_snapshot=`date +%Y%m%d-%H%M%S`
28 target=$date_snapshot
29 else
30 if [ "$#" -ge 2 ] ; then
31 branch="$2"
33 target="$1"
34 cat <<END
36 Please ensure you have:
37 1. incremented rc count or version in subversion :
38 - in libraries/Config.class.php PMA_Config::__constructor() the line
39 " \$this->set( 'PMA_VERSION', '$1' ); "
40 - in Documentation.html the 2 lines
41 " <title>phpMyAdmin $1 - Documentation</title> "
42 " <h1>phpMyAdmin $1 Documentation</h1> "
43 - in translators.html
44 - in README
45 2. checked that all language files are valid (use
46 the "./scripts/check_lang.php" script to do it).
48 Continue (y/n)?
49 END
50 read do_release
52 if [ "$do_release" != 'y' ]; then
53 exit
57 if [ "$mode" = "snapshot" -a "$2" = "sf" ] ; then
58 # Goto project dir
59 cd /home/groups/p/ph/phpmyadmin/htdocs
61 # Keep one previous version of the cvs directory
62 if [ -e svn-prev ] ; then
63 rm -rf svn-prev
65 mv svn svn-prev
68 # Do SVNcheckout
69 mkdir -p ./svn
70 cd svn
72 echo "Exporting repository from subversion"
74 svn export -q https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/$branch/phpMyAdmin
76 if [ $? -ne 0 ] ; then
77 echo "Subversion checkout failed, bailing out"
78 exit 2
81 # Cleanup release dir
82 LC_ALL=C date -u > phpMyAdmin/RELEASE-DATE-${target}
84 # Building Documentation.txt
85 LC_ALL=C w3m -dump phpMyAdmin/Documentation.html > phpMyAdmin/Documentation.txt
87 # Remove test directory from package to avoid Path disclosure messages
88 # if someone runs /test/wui.php and there are test failures
89 rm -rf phpMyAdmin/test
91 # Renaming directory
92 mv phpMyAdmin phpMyAdmin-$target
94 # Prepare all kits
95 for kit in $KITS ; do
96 # Copy all files
97 name=phpMyAdmin-$target-$kit
98 cp -r phpMyAdmin-$target $name
100 # Cleanup translations
101 cd phpMyAdmin-$target-$kit
102 scripts/lang-cleanup.sh $kit
103 cd ..
105 # Prepare distributions
106 for comp in $COMPRESSIONS ; do
107 case $comp in
108 tbz|tgz)
109 echo "Creating $name.tar"
110 tar cf $name.tar $name
111 if [ $comp = tbz ] ; then
112 echo "Creating $name.tar.bz2"
113 bzip2 -9k $name.tar
115 if [ $comp = tgz ] ; then
116 echo "Creating $name.tar.gz"
117 gzip -9c $name.tar > $name.tar.gz
119 rm $name.tar
121 zip)
122 echo "Creating $name.zip"
123 zip -q -9 -r $name.zip $name
125 zip-7z)
126 echo "Creating $name.zip"
127 7za a -bd -tzip $name.zip $name > /dev/null
130 echo "Creating $name.7z"
131 7za a -bd $name.7z $name > /dev/null
134 echo "WARNING: ignoring compression '$comp', not known!"
136 esac
137 done
139 # Remove directory with current dist set
140 rm -rf $name
141 done
143 # Cleanup
144 rm -rf phpMyAdmin-${target}
146 if [ "$mode" != "snapshot" ]
147 then
150 echo ""
151 echo ""
152 echo ""
153 echo "Files:"
154 echo "------"
156 ls -la *.gz *.zip *.bz2 *.7z
158 echo
159 echo "MD5 sums:"
160 echo "--------"
162 md5sum *.{gz,zip,bz2,7z} | sed "s/\([^ ]*\)[ ]*\([^ ]*\)/md5sum['\2'] = '\1'/"
164 echo
165 echo "Add these to website/data/md5sums.py in SVN"
167 cat <<END
170 Todo now:
171 ---------
172 1. tag the subversion tree with the new revision number for a plain release
173 or a release candidate:
174 version 2.7.0 gets two tags: RELEASE_2_7_0 and STABLE
175 version 2.7.1-rc1 gets RELEASE_2_7_1RC1 and TESTING
177 2. upload the files to SF (procedure explained on the sf.net Admin/File Releases page)
178 3. add files to SF files page (cut and paste changelog since last release)
179 4. add SF news item to phpMyAdmin project
180 5. update web page:
181 - add MD5s to website/data/md5sums.py in SVN
182 6. announce release on freshmeat (http://freshmeat.net/projects/phpmyadmin/)
183 7. send a short mail (with list of major changes) to
184 phpmyadmin-devel@lists.sourceforge.net
185 phpmyadmin-news@lists.sourceforge.net
186 phpmyadmin-users@lists.sourceforge.net
188 Don't forget to update the Description section in the announcement,
189 based on Documentation.html.
191 8. increment rc count or version in subversion :
192 - in libraries/Config.class.php PMA_Config::__constructor() the line
193 " $this->set( 'PMA_VERSION', '2.7.1-dev' ); "
194 - in Documentation.html the 2 lines
195 " <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> "
196 " <h1>phpMyAdmin 2.2.2-rc1 Documentation</h1> "
197 - in translators.html
199 9. add a group for bug tracking this new version, at
200 https://sourceforge.net/tracker/admin/index.php?group_id=23067&atid=377408&add_group=1
202 10. the end :-)
208 # Removed due to not needed thanks to clever scripting by Robbat2
209 # 9. update the demo subdirectory:
210 # - in htdocs, cvs update phpMyAdmin
211 # - and don't forget to give write rights for the updated scripts to the
212 # whole group