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"]
|
||||
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"
|
||||
end
|
||||
|
||||
desc "clean up"
|
||||
task :clean do
|
||||
rm_f "lib/linux/c_struct_sizeof_size_t.rb"
|
||||
end
|
||||
|
Reference in New Issue
Block a user