From a32a5383221c9b1b4217d22cbb1ad722ef4a67be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 5 Nov 2015 15:59:53 +0000 Subject: [PATCH] some more improvements plus creation of trunk branches and tags --- README | 55 ++++++++++++++++++++++++++--- scripts/ax_init_standard_project.m4 | 3 ++ scripts/bootstrap.sh | 54 +++++++++++++++++++++++----- 3 files changed, 98 insertions(+), 14 deletions(-) diff --git a/README b/README index 1188ece..521c232 100644 --- a/README +++ b/README @@ -2,13 +2,14 @@ bootstrap-build-environment Simply setup a new project: 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 4. call with full path: /path/to/bootstrap.sh - 5. follow the instructions, i.e. edit configure.ac - 6. run again: /path/to/bootstrap.sh - 7. add some generated files: svn add COPYING ChangeLog INSTALL - 8. your project is setup and compilable, test: ./bootstrap.sh -b + 5. if trunk has been created, cd to trunk + 6. follow the instructions, i.e. edit configure.ac + 7. run again: /path/to/bootstrap.sh + 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: ./bootstrap.sh -h @@ -27,3 +28,47 @@ Supports and preconfigures: - Debian packaging - RPM packaging - 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) + +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 diff --git a/scripts/ax_init_standard_project.m4 b/scripts/ax_init_standard_project.m4 index e9f31eb..826d0ca 100644 --- a/scripts/ax_init_standard_project.m4 +++ b/scripts/ax_init_standard_project.m4 @@ -13,6 +13,7 @@ m4_define(x_least, m4_ifdef([x_least_diff], mrw_esyscmd_s([ for path in . .. ../..; do if svn info $path 2>&1 > /dev/null; then SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') + if test -z "${SVN_REVISION}"; then SVN_REVISION=0; fi break; fi done @@ -22,6 +23,7 @@ m4_define(x_least, m4_ifdef([x_least_diff], mrw_esyscmd_s([ for path in . .. ../..; do if svn info $path 2>&1 > /dev/null; then SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') + if test -z "${SVN_REVISION}"; then SVN_REVISION=0; fi break; fi done @@ -36,6 +38,7 @@ m4_define(x_minor_diff, mrw_esyscmd_s([ for path in . .. ../..; do if svn info $path 2>&1 > /dev/null; then SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') + if test -z "${SVN_REVISION}"; then SVN_REVISION=0; fi break; fi; done diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 3085a4f..ad97bb1 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -120,7 +120,7 @@ GENERATED FILES * src/version.hxx - if you enabled AX_USE_CXX * src/version.cxx - if you enabled AX_USE_CXX * 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/doxyfile.in - if you enabled AX_USE_DOXYGEN * test/makefile.am - if you enabled AX_BUILD_TEST or AX_USE_CPPUNIT @@ -332,7 +332,7 @@ to() { case "$1" in (--condition) shift # test for a tag, abort if not set if ! testtag "$1"; then - return + return 0 fi;; (--mode) shift # test for a tag, abort if not set mode="$1";; @@ -373,7 +373,14 @@ copy() { # file already exists and must not be rebuilt return 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 run svn add "$1" run svn propset svn:keywords "Id" "$1" @@ -402,6 +409,12 @@ doxyadd() { 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: copy ${MY_NAME} copy ax_init_standard_project.m4 @@ -427,8 +440,7 @@ ${DEFAULT_PROJECT_NAME} add description for ${DEFAULT_PROJECT_NAME} EOF -to configure.ac <