3 #*************************************************************************
5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 # Copyright 2008 by Sun Microsystems, Inc.
9 # OpenOffice.org - a multi-platform office productivity suite
11 # $RCSfile: make_versioned.sh,v $
15 # This file is part of OpenOffice.org.
17 # OpenOffice.org is free software: you can redistribute it and/or modify
18 # it under the terms of the GNU Lesser General Public License version 3
19 # only, as published by the Free Software Foundation.
21 # OpenOffice.org is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU Lesser General Public License version 3 for more details
25 # (a copy is included in the LICENSE file that accompanied this code).
27 # You should have received a copy of the GNU Lesser General Public License
28 # version 3 along with OpenOffice.org. If not, see
29 # <http://www.openoffice.org/license.html>
30 # for a copy of the LGPLv3 License.
32 #*************************************************************************
35 # Uses openoffice.lst to create versioned files for Mac OS X
38 # version commands, similar to other OOo code
39 MAJOR
=`sed -n '/^OpenOffice$/,/^}$/ s/.*USERDIRPRODUCTVERSION //p' ../util/openoffice.lst`
40 MAJOR_MINOR
=`sed -n '/^OpenOffice$/,/PRODUCTVERSION/ s/.*PRODUCTVERSION //p' ../util/openoffice.lst`
41 MAJOR_MINOR_STEP
=`sed -n '/^OpenOffice$/,/^}$/ s/.*ABOUTBOXPRODUCTVERSION //p' ../util/openoffice.lst`
44 if [ -z "$1" -o -z "$2" ]; then
45 echo "ERROR: missing argument(s):";
47 echo "USAGE: $0 <source file> <target file>"
48 echo " <source file> File to be versioned"
49 echo " <target file> Path and filename where to put the versioned file"
53 if [ ! -e "$1" ]; then
54 echo "ERROR: source file not found"
58 TARGET_PATH
=`dirname "$2"`
59 mkdir
-p "$TARGET_PATH"
61 echo "make_versioned.sh: Using versions $MAJOR - $MAJOR_MINOR - $MAJOR_MINOR_STEP for $1, storing to $TARGET_PATH"
63 sed -e "s/\%USERDIRPRODUCTVERSION/${MAJOR}/g" "$1" | \
64 sed -e "s/\%PRODUCTVERSION/${MAJOR_MINOR}/g" | \
65 sed -e "s/\%ABOUTBOXPRODUCTVERSION/${MAJOR_MINOR_STEP}/g" >"$2"