Rev Author Line No. Line
250 kaklik 1 #!/bin/sh
2 #
3 # $Id: create-release.sh,v 2.18.2.2 2006/03/16 22:44:05 nijel Exp $
4 #
5 # 2005-09-13, lem9@users.sourceforge.net
6 # - no longer create a config.default.php from config.inc.php
7 #
8 # 2005-06-12, lem9@users.sourceforge.net
9 # - cvs server name changed to cvs, because cvs1 no longer works from
10 # shell.sourceforge.net
11 #
12 # 2003-08-23, nijel@users.sourceforge.net:
13 # - support for creating snapshots outside sourceforge:
14 # * cvs server name can be read from environment variable cvsserver
15 # * do not change to directories as used on sourceforge if $2 is local
16 #
17 # 2003-08-13, nijel@users.sourceforge.net:
18 # - config.default -> config.default.php
19 #
20 # 2004-08-09, lem9@users.sourceforge.net:
21 # - remember to create a new bug tracking group
22 #
23 # 2004-06-07 rabus@users.sourceforge.net
24 # - create backup config file
25 #
26 # 2004-04-29, lem9@users.sourceforge.net:
27 # - keep only the previous cvs directory created
28 #
29 # 2004-04-16, lem9@users.sourceforge.net:
30 # - daily snapshot when called with first parameter "snapshot"
31 # - remove directory used for the checkout
32 #
33 # 2003-11-18, nijel@users.sourceforge.net:
34 # - switch php3 -> php
35 #
36 # 2003-10-10, nijel@users.sourceforge.net:
37 # - cvsserver set on just one place to ease testing
38 # - echoes md5 sums to include on download page
39 #
40 # 2003-06-22, robbat2@users.sourceforge.net:
41 # - Moved to using updatedocs.sh for updating documentation
42 # - Make tarring faster by re-arranging ops
43 #
44 # 2003-01-17, rabus@users.sourceforge.net:
45 # - Changed the CVS hostname to cvs1 because cvs1.sourceforge.net is now blocked
46 # for the SF shell servers, too. Note: The script now works on the SF shell
47 # servers ONLY!
48 #
49 # 2002-11-22, rabus@users.sourceforge.net:
50 # - changed the CVS server dns to cvs1.sourceforge.net
51 # (cvs.phpmyadmin.sourceforge.net does not work at the SF shell anymore).
52 #
53 # 2002-10-03, rabus@users.sourceforge.net:
54 # - more detailed instructions
55 #
56 # 2002-09-08, robbat2@users.sourceforge.net:
57 # - Tweaked final instruction list
58 #
59 # 2002-06-17, lem9@users.sourceforge.net:
60 # - I option to tar for bzip2 is deprecated, use j
61 #
62 # 2002-27-04, loic@phpmyadmin.net:
63 # - added the cvs branch feature
64 #
65 # 2001-08-08, swix@users.sourceforge.net:
66 # - created script
67 # - added release todo list
68 #
69  
70 cvsserver=${cvsserver:-cvs}
71  
72 if [ $# = 0 ]
73 then
74 echo "Usage: create-release.sh version from_branch"
75 echo " (no spaces allowed!)"
76 echo ""
77 echo "Example: create-release.sh 2.2.7-rc1 v2_2_7-branch"
78 exit 65
79 fi
80  
81 if [ "$1" = "snapshot" ]
82 then
83 branch=''
84 elif [ "$#" = 2 ]
85 then
86 branch="-r $2"
87 fi
88  
89 if [ $1 = "snapshot" ]
90 then
91 mode="snapshot"
92 date_snapshot=`date +%Y%m%d-%H%M%S`
93 fi
94  
95 # Set target name
96 if [ "$mode" != "snapshot" ]
97 then
98 target=$1
99 else
100 target=$date_snapshot
101 fi
102  
103  
104 if [ "$mode" != "snapshot" ]
105 then
106  
107 cat <<END
108  
109 Please ensure you have:
110 1. incremented rc count or version in CVS :
111 - in libraries/Config.class.php PMA_Config::__constructor() the line
112 " $this->set( 'PMA_VERSION', '2.7.1-dev' ); "
113 - in Documentation.html the 2 lines
114 " <title>phpMyAdmin $1 - Documentation</title> "
115 " <h1>phpMyAdmin $1 Documentation</h1> "
116 - in translators.html
117 - in README
118 2. synchronized the language files:
119 cd lang
120 ./sync_lang.sh
121 and checked all language files are valid (use
122 the "./scripts/check_lang.php" script to do it).
123  
124 Continue (y/n)?
125 END
126 printf "\a"
127 read do_release
128  
129 if [ "$do_release" != 'y' ]; then
130 exit
131 fi
132 fi
133  
134 if [ "$mode" = "snapshot" -a "$2" != "local" ] ; then
135 # Goto project dir
136 cd /home/groups/p/ph/phpmyadmin/htdocs
137  
138 ## Move old cvs dir
139 #if [ -e cvs ];
140 #then
141 # mv cvs cvs-`date +%s`
142 #fi
143  
144 # Keep one previous version of the cvs directory
145 if [ -e cvs-prev ];
146 then
147 rm -rf cvs-prev
148 fi
149 mv cvs cvs-prev
150 fi
151  
152 # Do CVS checkout
153 mkdir cvs
154 cd cvs
155  
156 if [ "$mode" != "snapshot" ]
157 then
158 echo "Press [ENTER]!"
159 cvs -q -d:pserver:anonymous@$cvsserver:/cvsroot/phpmyadmin login
160 if [ $? -ne 0 ] ; then
161 echo "CVS login failed, bailing out"
162 exit 1
163 fi
164 fi
165  
166 cvs -q -z3 -d:pserver:anonymous@$cvsserver:/cvsroot/phpmyadmin co -P $branch phpMyAdmin
167  
168 if [ $? -ne 0 ] ; then
169 echo "CVS checkout failed, bailing out"
170 exit 2
171 fi
172  
173 # Cleanup release dir
174 LC_ALL=C date -u > phpMyAdmin/RELEASE-DATE-${target}
175  
176 # Olivier asked to keep those in the cvs release, to allow testers to use
177 # cvs update on it
178 if [ "$mode" != "snapshot" ]
179 then
180 find phpMyAdmin \( -name .cvsignore -o -name CVS \) -print0 | xargs -0 rm -rf
181 fi
182  
183 find phpMyAdmin -type d -print0 | xargs -0 chmod 755
184 find phpMyAdmin -type f -print0 | xargs -0 chmod 644
185 find phpMyAdmin \( -name '*.sh' -o -name '*.pl' \) -print0 | xargs -0 chmod 755
186  
187 # Building Documentation.txt
188 LC_ALL=C w3m -dump phpMyAdmin/Documentation.html > phpMyAdmin/Documentation.txt
189  
190 # Renaming directory
191 mv phpMyAdmin phpMyAdmin-$target
192  
193 # Building distribution kits
194 zip -9 -r phpMyAdmin-${target}.zip phpMyAdmin-${target}
195 tar cvf phpMyAdmin-${target}.tar phpMyAdmin-${target}
196 bzip2 -9kv phpMyAdmin-${target}.tar
197 gzip -9v phpMyAdmin-${target}.tar
198  
199 # Cleanup
200 rm -rf phpMyAdmin-${target}
201  
202 if [ "$mode" != "snapshot" ]
203 then
204  
205  
206 echo ""
207 echo ""
208 echo ""
209 echo "Files:"
210 echo "------"
211  
212 ls -la *.gz *.zip *.bz2
213  
214 echo
215 echo "MD5 sums:"
216 echo "--------"
217  
218 md5sum *.{gz,zip,bz2} | sed "s/\([^ ]*\)[ ]*\([^ ]*\)/\$md5sum['\2'] = '\1';/"
219  
220 echo
221 echo "Sizes:"
222 echo "------"
223  
224 ls -l --block-size=k *.{gz,zip,bz2} | sed -r "s/[a-z-]+[[:space:]]+[0-9]+[[:space:]]+[^[:space:]]+[[:space:]]+[^[:space:]]+[[:space:]]+([0-9]*)K.*[[:space:]]([^[:space:]]+)\$/\$size['\2'] = \1;/"
225  
226 echo
227 echo "Add these to /home/groups/p/ph/phpmyadmin/htdocs/home_page/files.inc.php on sf"
228  
229 cat <<END
230  
231  
232 Todo now:
233 ---------
234 1. tag the cvs tree with the new revision number for a plain release or a
235 release candidate:
236 version 2.7.0 gets two tags: RELEASE_2_7_0 and STABLE
237 version 2.7.1-rc1 gets RELEASE_2_7_1RC1 and TESTING
238  
239 2. upload the files to SF:
240 ftp upload.sourceforge.net
241 cd incoming
242 binary
243 mput cvs/*.gz *.zip *.bz2
244 3. add files to SF files page (cut and paste changelog since last release)
245 4. add SF news item to phpMyAdmin project
246 5. update web page:
247 - add MD5s and file sizes to /home/groups/p/ph/phpmyadmin/htdocs/home_page/includes/list_files.inc.php
248 - add release to /home/groups/p/ph/phpmyadmin/htdocs/home_page/includes/list_release.inc.php
249 6. announce release on freshmeat (http://freshmeat.net/projects/phpmyadmin/)
250 7. send a short mail (with list of major changes) to
251 phpmyadmin-devel@lists.sourceforge.net
252 phpmyadmin-news@lists.sourceforge.net
253 phpmyadmin-users@lists.sourceforge.net
254  
255 Don't forget to update the Description section in the announcement,
256 based on Documentation.html.
257  
258 8. increment rc count or version in CVS :
259 - in libraries/Config.class.php PMA_Config::__constructor() the line
260 " $this->set( 'PMA_VERSION', '2.7.1-dev' ); "
261 - in Documentation.html the 2 lines
262 " <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> "
263 " <h1>phpMyAdmin 2.2.2-rc1 Documentation</h1> "
264 - in translators.html
265  
266 9. add a group for bug tracking this new version, at
267 https://sourceforge.net/tracker/admin/index.php?group_id=23067&atid=377408&add_group=1
268  
269 10. the end :-)
270  
271 END
272  
273 fi
274  
275 if [ "$mode" = "snapshot" -a "$2" != "local" ] ; then
276 cd ..
277 find cvs -type d -print0 | xargs -0 chmod 775
278 find cvs -type f -print0 | xargs -0 chmod 664
279 fi
280  
281 # Removed due to not needed thanks to clever scripting by Robbat2
282 # 9. update the demo subdirectory:
283 # - in htdocs, cvs update phpMyAdmin
284 # - and don't forget to give write rights for the updated scripts to the
285 # whole group