Removed need for gcc as a dependency for debian packages.
This commit is contained in:
24
Rakefile
24
Rakefile
@@ -7,6 +7,28 @@ Rake::TestTask.new do |t|
|
|||||||
t.test_files = FileList["test/**/t_*.rb"]
|
t.test_files = FileList["test/**/t_*.rb"]
|
||||||
end
|
end
|
||||||
|
|
||||||
task :gem do
|
desc "Create the size_t size macro for c_struct"
|
||||||
|
file 'lib/linux/c_struct_sizeof_size_t.rb' do |t|
|
||||||
|
begin
|
||||||
|
sz = Integer(`echo __SIZEOF_SIZE_T__ | /usr/bin/gcc -E -P -`)
|
||||||
|
File.open(t.name, 'w+') do |fh|
|
||||||
|
fh.puts "module Linux ; class CStruct ; SIZEOF_SIZE_T = #{sz} ; end ; end"
|
||||||
|
end
|
||||||
|
rescue
|
||||||
|
rm_f t.name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Package a gem"
|
||||||
|
task :gem do
|
||||||
|
#
|
||||||
|
# FIXME. If using a gem, fall back on GCC to determine sizeof size_t.
|
||||||
|
#
|
||||||
|
rm_f "lib/linux/c_struct_sizeof_size_t.rb"
|
||||||
sh "gem build netlinkrb.gemspec"
|
sh "gem build netlinkrb.gemspec"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "clean up"
|
||||||
|
task :clean do
|
||||||
|
rm_f "lib/linux/c_struct_sizeof_size_t.rb"
|
||||||
|
end
|
||||||
|
7
debian/changelog
vendored
7
debian/changelog
vendored
@@ -1,3 +1,10 @@
|
|||||||
|
linux-netlink-ruby (0.10-4) unstable; urgency=low
|
||||||
|
|
||||||
|
* Removed dependency on gcc, in favour of having arch-dependent packages
|
||||||
|
which rely on build-time ascertation of sizeof size_t.
|
||||||
|
|
||||||
|
-- Patrick J Cherry <patrick@bytemark.co.uk> Tue, 24 Jan 2012 15:56:46 +0000
|
||||||
|
|
||||||
linux-netlink-ruby (0.10-3) unstable; urgency=low
|
linux-netlink-ruby (0.10-3) unstable; urgency=low
|
||||||
|
|
||||||
* Updated version number to cover the previous changes.
|
* Updated version number to cover the previous changes.
|
||||||
|
10
debian/control
vendored
10
debian/control
vendored
@@ -3,7 +3,7 @@ Maintainer: Matthew Bloch <matthew@bytemark.co.uk>
|
|||||||
Uploaders: Patrick J Cherry <patrick@bytemark.co.uk>
|
Uploaders: Patrick J Cherry <patrick@bytemark.co.uk>
|
||||||
Section: ruby
|
Section: ruby
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Build-Depends: debhelper (>= 7), cdbs, ruby1.8, ruby1.9.1, ruby-pkg-tools
|
Build-Depends: debhelper (>= 7), cdbs, ruby1.8, ruby1.9.1, ruby-pkg-tools, rake
|
||||||
Standards-Version: 3.8.0
|
Standards-Version: 3.8.0
|
||||||
|
|
||||||
Package: liblinux-netlink-ruby
|
Package: liblinux-netlink-ruby
|
||||||
@@ -17,8 +17,8 @@ Description: Netlink socket library for Ruby
|
|||||||
This is the metapackage for all versions of Ruby.
|
This is the metapackage for all versions of Ruby.
|
||||||
|
|
||||||
Package: liblinux-netlink-ruby1.8
|
Package: liblinux-netlink-ruby1.8
|
||||||
Architecture: all
|
Architecture: any
|
||||||
Depends: ruby1.8 (>= 1.8.7), libffi-ruby1.8, gcc, ${misc:Depends}
|
Depends: ruby1.8 (>= 1.8.7), libffi-ruby1.8, ${misc:Depends}
|
||||||
Description: Netlink socket library for Ruby 1.8
|
Description: Netlink socket library for Ruby 1.8
|
||||||
This library provides an API for using a Linux Netlink socket, for doing
|
This library provides an API for using a Linux Netlink socket, for doing
|
||||||
things like manipulating IP interfaces and routes programmatically, and
|
things like manipulating IP interfaces and routes programmatically, and
|
||||||
@@ -28,8 +28,8 @@ Description: Netlink socket library for Ruby 1.8
|
|||||||
|
|
||||||
|
|
||||||
Package: liblinux-netlink-ruby1.9.1
|
Package: liblinux-netlink-ruby1.9.1
|
||||||
Architecture: all
|
Architecture: any
|
||||||
Depends: ruby1.9.1, libffi-ruby1.9.1, gcc, ${misc:Depends}
|
Depends: ruby1.9.1, libffi-ruby1.9.1, ${misc:Depends}
|
||||||
Description: Netlink socket library for Ruby 1.9.1
|
Description: Netlink socket library for Ruby 1.9.1
|
||||||
This library provides an API for using a Linux Netlink socket, for doing
|
This library provides an API for using a Linux Netlink socket, for doing
|
||||||
things like manipulating IP interfaces and routes programmatically, and
|
things like manipulating IP interfaces and routes programmatically, and
|
||||||
|
5
debian/rules
vendored
5
debian/rules
vendored
@@ -4,3 +4,8 @@
|
|||||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
include /usr/share/cdbs/1/rules/debhelper.mk
|
||||||
include /usr/share/ruby-pkg-tools/1/class/ruby-setup-rb.mk
|
include /usr/share/ruby-pkg-tools/1/class/ruby-setup-rb.mk
|
||||||
|
|
||||||
|
makebuilddir::
|
||||||
|
rake lib/linux/c_struct_sizeof_size_t.rb
|
||||||
|
|
||||||
|
clean::
|
||||||
|
rake clean
|
||||||
|
@@ -79,7 +79,13 @@ class CStruct
|
|||||||
define_type :ns, :pattern => "n", :align => true
|
define_type :ns, :pattern => "n", :align => true
|
||||||
define_type :nl, :pattern => "N", :align => true
|
define_type :nl, :pattern => "N", :align => true
|
||||||
|
|
||||||
SIZEOF_SIZE_T = Integer(`echo __SIZEOF_SIZE_T__ | gcc -E -P -`) rescue 1.size
|
begin
|
||||||
|
require 'linux/c_struct_sizeof_size_t.rb'
|
||||||
|
rescue LoadError
|
||||||
|
warn "Falling back to gcc to determine sizeof size_t." if $VERBOSE
|
||||||
|
SIZEOF_SIZE_T = Integer(`echo __SIZEOF_SIZE_T__ | gcc -E -P -`) rescue 1.size
|
||||||
|
end
|
||||||
|
|
||||||
define_type :size_t,
|
define_type :size_t,
|
||||||
case SIZEOF_SIZE_T
|
case SIZEOF_SIZE_T
|
||||||
when 8
|
when 8
|
||||||
|
Reference in New Issue
Block a user