Skip to content
Snippets Groups Projects
Commit fda471f9 authored by g0dil's avatar g0dil
Browse files

Improve handling of SConfig and Doxyfile.local in debian build

Add missing cleanup files
parent 0f8ccaad
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ source_headers = [ f for f in glob.glob("*.hh")
if 'defined(SENF_PACKETS_DECL_ONLY)' in file(f).read() ]
source_headers.sort()
makeAllIncludesHH('all_includes.hh', source_headers)
env.Clean('all','all_includes.hh')
SENFSCons.StandardTargets(env)
SENFSCons.Lib(env,
......@@ -26,3 +27,4 @@ SENFSCons.Doxygen(env, extra_sources = [
])
SConscript(glob.glob("*/SConscript"))
File moved
# -*- python -*-
import sys, glob, os.path, datetime, pwd, time
import sys, glob, os.path, datetime, pwd, time, fnmatch
sys.path.append('senfscons')
import SENFSCons
......@@ -28,6 +28,22 @@ def updateRevision(target, source, env):
'date': time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()) }
file('debian/changelog','w').write(changelog)
def nonemptyFile(f):
try: return os.stat(f).st_size > 0
except OSError: return False
def checkLocalConf(target, source, env):
if nonemptyFile('SConfig') or nonemptyFile('Doxyfile.local'):
print
print "You have made local modifications to 'SConfig' and/or 'Doxyfile.local'."
print "Building a debian package would remove those files."
print
print "To continue, remove the offending file(s) and try again. Alternatively,"
print "build a source package using 'scons debsrc' and may then build debian"
print "binary packages from this source-package without disrupting your print local"
print "configuration."
print
return 1
###########################################################################
# Load utilities and setup libraries and configure build
......@@ -67,6 +83,8 @@ env.Append(
'LOGNAME' : logname, # needed by the debian build scripts
'CONCURRENCY_LEVEL' : env.GetOption('num_jobs') or "1"
},
CLEAN_PATTERNS = [ '*.pyc', 'semantic.cache', '.sconsign', '.sconsign.dblite' ],
BUILDPACKAGE_COMMAND = "dpkg-buildpackage -us -uc -rfakeroot -I.svn -IDoxyfile.local -ISConfig",
)
Export('env')
......@@ -96,13 +114,20 @@ env.Default(libsenf)
env.Alias('install_all', env.Install('$LIBINSTALLDIR', libsenf))
env.AlwaysBuild(
env.Alias('deb', [], [ updateRevision,
"dpkg-buildpackage -us -uc -rfakeroot -I.svn" ]))
env.Alias('deb', [], [ checkLocalConf,
updateRevision,
"$BUILDPACKAGE_COMMAND" ]))
env.AlwaysBuild(
env.Alias('debsrc', [], [ updateRevision,
"dpkg-buildpackage -us -uc -rfakeroot -S -I.svn" ]))
"$BUILDPACKAGE_COMMAND -S" ]))
env.AlwaysBuild(
env.Alias('debbin', [], [ updateRevision,
"dpkg-buildpackage -us -uc -rfakeroot -nc" ]))
env.Alias('debbin', [], [ checkLocalConf,
updateRevision,
"$BUILDPACKAGE_COMMAND -nc" ]))
env.Clean('all', [ os.path.join(path,f)
for path, subdirs, files in os.walk('.')
for pattern in env['CLEAN_PATTERNS']
for f in fnmatch.filter(files,pattern) ])
debian/tmp/usr/lib/libsenf.a
debian/tmp/usr/lib/*.o usr/lib/senf-packets
debian/tmp/usr/include
debian/README usr/share/doc/libsenf-dev
README usr/share/doc/libsenf-dev
debian/tmp/usr/share/doc/libsenf-doc
debian/README usr/share/doc/libsenf-doc
README usr/share/doc/libsenf-doc
debian/index.html usr/share/doc/libsenf-doc
......@@ -23,8 +23,8 @@ else
endif
# shared library versions, option 1
version=2.0.5
major=2
#version=2.0.5
#major=2
# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
#version=`ls src/.libs/lib*.so.* | \
# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
......@@ -37,14 +37,18 @@ configure: configure-stamp
configure-stamp:
dh_testdir
# # Add here commands to configure the package.
rm -f Doxyfile.local SConfig
# If needed, we could create new 'Doxyfile.local' and/or 'SConfig' files here.
# We don't remove them in 'clean' to allow building a source package from an
# individually configured svn working copy.
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
# # Add here commands to compile the package.
scons -j $(CONCURRENCY_LEVEL) all final=1
scons -j $(CONCURRENCY_LEVEL) final=1
scons -j $(CONCURRENCY_LEVEL) all_docs final=1
touch $@
clean:
......@@ -53,7 +57,7 @@ clean:
rm -f build-stamp configure-stamp
# # Add here commands to clean up after the build process.
-scons -c all
dh_clean
dh_clean
install: build
dh_testdir
......@@ -61,7 +65,7 @@ install: build
dh_clean -k
dh_installdirs
# # Add here commands to install the package into debian/tmp
scons install_all final=1\
scons -j $(CONCURRENCY_LEVEL) install_all final=1\
PREFIX='$(destdir)/usr' \
DOCINSTALLDIR='$$PREFIX/share/doc/libsenf-doc'
# We need to install the example sourcecode
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment