some more improvements plus creation of trunk branches and tags

master
Marc Wäckerlin 9 years ago
parent 0f3cf35c96
commit a32a538322
  1. 55
      README
  2. 3
      scripts/ax_init_standard_project.m4
  3. 54
      scripts/bootstrap.sh

@ -2,13 +2,14 @@ bootstrap-build-environment
Simply setup a new project: Simply setup a new project:
1. create a subversion basic tree 1. create a subversion basic tree
2. checkout trunk of the new subversion repository 2. checkoutsubversion repository
3. cd into the new project subversion working copy 3. cd into the new project subversion working copy
4. call with full path: /path/to/bootstrap.sh 4. call with full path: /path/to/bootstrap.sh
5. follow the instructions, i.e. edit configure.ac 5. if trunk has been created, cd to trunk
6. run again: /path/to/bootstrap.sh 6. follow the instructions, i.e. edit configure.ac
7. add some generated files: svn add COPYING ChangeLog INSTALL 7. run again: /path/to/bootstrap.sh
8. your project is setup and compilable, test: ./bootstrap.sh -b 8. add some generated files: svn add COPYING ChangeLog INSTALL
9. your project is setup and compilable, test: ./bootstrap.sh -b
Fore more details, see: Fore more details, see:
./bootstrap.sh -h ./bootstrap.sh -h
@ -27,3 +28,47 @@ Supports and preconfigures:
- Debian packaging - Debian packaging
- RPM packaging - RPM packaging
- Mac OSX App Bundle creation - Mac OSX App Bundle creation
Example:
There is a just created empty subversion repository:
https://dev.marc.waeckerlin.org/svn/project-name
Setup a basic project:
svn co https://dev.marc.waeckerlin.org/svn/project-name
cd project-name
../bootstrap-build-environment/scripts/bootstrap.sh
cd trunk
The file AUTHORS is already correct due to my gnupg setup:
Fistname Lastname (https://my.homepage.xyz) <me@mysite.xyz>
Edit the file README, I add the following lines:
First line is the headline, the short description, e.g. in the packages
The following lines describe your project...
They also appear in the package description
Edit configure.ac, since I want to publish scripts, generate doxygen, debian and rpm packages, I enable the following lines:
AX_USE_SCRIPTS
AX_USE_DOXYGEN
AX_USE_DEBIAN_PACKAGING
AX_USE_RPM_PACKAGING
Also I check "Section" in debian/control.in and set it do development.
Then I continue, I rerun bootstrap.sh, this time with option -b which calls make distcheck at the end:
../../bootstrap-build-environment/scripts/bootstrap.sh -b
Everything is fine, so checkin the changes and cleanup the system:
cd ..
svn ci -m "initial project creation"
cd ..
rm -rf project-name
svn co https://dev.marc.waeckerlin.org/svn/project-name/trunk project-name

@ -13,6 +13,7 @@ m4_define(x_least, m4_ifdef([x_least_diff], mrw_esyscmd_s([
for path in . .. ../..; do for path in . .. ../..; do
if svn info $path 2>&1 > /dev/null; then if svn info $path 2>&1 > /dev/null; then
SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p')
if test -z "${SVN_REVISION}"; then SVN_REVISION=0; fi
break; break;
fi fi
done done
@ -22,6 +23,7 @@ m4_define(x_least, m4_ifdef([x_least_diff], mrw_esyscmd_s([
for path in . .. ../..; do for path in . .. ../..; do
if svn info $path 2>&1 > /dev/null; then if svn info $path 2>&1 > /dev/null; then
SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p')
if test -z "${SVN_REVISION}"; then SVN_REVISION=0; fi
break; break;
fi fi
done done
@ -36,6 +38,7 @@ m4_define(x_minor_diff, mrw_esyscmd_s([
for path in . .. ../..; do for path in . .. ../..; do
if svn info $path 2>&1 > /dev/null; then if svn info $path 2>&1 > /dev/null; then
SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p')
if test -z "${SVN_REVISION}"; then SVN_REVISION=0; fi
break; break;
fi; fi;
done done

@ -120,7 +120,7 @@ GENERATED FILES
* src/version.hxx - if you enabled AX_USE_CXX * src/version.hxx - if you enabled AX_USE_CXX
* src/version.cxx - if you enabled AX_USE_CXX * src/version.cxx - if you enabled AX_USE_CXX
* html/makefile.am - if you enabled AX_BUILD_HTML * html/makefile.am - if you enabled AX_BUILD_HTML
* scripts/makefile.in - if you enabled AX_USE_SCRIPTS * scripts/makefile.am - if you enabled AX_USE_SCRIPTS
* doc/makefile.am - if you enabled AX_USE_DOXYGEN * doc/makefile.am - if you enabled AX_USE_DOXYGEN
* doc/doxyfile.in - if you enabled AX_USE_DOXYGEN * doc/doxyfile.in - if you enabled AX_USE_DOXYGEN
* test/makefile.am - if you enabled AX_BUILD_TEST or AX_USE_CPPUNIT * test/makefile.am - if you enabled AX_BUILD_TEST or AX_USE_CPPUNIT
@ -332,7 +332,7 @@ to() {
case "$1" in case "$1" in
(--condition) shift # test for a tag, abort if not set (--condition) shift # test for a tag, abort if not set
if ! testtag "$1"; then if ! testtag "$1"; then
return return 0
fi;; fi;;
(--mode) shift # test for a tag, abort if not set (--mode) shift # test for a tag, abort if not set
mode="$1";; mode="$1";;
@ -373,7 +373,14 @@ copy() {
# file already exists and must not be rebuilt # file already exists and must not be rebuilt
return return
fi fi
run cp "${0%/*}/$1" "$1" local source="${0%/*}/$1"
if ! test -r "${source}"; then
source="../${source}"
if ! test -r "${source}"; then
source="${0%/*}/$1"
fi
fi
run cp "${source}" "$1"
if test $exists -eq 0; then if test $exists -eq 0; then
run svn add "$1" run svn add "$1"
run svn propset svn:keywords "Id" "$1" run svn propset svn:keywords "Id" "$1"
@ -402,6 +409,12 @@ doxyadd() {
fi fi
} }
# Check if we are in subversion root, if so, create trunk, branches, tags:
if test "$(LANG= svn info | sed -n 's,Relative URL: *,,p')" = "^/"; then
svn mkdir trunk branches tags
cd trunk
fi
# Initialize the environment: # Initialize the environment:
copy ${MY_NAME} copy ${MY_NAME}
copy ax_init_standard_project.m4 copy ax_init_standard_project.m4
@ -427,8 +440,7 @@ ${DEFAULT_PROJECT_NAME}
add description for ${DEFAULT_PROJECT_NAME} add description for ${DEFAULT_PROJECT_NAME}
EOF EOF
to configure.ac <<EOF && \ to configure.ac <<EOF && notice "please edit configure.ac, then rerun $0" && exit 0
( notice "please edit configure.ac, then rerun $0"; exit 0 )
${HEADER}m4_define(x_package_name, ${DEFAULT_PROJECT_NAME}) # project's name ${HEADER}m4_define(x_package_name, ${DEFAULT_PROJECT_NAME}) # project's name
m4_define(x_major, 0) # project's major version m4_define(x_major, 0) # project's major version
m4_define(x_minor, 0) # project's minor version m4_define(x_minor, 0) # project's minor version
@ -700,7 +712,11 @@ namespace NAMESPACE {
const std::string IDENT("\$Id: " PACKAGE_STRING); const std::string IDENT("\$Id: " PACKAGE_STRING);
} }
EOF EOF
echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_SCRIPTS scripts/makefile.am to --condition AX_USE_SCRIPTS scripts/makefile.am <<EOF
${HEADER}dist_bin_SCRIPTS =
MAINTAINERCLEANFILES = makefile.in
EOF
echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_DOXYGEN doc/makefile.am echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_DOXYGEN doc/makefile.am
to --condition 'AX_BUILD_TEST|AX_USE_CPPUNIT' test/makefile.am <<EOF to --condition 'AX_BUILD_TEST|AX_USE_CPPUNIT' test/makefile.am <<EOF
${HEADER}$(if testtag AX_USE_CXX; then ${HEADER}$(if testtag AX_USE_CXX; then
@ -824,7 +840,7 @@ EOF
Source: @PACKAGE_NAME@ Source: @PACKAGE_NAME@
Priority: extra Priority: extra
Maintainer: @AUTHOR@ Maintainer: @AUTHOR@
Build-Depends: ${BUILD-DEPENDS} Build-Depends: ${BUILD_DEPENDS}
Package: @PACKAGE_NAME@ Package: @PACKAGE_NAME@
Section: $(if testtag AX_USE_LIBTOOL; then echo "libs"; fi) Section: $(if testtag AX_USE_LIBTOOL; then echo "libs"; fi)
@ -838,7 +854,7 @@ $( if testtag AX_USE_LIBTOOL; then
Package: @PACKAGE_NAME@-dev Package: @PACKAGE_NAME@-dev
Section: libdevel Section: libdevel
Architecture: any Architecture: any
Depends: @PACKAGE_NAME@ (= \${binary:Version}), ${BUILD-DEPENDS} Depends: @PACKAGE_NAME@ (= \${binary:Version}), ${BUILD_DEPENDS}
Description: @DESCRIPTION@ - Development Package Description: @DESCRIPTION@ - Development Package
@README_DEB@ @README_DEB@
EOF2 EOF2
@ -983,8 +999,28 @@ fi)
EOF EOF
SUBDIRS="" SUBDIRS=""
if testtag AX_USE_CXX; then
SUBDIRS="${SUBDIRS} src"
fi
if testtag AX_BUILD_TEST AX_USE_CPPUNIT; then
SUBDIRS="${SUBDIRS} test"
fi
if testtag AX_USE_SCRIPTS; then
SUBDIRS="${SUBDIRS} scripts"
fi
if testtag AX_USE_DOXYGEN; then
SUBDIRS="${SUBDIRS} doc"
fi
if testtag AX_BUILD_EXAMPLES; then
SUBDIRS="${SUBDIRS} examples"
fi
if testtag AX_BUILD_HTML; then
SUBDIRS="${SUBDIRS} html"
fi
for d in src test scripts doc examples html; do for d in src test scripts doc examples html; do
test -d $d && SUBDIRS="${SUBDIRS} $d" if test -d "$d" -a "${SUBDIRS//$d/}" = "${SUBDIRS}"; then
SUBDIRS="${SUBDIRS} $d"
fi
done done
to makefile.am<<EOF to makefile.am<<EOF
${HEADER}SUBDIRS =${SUBDIRS} ${HEADER}SUBDIRS =${SUBDIRS}

Loading…
Cancel
Save