source: stable/20170000/bin/package.sh @ 3866

Last change on this file since 3866 was 3866, checked in by bradbell, 3 years ago

merge to branch: stable/20170000
from repository: https://github.com/coin-or/CppAD
start hash code: be5942014af74c220dc1ed7ba397599cc48a7282
end hash code: 0201594a22c035232289215f8095c7ae308d194b

commit 0201594a22c035232289215f8095c7ae308d194b
Author: Brad Bell <bradbell@…>
Date: Thu Jan 19 04:59:07 2017 -0700

stable/20170000 branch:
package.sh: suppress runing doxygen; see d505fac90a987
ad_tape.hpp: fix problem with Visual C++2015; see issue 17.
check_copyright.sh: change date for changes from 2016 -> 2017.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1#! /bin/bash -e
2# -----------------------------------------------------------------------------
3# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
4#
5# CppAD is distributed under multiple licenses. This distribution is under
6# the terms of the
7#                     Eclipse Public License Version 1.0.
8#
9# A copy of this license is included in the COPYING file of this distribution.
10# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
11# -----------------------------------------------------------------------------
12if [ $0 != "bin/package.sh" ]
13then
14        echo "bin/package.sh: must be executed from its parent directory"
15        exit 1
16fi
17echo_log_eval() {
18        echo $*
19        echo $* >> $top_srcdir/package.log
20        if ! eval $* >> $top_srcdir/package.log
21        then
22                echo "Error: check package.log"
23                exit 1
24        fi
25}
26log_eval() {
27        echo $* >> $top_srcdir/package.log
28        if ! eval $* >> $top_srcdir/package.log
29        then
30                echo "Error: check package.log"
31                exit 1
32        fi
33}
34if [ -e package.log ]
35then
36        echo "rm package.log"
37        rm package.log
38fi
39top_srcdir=`pwd`
40# ----------------------------------------------------------------------------
41this_license=`\
42        grep '$verbatim%' omh/license.omh | sed -e 's|$verbatim%\(...\).*|\1|'`
43if [ "$this_license" == 'epl' ]
44then
45        remove_list='gpl-3.0.txt bin/gpl_license.sh'
46elif [ "$this_license" == 'gpl' ]
47then
48        remove_list='epl-v10.txt epl-v10.html bin/gpl_license.sh'
49else
50        echo 'bin/package.sh: cannot find license in omh/license.omh'
51        exit 1
52fi
53# ----------------------------------------------------------------------------
54# Make sure version is set correctly
55#
56# if this is the master, set version to today
57branch=`git branch | grep '^\*' | sed -e 's|^\* *||'`
58if [ "$branch" == 'master' ]
59then
60        bin/version.sh set
61fi
62# make sure that version number is the same in all files
63echo_log_eval bin/version.sh check
64#
65# Get version number and make sure all copies agree
66version=`bin/version.sh get`
67echo_log_eval bin/version.sh get
68# ----------------------------------------------------------------------------
69# Run automated checks for the form bin/check_*.sh with a few exceptions.
70# New version of doxygen yields errors in 20170000 source (so comment out)
71list=`ls bin/check_* | sed \
72        -e '/check_all.sh/d' \
73        -e '/check_jenkins.sh/d' \
74        -e '/check_doxygen.sh/d' \
75        -e '/check_svn_dist.sh/d'`
76for check in $list
77do
78        echo_log_eval $check
79done
80# ----------------------------------------------------------------------------
81# Check for doxygen errors
82# New version of doxygen yields errors in 20170000 source (so comment out)
83# echo_log_eval bin/run_doxygen.sh
84# ----------------------------------------------------------------------------
85# Create the package directory
86package_dir="build/cppad-$version"
87if [ -e "$package_dir" ]
88then
89        echo_log_eval rm -r $package_dir
90fi
91for lic in epl gpl
92do
93        if [ -e "$package_dir.epl.tgz" ]
94        then
95                echo_log_eval rm $package_dir.$lic.tgz
96        fi
97done
98echo_log_eval mkdir -p $package_dir
99# -----------------------------------------------------------------------------
100# Source file that are coppied to the package directory
101file_list=`bin/ls_files.sh`
102#
103# Copy the files, creating sub-directories when necessary
104echo_log_eval echo "copy files to $package_dir"
105for file in $file_list $other_files
106do
107        sub_dir=`echo $file | sed -e 's|\(.*\)/[^/]*$|\1|'`
108        if [ "$sub_dir" != "$file" ]
109        then
110                if [ ! -e "$package_dir/$sub_dir" ]
111                then
112                        log_eval mkdir -p $package_dir/$sub_dir
113                fi
114        fi
115        log_eval cp $file $package_dir/$file
116done
117echo_log_eval echo "remove certain files from $package_dir"
118for file in $remove_list
119do
120        if [ -e $package_dir/$file ]
121        then
122                echo_log_eval rm $package_dir/$file
123        fi
124done
125# ----------------------------------------------------------------------------
126# build the xml version of documentation for this distribution
127echo_log_eval cd $package_dir
128#
129# Only include the *.xml verison of the documentation in distribution
130# So remove the table at the top (but save the original doc.omh file).
131if ! grep < doc.omh > /dev/null \
132        'This comment is used to remove the table below'
133then
134        echo "Missing comment expected in doc.omh"
135        exit 1
136fi
137echo_log_eval echo "sed -i.save doc.omh ..."
138sed -i.save doc.omh \
139        -e '/This comment is used to remove the table below/,/$tend/d'
140#
141# This command creates omhelp.xml.log in current directory (and says so)
142echo_log_eval echo "bin/run_omhelp.sh xml"
143if ! bin/run_omhelp.sh xml
144then
145        echo_log_eval cp omhelp.xml.log $top_srcdir/omhelp.xml.log
146        exit 1
147fi
148# Copy the log to the directory where the package.sh command was executed
149echo_log_eval cp omhelp.xml.log $top_srcdir/omhelp.xml.log
150# Restore the original doc.omh
151echo_log_eval mv doc.omh.save doc.omh
152# ----------------------------------------------------------------------------
153# change back to the package parent directory and create the tarball
154echo_log_eval cd ..
155echo_log_eval tar -czf cppad-$version.$this_license.tgz cppad-$version
156# ----------------------------------------------------------------------------
157# create gpl version of package
158echo_log_eval cd $top_srcdir
159if [ -e 'bin/gpl_license.sh' ]
160then
161        if [ "$this_license" != 'epl' ]
162        then
163                echo 'package.sh: bin/gpl_license.sh found in gpl verison of source.'
164                exit 1
165        fi
166        echo_log_eval bin/gpl_license.sh cppad-$version build build
167fi
168# ----------------------------------------------------------------------------
169echo "$0: OK"
170exit 0
Note: See TracBrowser for help on using the repository browser.