3 # PEL: PHP Exif Library. A library with support for reading and
4 # writing all Exif headers in JPEG and TIFF images using PHP.
6 # Copyright (C) 2004, 2005, 2006 Martin Geisler.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program in the file COPYING; if not, write to the
20 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 # Boston, MA 02110-1301 USA
26 # This small script retrieves the latest version of PEL, packs it up
27 # into two tarballs (gz and bz2) and a zip file, and then asks for
28 # permission to upload these files to SourceForge. The generated
29 # files are placed in the current directory.
32 # Fix the locale to C, e.g. untranslated.
37 BUILD_BASE="build-base.$$"
42 # Create the base directory for the build or bail out if it already
44 if [[ -d $BUILD_BASE ]]; then
45 echo "The build directory $BUILD_BASE already exists!"
48 echo "Building the release in $BUILD_BASE"
55 echo -n "Exporting trunk from SourceForge... "
56 svn export https://pel.svn.sourceforge.net/svnroot/pel/trunk pel || exit
59 # Grab version number from ChangeLog...
61 MIDDLE='[0-9]+\.[0-9]+(\.[0-9]+(-[0-9a-z]+)?)?'
62 DATE=$(date -u '+%B %-d.. %Y')
63 REGEXP="$PREFIX $MIDDLE $DATE"
65 OFFSET=$(grep -n -E -m 1 "$REGEXP" pel/NEWS | cut -d ':' -f 1)
66 if [[ -z $OFFSET ]]; then
67 echo "Found no version from today in NEWS, creating SVN version."
68 VERSION='svn' #$(date -u '+svn-%Y-%m-%d')
70 echo "Offset: $OFFSET"
71 VERSION=$(head -n $OFFSET pel/NEWS | tail -n 1 | cut -d ' ' -f 3)
72 echo "Found match for today in NEWS: $VERSION."
74 LINE=$(head -n $OFFSET pel/NEWS | tail -n 1)
75 STARS=$(head -n $((OFFSET+1)) pel/NEWS | tail -n 1)
76 if [[ ${#LINE} != ${#STARS} ]]; then
77 echo "Aborting because of bad underlining:"
87 if [[ $VERSION == "svn" ]]; then
88 echo "Skipping tagging since this is a SVN snapshot."
90 read -p "Create SVN tag? [y/N] " -n 1
93 if [[ $REPLY == "y" ]]; then
94 echo -n "Creating SVN tag 'pel-$VERSION'... "
96 https://pel.svn.sourceforge.net/svnroot/pel/trunk \
97 https://pel.svn.sourceforge.net/svnroot/pel/tags/pel-$VERSION \
98 -m "Tagging PEL version $VERSION."
101 echo "Skipping tagging by user request."
107 # Generate the ChangeLog, prefixed with a standard header
108 echo -n "Generating SVN ChangeLog... "
109 echo "ChangeLog file for PEL: PHP Exif Library. A library with support for
110 reading and writing Exif headers in JPEG and TIFF images using PHP.
112 Copyright (C) 2004, 2005, 2006 Martin Geisler.
113 Licensed under the GNU GPL, see COPYING for details.
116 svn2cl --include-rev --group-by-day --separate-daylogs \
117 --reparagraph --authors=authors.xml --stdout \
118 https://pel.svn.sourceforge.net/svnroot/pel/trunk/ >> ChangeLog || exit
122 #echo -n "Marking releases in ChangeLog... "
123 #sed -re '/./{H;$!d;};x;/tags/s|tags/pel-([0-9]+\.[0-9]+).*|PEL Version \1|'
127 # Generate the binary MO files
131 # Generate the API documentation
132 ./run-phpdoc.sh $VERSION $PHPDOC_PATH
135 # Cleanup files that aren't needed in the released package
136 rm make-release.sh authors.xml
140 # Add anchors and headers to the HTML ChangeLog so that each release
141 # notices can link back to it
143 #sed -i -re 's|^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2} tag release-([0-9])_([0-9])$|</pre>\n\n<div align="center"><h2 id="v\1.\2">PEL Version \1.\2</h2></div>\n\n<pre>\n|g' doc/ric_ChangeLog.html
145 # Leave the pel-$VERSION directory
148 mv pel-$VERSION/test/image-tests image-tests
150 echo -n "Creating pel-image-tests-$VERSION.tar.gz... "
151 tar -cz image-tests -f pel-image-tests-$VERSION.tar.gz
154 echo -n "Creating pel-image-tests-$VERSION.tar.bz2... "
155 tar -cj image-tests -f pel-image-tests-$VERSION.tar.bz2
158 echo -n "Creating pel-images-$VERSION.zip... "
159 zip -qr pel-image-tests-$VERSION.zip image-tests
162 echo -n "Creating pel-$VERSION.tar.gz... "
163 tar -cz pel-$VERSION -f pel-$VERSION.tar.gz
166 echo -n "Creating pel-$VERSION.tar.bz2... "
167 tar -cj pel-$VERSION -f pel-$VERSION.tar.bz2
170 echo -n "Creating pel-$VERSION.zip... "
171 zip -qr pel-$VERSION.zip pel-$VERSION
175 # Upload the compressed files and API documentation, if allowed
176 if [[ $VERSION != "svn" && ( $REPLY == "y" || $REPLY == "Y" ) ]]; then
177 echo -n "Uploading files to SourceForge for release... "
178 ncftpput upload.sourceforge.net /incoming \
179 pel-$VERSION.tar.gz \
180 pel-$VERSION.tar.bz2 \
182 pel-image-tests-$VERSION.tar.gz \
183 pel-image-tests-$VERSION.tar.bz2 \
184 pel-image-tests-$VERSION.zip
187 echo -n "Uploading API documentation to SourceForge... "
188 scp -C -q -r pel-$VERSION/doc \
189 shell.sourceforge.net:/home/groups/p/pe/pel/htdocs
192 echo "Skipping upload."
195 echo "All done. The $BUILD_BASE directory can be removed at any time."
197 # The End --- PEL has now been packaged (and maybe even released)!