#!/bin/sh
#
# gptg: general-project-template-generator
# Copyright (C) 2001/2002/2003 karsten reincke
#
# a script to generate
# (a) the file and directory-structure
# which is nescessary to use the gnu automake / autoconfigure tools
# while
# (b) inserting the wished company-license (not only the gnu-gpl) and
# (c) including a c resp. c++ template-sourcefile-kit which
# is already compilable.
#
# This file is part of of the software-project GTGT.
#
# GTGT is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# GTGT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# file version <#3.0.0#> of project
VERSION="<#3.0.0#>"
# =============================
# == Usage related functions ==
# =============================
function toCapitalized
{
local WORD=$1
local FL
local RL
FL=`perl -e '$STRING=$ARGV[0];$STRING=~/^(.)/;print $1;exit' $WORD`
FL=`echo "$FL" | tr [:lower:] [:upper:]`
RL=`perl -e '$STRING=$ARGV[0];$STRING=~/^(.)(.*)/;print $2;exit' $WORD`
echo "$FL$RL"
}
function toLower
{
local VAR=`echo "$1" | tr [:upper:] [:lower:]`
echo $VAR
}
function toUpper
{
local VAR=`echo "$1" | tr [:lower:] [:upper:]`
echo $VAR
}
function usage
{
cat << EOF
Creates directory tree for new software package.
Usage: gptg OPTIONS [PROJECT] [RELEASE] [REVISION]
OPTIONS :-
-h, --help This message
-v, --version Version information
-cpp Language C++, uses the LF macros
-c Language C, uses traditional autoconf macros
PROJECT :- projectname [myproject]
RELEASE :- start-release-number [0]
REVISION :- start-release-branch-number [1]
repsect the following conditions ...
(a) PROJECT should be a small identifier without blanks or any other seperators.
(b) use numbers (integers) for RELEASE and REVISION think release-number as
main-version-number and revision-number as programming-step-number
or simply follow cvs-terminology. do not use rational numbers
(whished number "1.4" must be: "release 1 revision 4")
... or your work might fail. there is (still) no input-check.
Bug reports: karsten@reincke.org
EOF
}
function version
{
cat << EOF
gptg $VERSION - general packet-template generator -
generates directory tree for new software package
Copyright (C) 2000,2001,2002,2003 karsten reincke
This file is part of of the software-project GTGT.
GTGT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GTGT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
EOF
}
function get_copyright_data
{
gcng -ecl
AUT_NAME="$(cat gcng.conf | head -1 | tail -1)"
AUT_EMAIL="$(cat gcng.conf | head -2 | tail -1)"
AUT_YEAR="$(cat gcng.conf | head -3 | tail -1)"
COMPANY="$(cat gcng.conf | head -4 | tail -1)"
COMP_SHORT_COPYRIGHT_NOTE="$(cat gcng.conf | head -5 | tail -1)"
COMP_LONG_COPYRIGHT_NOTE="$(cat gcng.conf | head -6 | tail -1)"
COMP_LONG_COPYRIGHT_NOTE=`eval echo $COMP_LONG_COPYRIGHT_NOTE`
COMP_SHORT_COPYRIGHT_NOTE=`eval echo $COMP_SHORT_COPYRIGHT_NOTE`
}
# =========================================
# == Make the standard information files ==
# =========================================
# ---------------------------------------------------
# This function creates a template NEWS file in the
# present working directory.
# ---------------------------------------------------
function make_NEWS
{
cat >> NEWS < -- History of visible changes.
`gcng -ecl ${PROJECT}`
Please send ${PROJECT} bug reports to ${AUT_EMAIL}.
-------------------------------------------------------
`gcng -ech ${PROJECT}`
Please see the file COPYING for details.
-------------------------------------------------------
`date -I` : generating the default project-development-template
EOF
}
# ----------------------------------------------------
# This function creates a template README file in the
# present working directory
# ----------------------------------------------------
function make_README
{
cat >> README <
`gcng -ecl ${PROJECT}`
-------------------------------------------------------
`gcng -ech ${PROJECT}`
Please see the file COPYING for details.
-------------------------------------------------------
For documentation, please see the files in the doc subdirectory.
For building and installation instructions please see the INSTALL file.
EOF
}
# -------------------------------------------------------
# This function creates a template AUTHORS file in the
# present working directory
# -------------------------------------------------------
function make_AUTHORS
{
cat >> AUTHORS <
`gcng -ecl ${PROJECT}`
-------------------------------------------------------
`gcng -ech ${PROJECT}`
Please see the file COPYING for details.
-------------------------------------------------------
Authors of the project ${PROJECT}.
(See also the files THANKS and ChangeLog.)
${AUT_NAME} <${AUT_EMAIL}>:
--> initiator of ${PROJECT}.
EOF
}
# --------------------------------------------------------
# This function creates the template THANKS file in the
# present working directory
# --------------------------------------------------------
function make_THANKS
{
cat >> THANKS <
`gcng -ecl ${PROJECT}`
-------------------------------------------------------
`gcng -ech ${PROJECT}`
Please see the file COPYING for details.
-------------------------------------------------------
${PROJECT} THANKS file
The project ${PROJECT} has originally been initiated by ${AUT_NAME}.
Many people have further contributed to ${PROJECT} by reporting problems,
suggesting various improvements, or submitting actual code. Here is
a list of these people. Help me keep it complete and exempt of errors.
EOF
}
function make_ChangeLog
{
cat >> ChangeLog < -- ChangeLog
`gcng -ecl ${PROJECT}`
-------------------------------------------------------
`gcng -ech ${PROJECT}`
Please see the file COPYING for details.
-------------------------------------------------------
`date -I` : generating the default project-development-template
EOF
}
function make_doclevel_makefile
{
echo "updating Makefile.am for directory doc"
cat >>Makefile.am << EOF
${PROJECT}_helpdir = \$(datadir)/doc/${project}/
${PROJECT}_help_DATA = ${project}_index.html
EXTRA_DIST = ${project}_index.html
EOF
}
function make_htmldoc
{
cat >> ${project}_index.html << EOF
${PROJECT} - documentation
${PROJECT} - documentation
(0) content
- general purpose
- involved applications
- installation-conditions
- general remarks
- special hints for the use (handbook)
copyright (c) ${AUT_YEAR} ${AUTNAME} ${AUT_EMAIL}
- ???
- ... does ...
EOF
}
function make_scriptlevel_makefile
{
echo "updating Makefile.am for directory scripts"
cat >>Makefile.am << EOF
bin_SCRIPTS = ${project}.sh
#CLEANFILES = \$(bin_SCRIPTS)
EXTRA_DIST = ${project}.sh
${project}.sh:
chmod ugo+x ${project}.sh
EOF
}
function make_bashscript
{
cat >> ${project}.sh << EOF
`gcng -sh ${PROJECT} ${project}.sh ${RELEASE}`
echo "hello from ${project}.sh release <#${RELEASE}#>"
EOF
}
# ---------------------------------------------------------------
# This function creates a Makefile for an m4 subdirectory
# and provides also a copy of mkm4.pl in case the user wants it
# FIXME: Do I want a better way of dealing with this?
# ---------------------------------------------------------------
function make_m4_makefile
{
cat >> Makefile.am <> configure.in <> Makefile.am <> Makefile.am <> Makefile.am < ${project}.cc <
#endif
#include
#include "${simoname}.h"
#include <${damoname}.h>
#include <${librname}.h>
using namespace std;
using namespace gtgt;
int main (int argn, char * argv[])
{
${Simoname} sisterModuleObject1;
${Simoname} sisterModuleObject2(1,2);
${Damoname} daughterModuleObject1;
${Damoname} daughterModuleObject2(1,2);
${Librname} libraryModuleObject1;
${Librname} libraryModuleObject2(1,2);
cout << "hello from main of package ${PROJECT}" << endl;
return 0;
}
EOF
}
# (1.D.3) src-level-sister-module-file for c++
function make_simolevel_module_cpp
{
echo "creating sister-module (mode cpp)"
# (1.D.3.1) fill header-file
cat >> ${simoname}.h << EOF
`gscg -cpp -i ${Simoname} ${PROJECT} ${RELEASE}`
EOF
# (1.D.3.2) fill source-file
cat > ${simoname}.cc << EOF
`gscg -cpp -s ${Simoname} ${PROJECT} ${RELEASE}`
EOF
}
# (1.D.4) dmod-level-makefile for daughter-module
function make_damolevel_makefile_cpp
{
echo "updating Makefile.am for daughtermodule (mode cpp)"
cat >> Makefile.am <> ${damoname}.h << EOF
`gscg -cpp -i ${Damoname} ${PROJECT} ${RELEASE}`
EOF
# (1.D.5.2) fill source-file
cat > ${damoname}.cc << EOF
`gscg -cpp -s ${Damoname} ${PROJECT} ${RELEASE}`
EOF
}
# (1.E.1) lib-level-makefile for libraries
function make_liblevel_makefile_cpp
{
echo "updating lib-Makefile.am for directory lib (mode cpp)"
cat >> Makefile.am << EOF
#EXTRA_DIST
#SUBDIRS
AM_CXXFLAGS = -DLinux -Wall -ansi -pedantic
#AM_CXXFLAGS = -DLinux -Wall -ansi -pedantic -DXOPEN_SOURCE=500
#AM_CXXFLAGS = -DLinux -Wall -ansi -pedantic -g
#AM_CXXFLAGS = -DLinux -Wall -ansi -pedantic -O3
#AM_CXXFLAGS = -DLinux -Wall -ansi -pedantic -g -pg
include_HEADERS = ${librname}.h
#lib_LIBRARIES = lib${librname}.a
#lib${librname}_a_SOURCES = ${librname}.cc ${librname}.h
lib_LTLIBRARIES = lib${librname}.la
lib${librname}_la_SOURCES = ${librname}.cc ${librname}.h
lib${librname}_la_LDFLAGS = -version-info ${LIBRELEASE}
EOF
}
#(1.E.2.a) statical linkable library c++
function make_liblevel_statlib_cpp
{
echo "creating static-library (mode cpp)"
# (1.E.2.a.I) fill header-file
cat > ${librname}.h << EOF
`gscg -cpp -i ${Librname} ${PROJECT} ${RELEASE}`
EOF
# (1.E.2.a.II) fill source-file
cat > ${librname}.cc << EOF
`gscg -cpp -c ${Librname} ${PROJECT} ${RELEASE}`
EOF
}
#(1.F.1) write reconfiguration-file for c++
function make_reconf_cpp
{
echo "creating reconfiguration-file"
cat >> reconf < acconfig.h
cat >> acconfig.h <> configure.in <> Makefile.am <> Makefile.am <> Makefile.am <> ${project}.c <
#endif
#include
#include
#include "${simoname}.h"
#include <${damoname}.h>
#include <${librname}.h>
int main (int argn, char * argv[])
{
int sister_module_object_1,
sister_module_object_2,
daughter_module_object_1,
daughter_module_object_2,
library_module_object_1,
library_module_object_2;
sister_module_object_1=init_${simoname}_object();
sister_module_object_2=init_${simoname}_object();
daughter_module_object_1=init_${damoname}_object();
daughter_module_object_2=init_${damoname}_object();
library_module_object_1=init_${librname}_object();
library_module_object_2=init_${librname}_object();
printf("hello from main of package ${PROJECT}\n");
delete_${simoname}_object(sister_module_object_1);
delete_${simoname}_object(sister_module_object_2);
delete_${damoname}_object(daughter_module_object_1);
delete_${damoname}_object(daughter_module_object_2);
delete_${librname}_object(library_module_object_1);
delete_${librname}_object(library_module_object_2);
return 0;
}
EOF
}
# (2.D.3) src-level-sister-module-file for c++
function make_simolevel_module_c
{
echo "creating sister-module (mode cpp)"
# (2.D.3.1) fill header-file
cat >> ${simoname}.h << EOF
`gscg -c -i ${Simoname} ${PROJECT} ${RELEASE}`
EOF
# (2.D.3.2) fill source-file
cat > ${simoname}.c << EOF
`gscg -c -s ${Simoname} ${PROJECT} ${RELEASE}`
EOF
}
# (2.D.4) dmod-level-makefile for daughter-module
function make_damolevel_makefile_c
{
echo "updating Makefile.am for daughtermodule (mode c)"
cat >> Makefile.am <> ${damoname}.h << EOF
`gscg -c -i ${Damoname} ${PROJECT} ${RELEASE}`
EOF
# (2.D.5.2) fill source-file
cat > ${damoname}.c << EOF
`gscg -c -s ${Damoname} ${PROJECT} ${RELEASE}`
EOF
}
# (2.E.1) lib-level-makefile for libraries
function make_liblevel_makefile_c
{
echo "updating lib-Makefile.am for directory lib (mode c)"
cat >> Makefile.am << EOF
#EXTRA_DIST
#SUBDIRS
AM_CFLAGS = -DLinux -Wall -ansi -pedantic
#AM_CFLAGS = -DLinux -Wall -ansi -pedantic -DXOPEN_SOURCE=500
#AM_CFLAGS = -DLinux -Wall -ansi -pedantic -g
#AM_CFLAGS = -DLinux -Wall -ansi -pedantic -O3
#AM_CFLAGS = -DLinux -Wall -ansi -pedantic -g -pg
include_HEADERS = ${librname}.h
#lib_LIBRARIES = lib${librname}.a
#lib${librname}_a_SOURCES = ${librname}.c ${librname}.h
lib_LTLIBRARIES = lib${librname}.la
lib${librname}_la_SOURCES = ${librname}.c ${librname}.h
lib${librname}_la_LDFLAGS = -version-info ${LIBRELEASE}
EOF
}
#(2.E.2.a) statical linkable library c++
function make_liblevel_statlib_c
{
echo "creating static-library (mode c)"
# (2.E.2.a.I) fill header-file
cat > ${librname}.h << EOF
`gscg -c -i ${Librname} ${PROJECT} ${RELEASE}`
EOF
# (2.E.2.a.II) fill source-file
cat > ${librname}.c << EOF
`gscg -c -s ${Librname} ${PROJECT} ${RELEASE}`
EOF
}
#(2.F.1) write reconfiguration-file for c
function make_reconf_c
{
cat >> reconf < acconfig.h
cat >> acconfig.h </dev/null
echo "integrating project-specific file- and name-structure into file $DOXYFILE"
echo "/^PROJECT_NAME / s/^.*/PROJECT_NAME = ${PROJECT}/" > $SP
echo "/^PROJECT_NUMBER / s/^.*/PROJECT_NUMBER = ${RELEASE}/" > $SR
echo "/^OUTPUT_DIRECTORY / s/^.*/OUTPUT_DIRECTORY = ${DOUTPDIR}/" > $SO
echo "/^INPUT / s/^.*/INPUT = src lib /" > $SI
echo "/^FILE_PATTERNS / s/^.*/FILE_PATTERNS = *.cc *.h *c /" > $SF
echo "/^RECURSIVE / s/^.*/RECURSIVE = YES /" > $SD
sed -f $SP -f $SR -f $SO -f $SI -f $SF -f $SD $DOXYFILE > $DTMPFILE
rm $SP
rm $SR
rm $SO
rm $SI
rm $SF
rm $SD
mv $DTMPFILE $DOXYFILE
echo calling doxgen
doxygen $DOXYFILE
}
function write_prj_spec
{
if [ $COMPANY = "GNU" ];
then
LICENCESTRING="GPL/LGPL"
else
LICENCESTRING="Special Compay Licence"
fi
gcng -shS ${PROJECT} ${PRJSPECFILE} ${RELEASE} > ${PRJSPECFILE}
cat >> ${PRJSPECFILE} <> $PREPCLEARREPCOMMITFILE < .cvsignore
echo "Makefile" >> .cvsignore
echo "*.la" >> .cvsignore
echo "*.lo" >> .cvsignore
echo "*.o" >> .cvsignore
echo ".libs" >> .cvsignore
echo ".deps" >> .cvsignore
if [ -e .svn ];
then
svn propset svn:ignore -F .cvsignore .;
fi
)
done
echo "COPYING" > .cvsignore
echo "INSTALL" >> .cvsignore
echo "config.guess" >> .cvsignore
echo "config.sub" >> .cvsignore
echo "install-sh" >> .cvsignore
echo "ltmain.sh" >> .cvsignore
echo "ltconfig" >> .cvsignore
echo "missing" >> .cvsignore
echo "mkinstalldirs" >> .cvsignore
echo "aclocal.m4" >> .cvsignore
echo "configure" >> .cvsignore
echo "Makefile.in" >> .cvsignore
echo "Makefile" >> .cvsignore
echo "stamp-h" >> .cvsignore
echo "config.h" >> .cvsignore
echo "config.log" >> .cvsignore
echo "config.status" >> .cvsignore
echo "libtool" >> .cvsignore
if [ -e .svn ];
then
svn propset svn:ignore -F .cvsignore .;
fi
EOF
chmod u+x $PREPCLEARREPCOMMITFILE
}
function write_chrefile
{
cat > $CHREFILE <
# This file is part of of the software-project ${PROJECT}.
#
# ${PROJECT} is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# file version <#3.0.0#> of project
# change the following 6 variables with respect to this pattern
# version-number is RELEASE.REVISION.STEP
OLDRELEASE=${RELE} # defines a release and a library interface
OLDREVISION=${BRAN} # defines a more important revision of a release
OLDSTEP=${STEP} # defines a lowlevel revesion of a release
# (doesn't concern libraries
OLDLIBAGE=0 # indicates how many of the elder
# library-releases offer the same interface
NEWRELEASE=${RELE}
NEWREVISION=${INCRBRAN}
NEWSTEP=${STEP}
NEWLIBAGE=0
#---------------------------------------------------------------------------------
# change the following 6 variables only if you know the revision system of libtool
OLDLIBTOOLCURRENT="\${OLDRELEASE}"
OLDLIBTOOLREVISION="\${OLDREVISION}"
OLDLIBTOOLAGE="\${OLDLIBAGE}"
NEWLIBTOOLCURRENT="\${NEWRELEASE}"
NEWLIBTOOLREVISION="\${NEWREVISION}"
NEWLIBTOOLAGE="\${NEWLIBAGE}"
#################################################################################
# don't change the following lines !
OLDVERSION="\${OLDRELEASE}\.\${OLDREVISION}\.\${OLDSTEP}"
OLDLIBVERSION="\${OLDLIBTOOLCURRENT}\:\${OLDLIBTOOLREVISION}\:\${OLDLIBTOOLAGE}"
NEWVERSION="\${NEWRELEASE}\.\${NEWREVISION}\.\${NEWSTEP}"
NEWLIBVERSION="\${NEWLIBTOOLCURRENT}\:\${NEWLIBTOOLREVISION}\:\${NEWLIBTOOLAGE}"
if [ \$# = 0 -o "\$1" = "-h" -o "\$1" = "--help" ]
then
echo "script for changing recursively all revision- and branchnumbers"
echo "usage: ${CHREFILE} [ -h | --help | * | FILENAME ... ]"
echo "for inserting old and new numbers please edit ${CHREFILE}"
exit
fi
while [ ! -z \$1 ];
do
if [ -d \$1 -o -L \$1 ]
then
if [ -d \$1 ]
then
cp ${CHREFILE} \$1/${CHREFILE}
cd \$1
./${CHREFILE} *
rm ${CHREFILE}
cd ..
else
echo "ignoring link \$1"
fi
else
if [ -f \$1 -a ! -L \$1 ]
then
INFILE=\${1}.xyz
OUTFILE=\${1}
echo "setting \$OLDVERSION onto \$NEWVERSION in \$OUTFILE"
cp \$OUTFILE \$INFILE
sed -e "/<#\$OLDVERSION#>/s/\$OLDVERSION/\$NEWVERSION/" \$INFILE > \$OUTFILE
rm \$INFILE
else
echo "ignoring \$1"
fi
fi
shift
done
if [ -f configure.in ]
then
echo "setting \$OLDVERSION onto \$NEWVERSION in configure.in"
mv configure.in configure.org
sed -e "/(${project},\$OLDVERSION)/s/\$OLDVERSION/\$NEWVERSION/" configure.org > configure.in
rm configure.org
fi
if [ -f Makefile.am ]
then
echo "setting \$OLDVERSION onto \$NEWVERSION in libsection of ..."
echo "... \$PWD\Makefile.am"
mv Makefile.am Makefile.org
sed -e "/info \$OLDLIBVERSION/s/\$OLDLIBVERSION/\$NEWLIBVERSION/" Makefile.org > Makefile.am
rm Makefile.org
fi
if [ -f ${DOXYFILE} ]
then
echo "setting \$OLDVERSION onto \$NEWVERSION in ${DOXYFILE}"
mv ${DOXYFILE} ${DOXYFILE}.org
sed -e "/PROJECT_NUMBER = \$OLDVERSION/s/\$OLDVERSION/\$NEWVERSION/" ${DOXYFILE}.org > ${DOXYFILE}
rm ${DOXYFILE}.org
fi
if [ -f prj.spec ]
then
echo "setting \$OLDVERSION onto \$NEWVERSION in prj.spec"
mv prj.spec prj.spec.org
sed -e "/define PRJ_RELEASE \$OLDVERSION/s/\$OLDVERSION/\$NEWVERSION/" prj.spec.org > prj.spec
rm prj.spec.org
fi
EOF
chmod 775 $CHREFILE
}
# ============================================================
# == These are the highlevel functions for creating various ==
# == types of directories ==
# ============================================================
# -------------------------------------------------------
# This function creates the toplevel package directory.
# FIXME: Add more documentation here
# -------------------------------------------------------
function create_toplevel_directory
{
echo "Ready to create a new packet skeleton in"
echo "`pwd`"
echo "using the copyright"
get_copyright_data
echo "package-name : $PROJECT"
echo "initialization-author : $AUT_NAME"
echo "initialization-email : $AUT_EMAIL"
if [ $COMPANY != "GNU" ];
then
echo "software owning company : $COMPANY"
echo "using the short license-version : $COMP_SHORT_COPYRIGHT_NOTE"
echo "using the long license-version : $COMP_LONG_COPYRIGHT_NOTE"
fi
# Make the directories
echo "project-programming language : ${LANGUAGE}"
echo "project-directory start-release : ${PROJECT}-${RELEASE}"
mkdir ${project}-${RELEASE}
cp gcng.conf ${project}-${RELEASE}/
cd ${project}-${RELEASE}
SDL="src src/daughter-module lib scripts doc m4"
WORK_SDL="doc m4 scripts lib src src/daughter-module"
for i in $SDL
do
echo "creating blank ${i}/Makefile.am"
mkdir $i
cp gcng.conf ${i}/gcng.conf
gcng -am ${PROJECT} ${i}/Makefile.am ${RELEASE} > ${i}/Makefile.am
done
echo "creating blank Makefile.am, configure.in and reconf"
gcng -am ${PROJECT} Makefile.am ${RELEASE} > Makefile.am
gcng -shS ${PROJECT} configure.in ${RELEASE} > configure.in
gcng -shS ${PROJECT} reconf ${RELEASE} > reconf
chmod u+x reconf
# Create templates for the standard information files
echo "creating filled NEWS README AUTHORS THANKS ChangeLog"
touch NEWS README AUTHORS THANKS ChangeLog
make_NEWS
make_README
make_AUTHORS
make_THANKS
make_ChangeLog
for i in $SDL;
do
cd $i
echo "creating source-templates and filling makefiles in ${i}"
case $i in
"m4")
make_m4_makefile
;;
"doc")
make_doclevel_makefile
make_htmldoc
;;
"scripts")
make_scriptlevel_makefile
make_bashscript
;;
"lib")
make_liblevel_makefile_${LANGUAGE}
make_liblevel_statlib_${LANGUAGE}
;;
"src/daughter-module")
make_damolevel_makefile_${LANGUAGE}
make_damolevel_module_${LANGUAGE}
cd ..
;;
"src")
make_simolevel_makefile_${LANGUAGE}
make_simolevel_main_${LANGUAGE}
make_simolevel_module_${LANGUAGE}
;;
*)
make_blank_makefile_${LANGUAGE} $i
;;
esac
cd ..
done
make_toplevel_configure_${LANGUAGE}
make_toplevel_makefile_${LANGUAGE}
make_reconf_${LANGUAGE}
make_local_${LANGUAGE}
# Run the reconf script
echo "+ Running reconf"
sh ./reconf
echo "+ integrate doxygen"
integrate_doxygen
echo "+ integrating the correct license"
if [ "$COMPANY" = "GNU" ]
then
echo "project will be published under GNU-license"
else
echo "project will be published under special company-license"
rm COPYING
cp ${COMP_LONG_COPYRIGHT_NOTE} COPYING
fi
echo "+ writing a change-release-script named $CHREFILE"
write_chrefile
echo "+ writing a prepare cvsimport-file named $PREPCLEARREPCOMMITFILE"
write_prepClearRepCommit
echo "+ writing a project-spec rpm-build-file named $PRJSPECFILE"
write_prj_spec
# Important message
echo "Distribution directory is ready."
echo "keep the files AUTHORS, NEWS, README, THANKS up to date"
echo "namely before cutting a distribution."
}
############################################################################
############################################################################
#
# Parse the command-line arguments
#
# Force some command-line arguments to be passed
LANGUAGE="cpp"
PROJECT="DePpO"
RELE="0"
BRAN="1"
if [ $# -eq 0 ];
then
usage
exit
fi
case $1 in
--help)
usage
exit
;;
-h)
usage
exit
;;
--version)
version
exit
;;
-v)
version
exit
;;
-cpp)
LANGUAGE="cpp"
;;
-c)
LANGUAGE="c"
;;
*)
usage
exit
;;
esac
if [ $# -gt 1 ];
then
PROJECT=$2
if [ $# -gt 2 ];
then
RELE=$3
if [ $# -gt 3 ];
then
BRAN=$4
fi
fi
fi
STEP=0
INCRBRAN=$[ $BRAN + 1 ]
case $LANGUAGE in
c)
CNSIMO=${PROJECT}_sister_module
CNDAMO=${PROJECT}_daughter_module
CNLIMO=${PROJECT}_library_module
;;
cpp)
CNSIMO=${PROJECT}SisterModule
CNDAMO=${PROJECT}DaughterModule
CNLIMO=${PROJECT}LibraryModule
;;
*)
echo "unknown languge"
exit
esac
RELEASE="${RELE}.${BRAN}.${STEP}"
LIBRELEASE="${RELE}:${BRAN}:${STEP}"
# defining the module/library names
# (1) sister - module = same level as main-source
# beeing compiled into $(top_srcdir)/src
SIMONAME=`toUpper ${CNSIMO}`
Simoname=`toCapitalized ${CNSIMO}`
simoname=`toLower ${CNSIMO}`
# (2) daugther - module = sub-level of src
# = really being an uninstalled, but linked static library
# being compiled into $(top_srcdir)/src/daughter-module
DAMONAME=`toUpper ${CNDAMO}`
Damoname=`toCapitalized ${CNDAMO}`
damoname=`toLower ${CNDAMO}`
# (3) library = linkable and installable static + shared
# library being compiled into $(top_srcdir)/lib
LIBRNAME=`toUpper ${CNLIMO}`
Librname=`toCapitalized ${CNLIMO}`
librname=`toLower ${CNLIMO}`
# (4) the rest
Project=`toCapitalized ${PROJECT}`
project=`toLower ${PROJECT}`
PROJECT=`toUpper $PROJECT`
DOXYFILE=Doxyfile
CHREFILE=change-release
PREPCLEARREPCOMMITFILE="prepClearRepCommit.sh"
PRJSPECFILE="prj.spec"
ADD_TOPLEVEL_DIST="$DOXYFILE $CHREFILE $PREPCLEARREPCOMMITFILE $PRJSPECFILE"
create_toplevel_directory
exit