From: g0dil Date: Wed, 29 Aug 2007 14:05:38 +0000 (+0000) Subject: Fix non-subversion build from debian source package X-Git-Url: http://g0dil.de/git?p=senf.git;a=commitdiff_plain;h=e898f807e2bdd260a0967051829fe307e2e4a0bd Fix non-subversion build from debian source package Add global build targets to 'scons -h' help output Add 'debsrc' and 'debbin' targets git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@414 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Doxyfile b/Doxyfile index d29688f..2de82e8 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,7 +1,7 @@ @INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global" PROJECT_NAME = Overview -PROJECT_NUMBER = "(Revision $(REVISION), generated $(TODAY))" +PROJECT_NUMBER = "(Version $(REVISION))" HTML_HEADER = doclib/doxy-header-overview.html GENERATE_XML = NO diff --git a/Makefile b/Makefile index 89b9254..ae3cae0 100644 --- a/Makefile +++ b/Makefile @@ -33,22 +33,5 @@ DEB_DOC = doxygen dia tidy xsltproc graphviz prerequisites: aptitude install $(DEB_BASE) $(DEB_BOOST) $(DEB_DOC) -#---------------------------------------------------------------------- -# Debian package info -#---------------------------------------------------------------------- -PKG_NAME=senf-dev -PKG_ARCH=i386 -PKG_VERS=0.0.$(SVN_REVISION)-1 -PKG_FILE = $(PKG_NAME)-$(PKG_VERS)_$(PKG_ARCH).deb - -#---------------------------------------------------------------------- -# Debian package structure -#---------------------------------------------------------------------- -DEB_TOP = ./debian -DEB_CTL = $(DEB_TOP)/DEBIAN -DEB_LIB = $(DEB_TOP)/usr/lib/senf -DEB_INC = $(DEB_TOP)/usr/include/senf -DEB_DOC = $(DEB_TOP)/usr/share/doc/senf - package: $(SCONS) deb diff --git a/SConstruct b/SConstruct index b3a6a52..da35a8d 100644 --- a/SConstruct +++ b/SConstruct @@ -11,6 +11,23 @@ SENFSCons.UseBoost() SENFSCons.UseSTLPort() env = SENFSCons.MakeEnvironment() +env.Help(""" +Additional top-level build targets: + +all_tests Build and run unit tests for all modules +all_docs Build documentation for all modules +all Build everything +install_all Install SENF into $PREFIX +deb Build debian source and binary package +debsrc Build debian source package +debbin Build debian binary package +""") + +if os.environ.get('debian_build'): + rev = os.popen("dpkg-parsechangelog | awk '/^Version:/{print $2}'").read().strip() +else: + rev = 'r' + os.popen("svnversion").read().strip().lower() + # Configure build env.Append( CPPPATH = [ '#' ], @@ -18,8 +35,8 @@ env.Append( DOXY_XREF_TYPES = [ 'bug', 'fixme', 'todo', 'idea' ], DOXY_HTML_XSL = '#/doclib/html-munge.xsl', ENV = { 'TODAY' : str(datetime.date.today()), - 'REVISION' : os.popen("svnversion").read().strip(), - 'LOGNAME' : os.environ['LOGNAME'] + 'REVISION' : rev, + 'LOGNAME' : os.environ['LOGNAME'] # needed by the debian build scripts }, ) @@ -37,18 +54,20 @@ SENFSCons.DoxyXRef(env, HTML_FOOTER = '#/doclib/doxy-footer.html') def updateRevision(target, source, env): - rev = env['ENV']['REVISION'] + rev = env['ENV']['REVISION'][1:] if ':' in rev: print print "Working copy not clean. Run 'svn update'" print return 1 - if 'M' in rev: + if 'm' in rev and not ARGUMENTS.get('force_deb'): print print "Working copy contains local changes. Commit first" print return 1 - if 'S' in rev or 'M' in rev: + if 's' in rev: + rev = rev[:-1] + if 'm' in rev: rev = rev[:-1] changelog = file('debian/changelog.template').read() % { 'rev': rev, @@ -56,9 +75,18 @@ def updateRevision(target, source, env): 'date': time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()) } file('debian/changelog','w').write(changelog) -env.AlwaysBuild( - env.Alias('deb', [], [ updateRevision, - "dpkg-buildpackage -us -uc -rfakeroot" ])) +if not os.environ.get('debian_build'): + env.AlwaysBuild( + env.Alias('deb', [], [ updateRevision, + "dpkg-buildpackage -us -uc -rfakeroot -I.svn" ])) + + env.AlwaysBuild( + env.Alias('debsrc', [], [ updateRevision, + "dpkg-buildpackage -us -uc -rfakeroot -S -I.svn" ])) + + env.AlwaysBuild( + env.Alias('debbin', [], [ updateRevision, + "dpkg-buildpackage -us -uc -rfakeroot -nc" ])) # Create Doxyfile.local if not cleaning and the file does not exist # otherwise doxygen will barf on this non-existent file diff --git a/debian/rules b/debian/rules index 15682ff..6da3900 100755 --- a/debian/rules +++ b/debian/rules @@ -9,8 +9,8 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 - - +debian_build=1 +export debian_build CFLAGS = -Wall -g diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index 72087a3..0719475 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -219,6 +219,7 @@ def MakeEnvironment(): env[opt.key] = SCons.Script.SConscript.Arguments.get(opt.key) if SCons.Script.SConscript.Arguments.get('final'): env['final'] = 1 + env.Help("\nSupported build variables (either in SConfig or on the command line:\n") env.Help(opts.GenerateHelpText(env)) # We want to pass the SSH_AUTH_SOCK system env-var so we can ssh diff --git a/unchecked-includes.sh b/unchecked-includes.sh index df60a3a..7b63382 100755 --- a/unchecked-includes.sh +++ b/unchecked-includes.sh @@ -2,6 +2,8 @@ cd "`dirname "$0"`" +trap 'rm -f installed_includes source_includes' 0 1 2 15 + scons -n install_all PREFIX="non-existing-target" \ | awk -F \" '/^Install file:/ && $2~/\.(h|hh|ih|ct|cti|cci|mpp)$/ {print $2}' \ | sort > installed_includes @@ -11,4 +13,3 @@ scons -n install_all PREFIX="non-existing-target" \ comm -13 installed_includes source_includes -rm -f installed_includes source_includes