From: g0dil Date: Fri, 31 Aug 2007 07:41:13 +0000 (+0000) Subject: Build combined library 'libsenf.a' and restructure debian packages X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=eef5ce1509f25480ab70091c9894f05a175bc80c;p=senf.git Build combined library 'libsenf.a' and restructure debian packages git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@420 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/SConstruct b/SConstruct index 391fb03..22a95af 100644 --- a/SConstruct +++ b/SConstruct @@ -6,7 +6,32 @@ import SENFSCons ########################################################################### -# Load utilities and setup libraries +def updateRevision(target, source, env): + rev = env['ENV']['REVISION'][1:] + if ':' in rev: + print + print "Working copy not clean. Run 'svn update'" + print + return 1 + 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: + rev = rev[:-1] + if 'm' in rev: + rev = rev[:-1] + changelog = file('debian/changelog.template').read() % { + 'rev': rev, + 'user': pwd.getpwuid(os.getuid()).pw_gecos.split(',')[0].strip(), + 'date': time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()) } + file('debian/changelog','w').write(changelog) + + +########################################################################### +# Load utilities and setup libraries and configure build + SENFSCons.UseBoost() SENFSCons.UseSTLPort() env = SENFSCons.MakeEnvironment() @@ -28,7 +53,6 @@ if os.environ.get('debian_build'): else: rev = 'r' + os.popen("svnversion").read().strip().lower() -# Configure build env.Append( CPPPATH = [ '#' ], LIBS = [ 'iberty', '$BOOSTREGEXLIB' ], @@ -43,53 +67,38 @@ env.Append( Export('env') -# Build modules (that is, instruct to build ... the build happens later) +# Create Doxyfile.local if not cleaning and the file does not exist +# otherwise doxygen will barf on this non-existent file +if not env.GetOption('clean') and not os.path.exists("Doxyfile.local"): + Execute(Touch("Doxyfile.local")) + +########################################################################### +# Define build targets + SConscript(glob.glob("*/SConscript")) SENFSCons.StandardTargets(env) SENFSCons.GlobalTargets(env) SENFSCons.Doxygen(env) - SENFSCons.DoxyXRef(env, HTML_HEADER = '#/doclib/doxy-header-overview.html', HTML_FOOTER = '#/doclib/doxy-footer.html') -def updateRevision(target, source, env): - rev = env['ENV']['REVISION'][1:] - if ':' in rev: - print - print "Working copy not clean. Run 'svn update'" - print - return 1 - 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: - rev = rev[:-1] - if 'm' in rev: - rev = rev[:-1] - changelog = file('debian/changelog.template').read() % { - 'rev': rev, - 'user': pwd.getpwuid(os.getuid()).pw_gecos.split(',')[0].strip(), - 'date': time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()) } - file('debian/changelog','w').write(changelog) +# Build combined library 'libsenf' +libsenf = env.Library( + SENFSCons.LibPath('senf'), + Flatten([ env.File(SENFSCons.LibPath(lib)).sources for lib in env['ALLLIBS'] ])) +env.Default(libsenf) +env.Alias('install_all', env.Install('$LIBINSTALLDIR', libsenf)) -if not os.environ.get('debian_build'): - env.AlwaysBuild( - env.Alias('deb', [], [ updateRevision, - "dpkg-buildpackage -us -uc -rfakeroot -I.svn" ])) +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('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 -if not env.GetOption('clean') and not os.path.exists("Doxyfile.local"): - Execute(Touch("Doxyfile.local")) +env.AlwaysBuild( + env.Alias('debbin', [], [ updateRevision, + "dpkg-buildpackage -us -uc -rfakeroot -nc" ])) diff --git a/debian/control b/debian/control index 0062ea8..f50d3b1 100644 --- a/debian/control +++ b/debian/control @@ -5,59 +5,11 @@ Build-Depends: debhelper (>= 5), scons, libboost-dev, libboost-test-dev, libboos Standards-Version: 3.7.2 Section: libs -Package: libsenf-ppi-dev +Package: libsenf-dev Section: libdevel Architecture: any -Depends: libsenf-scheduler-dev (= ${Source-Version}), libsenf-packets-dev (= ${Source-Version}), ${shlibs:Depends}, ${misc:Depends} -Description: SENF Extensible Network Framework, Packet Processing Infrastructure - The SENF Simple and Extensible Network Framework aims to be a - complete set of libraries to facilitate the development of network - applications focusing on network protocols on the layers below the - application layer. However, the framework includes many general - purpose utilities and will be expedient to use well beyond its primary - objective. - -Package: libsenf-packets-dev -Section: libdevel -Architecture: any -Depends: libsenf-socket-dev (= ${Source-Version}), libsenf-utils-dev (= ${Source-Version}), ${shlibs:Depends}, ${misc:Depends} -Description: SENF Extensible Network Framework, Packets library - The SENF Simple and Extensible Network Framework aims to be a - complete set of libraries to facilitate the development of network - applications focusing on network protocols on the layers below the - application layer. However, the framework includes many general - purpose utilities and will be expedient to use well beyond its primary - objective. - -Package: libsenf-scheduler-dev -Section: libdevel -Architecture: any -Depends: libsenf-socket-dev (= ${Source-Version}), libsenf-utils-dev (= ${Source-Version}), ${shlibs:Depends}, ${misc:Depends} -Description: SENF Extensible Network Framework, Scheduler, development files - The SENF Simple and Extensible Network Framework aims to be a - complete set of libraries to facilitate the development of network - applications focusing on network protocols on the layers below the - application layer. However, the framework includes many general - purpose utilities and will be expedient to use well beyond its primary - objective. - -Package: libsenf-socket-dev -Section: libdevel -Architecture: any -Depends: libsenf-utils-dev (= ${Source-Version}), ${shlibs:Depends}, ${misc:Depends} -Description: SENF Extensible Network Framework, Socket library, development files - The SENF Simple and Extensible Network Framework aims to be a - complete set of libraries to facilitate the development of network - applications focusing on network protocols on the layers below the - application layer. However, the framework includes many general - purpose utilities and will be expedient to use well beyond its primary - objective. - -Package: libsenf-utils-dev -Section: libdevel -Architecture: any -Depends: binutils-dev, libboost-dev, libboost-regex-dev, libboost-date-time-dev, libboost-thread-dev, ${shlibs:Depends}, ${misc:Depends} -Description: SENF Extensible Network Framework, Utilities, development files +Depends: binutils-dev, libboost-dev, libboost-regex-dev, libboost-date-time-dev, libboost-thread-dev +Description: SENF Extensible Network Framework, development files The SENF Simple and Extensible Network Framework aims to be a complete set of libraries to facilitate the development of network applications focusing on network protocols on the layers below the diff --git a/debian/libsenf-dev.install b/debian/libsenf-dev.install new file mode 100644 index 0000000..8c16ec5 --- /dev/null +++ b/debian/libsenf-dev.install @@ -0,0 +1,4 @@ +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 diff --git a/debian/libsenf-packets-dev.install b/debian/libsenf-packets-dev.install deleted file mode 100644 index 5057285..0000000 --- a/debian/libsenf-packets-dev.install +++ /dev/null @@ -1,5 +0,0 @@ -debian/tmp/usr/lib/libPackets.a -debian/tmp/usr/lib/libPackets_*.a -debian/tmp/usr/lib/*.o usr/lib/Packets -debian/tmp/usr/include/Packets -debian/README usr/share/doc/libsenf-packets-dev diff --git a/debian/libsenf-ppi-dev.install b/debian/libsenf-ppi-dev.install deleted file mode 100644 index 1f5ac66..0000000 --- a/debian/libsenf-ppi-dev.install +++ /dev/null @@ -1,3 +0,0 @@ -debian/tmp/usr/lib/libPPI.a -debian/tmp/usr/include/PPI -debian/README usr/share/doc/libsenf-ppi-dev diff --git a/debian/libsenf-scheduler-dev.install b/debian/libsenf-scheduler-dev.install deleted file mode 100644 index 8c95c57..0000000 --- a/debian/libsenf-scheduler-dev.install +++ /dev/null @@ -1,3 +0,0 @@ -debian/tmp/usr/lib/libScheduler.a -debian/tmp/usr/include/Scheduler -debian/README usr/share/doc/libsenf-scheduler-dev diff --git a/debian/libsenf-socket-dev.install b/debian/libsenf-socket-dev.install deleted file mode 100644 index b8441a1..0000000 --- a/debian/libsenf-socket-dev.install +++ /dev/null @@ -1,3 +0,0 @@ -debian/tmp/usr/lib/libSocket.a -debian/tmp/usr/include/Socket -debian/README usr/share/doc/libsenf-socket-dev diff --git a/debian/libsenf-utils-dev.install b/debian/libsenf-utils-dev.install deleted file mode 100644 index a1c3e5d..0000000 --- a/debian/libsenf-utils-dev.install +++ /dev/null @@ -1,3 +0,0 @@ -debian/tmp/usr/lib/libUtils.a -debian/tmp/usr/include/Utils -debian/README usr/share/doc/libsenf-utils-dev diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index 0719475..fd969c5 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -248,7 +248,8 @@ def MakeEnvironment(): LINKFLAGS = [ '-g' ]) env.Append(CPPDEFINES = [ '$EXTRA_DEFINES' ], - LIBS = [ '$EXTRA_LIBS' ]) + LIBS = [ '$EXTRA_LIBS' ], + ALLLIBS = []) return env