Re: Fix for bug http://backtrace.info/ticket/76
- From: "Milosz Derezynski" <internalerror gmail com>
- To: "Jacek Wolszczak" <shutdownrunner o2 pl>
- Cc: GTKmm List <gtkmm-list gnome org>
- Subject: Re: Fix for bug http://backtrace.info/ticket/76
- Date: Sat, 23 Aug 2008 17:05:37 +0200
Thanks! I'll look into the hardcoding.
(I'm CC'ing the reply to Klaus and gtkmm-list.)
2008/8/23 Jacek Wolszczak
<shutdownrunner o2 pl>
Hi
add "debian = SConscript('debian/SConscript')" to SConstruct in sigx main folder. e.g. at line 370
Create "debian" folder and put attached SConscript into it.
Set PREFIX at line 12 in SConscript to point to sigx folder. It has to be an absolute path, otherwise there are some errors.
And then:
- configure prefix and other parameters as usual. scons PREFIX=/usr etc
- execute "scons"
- and then execute "scons debian"
And you'll have a debian package with everything as it ought to be.
As you'll see files in debian/SConscript are hardcoded. No idea how to do it in a different/better way.
import os, shutil, sys
Import('env') # exported by parent SConstruct
# Here's the core info for the package
DEBNAME = "sigx"
DEBVERSION = "2.0"
DEBMAINT = "Jacek Wolszczak [shutdownrunner o2 pl]"
DEBARCH = "i386"
DEBDEPENDS = "libc6 (>= 2.7-12 ), libglib2.0-0 (>= 2.16.4 ), libglibmm-2.4-1c2a (>= 2.16.4 ), libsigc++-2.0-0c2a (>= 2.0.18 )"
DEBDESC = "A really cool utility"
PREFIX= "/home/miles/cvs/sigx-2.0"
DEBFILES = [
# Now we specify the files to be included in the .deb
# Where they should go, and where they should be copied from.
# If you have a lot of files, you may wish to generate this
# list in some other way.
("usr/lib/pkgconfig/sigx-2.0.pc", PREFIX + "/sigx-2.0.pc"),
("usr/lib/libsigx-2.0.so", PREFIX + "/build/release/libsigx-2.0.so"),
("usr/lib/sigx-2.0/sigxconfig.h", PREFIX + "/sigxconfig.h"),
("usr/include/sigx-2.0/sigx/signal_wrapper.h", PREFIX + "/sigx/signal_wrapper.h"),
("usr/include/sigx-2.0/sigx/glib_lockables.h", PREFIX + "/sigx/glib_lockables.h"),
("usr/include/sigx-2.0/sigx/signal_traits.h", PREFIX + "/sigx/signal_traits.h"),
("usr/include/sigx-2.0/sigx/signal_wrapper_base.h", PREFIX + "/sigx/signal_wrapper_base.h"),
("usr/include/sigx-2.0/sigx/signal_source_obj_mem.h", PREFIX + "/sigx/signal_source_obj_mem.h"),
("usr/include/sigx-2.0/sigx/const_trait.h", PREFIX + "/sigx/const_trait.h"),
("usr/include/sigx-2.0/sigx/signal_source_base.h", PREFIX + "/sigx/signal_source_base.h"),
("usr/include/sigx-2.0/sigx/validity_trackable.h", PREFIX + "/sigx/validity_trackable.h"),
("usr/include/sigx-2.0/sigx/lockable_fwddecl.h", PREFIX + "/sigx/lockable_fwddecl.h"),
("usr/include/sigx-2.0/sigx/noninstantiatable.h", PREFIX + "/sigx/noninstantiatable.h"),
("usr/include/sigx-2.0/sigx/ref.h", PREFIX + "/sigx/ref.h"),
("usr/include/sigx-2.0/sigx/connection_handler.h", PREFIX + "/sigx/connection_handler.h"),
("usr/include/sigx-2.0/sigx/signal_source_threadprivate.h", PREFIX + "/sigx/signal_source_threadprivate.h"),
("usr/include/sigx-2.0/sigx/signal_source_func.h", PREFIX + "/sigx/signal_source_func.h"),
("usr/include/sigx-2.0/sigx/static_assert.h", PREFIX + "/sigx/static_assert.h"),
("usr/include/sigx-2.0/sigx/glib_dispatcher.h", PREFIX + "/sigx/glib_dispatcher.h"),
("usr/include/sigx-2.0/sigx/bad_dispatcher.h", PREFIX + "/sigx/bad_dispatcher.h"),
("usr/include/sigx-2.0/sigx/connection_wrapper.h", PREFIX + "/sigx/connection_wrapper.h"),
("usr/include/sigx-2.0/sigx/volatile_trait.h", PREFIX + "/sigx/volatile_trait.h"),
("usr/include/sigx-2.0/sigx/lock_acquirer.h", PREFIX + "/sigx/lock_acquirer.h"),
("usr/include/sigx-2.0/sigx/fwddecl.h", PREFIX + "/sigx/fwddecl.h"),
("usr/include/sigx-2.0/sigx/nonassignable.h", PREFIX + "/sigx/nonassignable.h"),
("usr/include/sigx-2.0/sigx/auto_dispatchable.h", PREFIX + "/sigx/auto_dispatchable.h"),
("usr/include/sigx-2.0/sigx/internal_types.h", PREFIX + "/sigx/internal_types.h"),
("usr/include/sigx-2.0/sigx/request_f.h", PREFIX + "/sigx/request_f.h"),
("usr/include/sigx-2.0/sigx/threadable.h", PREFIX + "/sigx/threadable.h"),
("usr/include/sigx-2.0/sigx/auto_tunneler.h", PREFIX + "/sigx/auto_tunneler.h"),
("usr/include/sigx-2.0/sigx/operator_new.h", PREFIX + "/sigx/operator_new.h"),
("usr/include/sigx-2.0/sigx/tunnel_context_base.h", PREFIX + "/sigx/tunnel_context_base.h"),
("usr/include/sigx-2.0/sigx/types.h", PREFIX + "/sigx/types.h"),
("usr/include/sigx-2.0/sigx/tunnel_context.h", PREFIX + "/sigx/tunnel_context.h"),
("usr/include/sigx-2.0/sigx/sigx.h", PREFIX + "/sigx/sigx.h"),
("usr/include/sigx-2.0/sigx/locking_dispatcher_ptr.h", PREFIX + "/sigx/locking_dispatcher_ptr.h"),
("usr/include/sigx-2.0/sigx/noncopyable.h", PREFIX + "/sigx/noncopyable.h"),
("usr/include/sigx-2.0/sigx/lockable.h", PREFIX + "/sigx/lockable.h"),
("usr/include/sigx-2.0/sigx/nonpointeraliasing.h", PREFIX + "/sigx/nonpointeraliasing.h"),
("usr/include/sigx-2.0/sigx/bad_caller.h", PREFIX + "/sigx/bad_caller.h"),
("usr/include/sigx-2.0/sigx/dispatchable.h", PREFIX + "/sigx/dispatchable.h"),
("usr/include/sigx-2.0/sigx/nonheapallocatable.h", PREFIX + "/sigx/nonheapallocatable.h"),
("usr/include/sigx-2.0/sigx/bad_sync_call.h", PREFIX + "/sigx/bad_sync_call.h"),
("usr/include/sigx-2.0/sigx/signal_f_base.h", PREFIX + "/sigx/signal_f_base.h"),
("usr/include/sigx-2.0/sigx/glib_threadable.h", PREFIX + "/sigx/glib_threadable.h"),
("usr/include/sigx-2.0/sigx/tunnel_functor.h", PREFIX + "/sigx/tunnel_functor.h"),
("usr/include/sigx-2.0/sigx/manual_dispatchable.h", PREFIX + "/sigx/manual_dispatchable.h"),
("usr/include/sigx-2.0/sigx/choose_lock.h", PREFIX + "/sigx/choose_lock.h"),
("usr/include/sigx-2.0/sigx/signal_f.h", PREFIX + "/sigx/signal_f.h"),
("usr/include/sigx-2.0/sigx/shared_dispatchable.h", PREFIX + "/sigx/shared_dispatchable.h"),
("usr/include/sigx-2.0/sigx/dispatcher.h", PREFIX + "/sigx/dispatcher.h"),
("usr/include/sigx-2.0/sigx/private/glib_threadable_p.h", PREFIX + "/sigx/private/glib_threadable_p.h"),
("usr/include/sigx-2.0/sigx/tunnel_validity_tracker.h", PREFIX + "/sigx/tunnel_validity_tracker.h"),
("usr/include/sigx-2.0/sigx/tunnel_base.h", PREFIX + "/sigx/tunnel_base.h"),
("usr/include/sigx-2.0/sigx/glib_auto_dispatchable.h", PREFIX + "/sigx/glib_auto_dispatchable.h"),
]
# This is the debian package we're going to create
debpkg = '#%s_%s_%s.deb' % (DEBNAME, DEBVERSION, DEBARCH)
# and we want it to be built when we build 'debian'
env.Alias("debian", debpkg)
DEBCONTROLFILE = os.path.join(DEBNAME, "DEBIAN/control")
# This copies the necessary files into place into place.
# Fortunately, SCons creates the necessary directories for us.
for f in DEBFILES:
# We put things in a directory named after the package
dest = os.path.join(DEBNAME, f[0])
# The .deb package will depend on this file
env.Depends(debpkg, dest)
# Copy from the the source tree.
env.Command(dest, f[1], Copy('$TARGET','$SOURCE'))
# The control file also depends on each source because we'd like
# to know the total installed size of the package
env.Depends(DEBCONTROLFILE, dest)
# Now to create the control file:
CONTROL_TEMPLATE = """
Package: %s
Priority: extra
Section: misc
Installed-Size: %s
Maintainer: %s
Architecture: %s
Version: %s
Depends: %s
Description: %s
"""
env.Depends(debpkg,DEBCONTROLFILE )
# This function creates the control file from the template and info
# specified above, and works out the final size of the package.
def make_control(target=None, source=None, env=None):
installed_size = 0
for i in DEBFILES:
installed_size += os.stat(str(env.File(i[1])))[6]
control_info = CONTROL_TEMPLATE % (
DEBNAME, installed_size, DEBMAINT, DEBARCH, DEBVERSION,
DEBDEPENDS, DEBDESC)
f = open(str(target[0]), 'w')
f.write(control_info)
f.close()
# We can generate the control file by calling make_control
env.Command(DEBCONTROLFILE, None, make_control)
# And we can generate the .deb file by calling dpkg-deb
env.Command(debpkg, DEBCONTROLFILE,
"dpkg-deb -b %s %s" % ("debian/%s" % DEBNAME, "$TARGET"))
--
Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]