Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 89 lines (75 sloc) 3.384 kb
c5d3bca restructured to build rubygems-packages based on hoe and rake-compiler
Kanis-Küche authored
1 # -*- coding: utf-8 -*-
2 # -*- ruby -*-
3
4 require 'rubygems'
5 require 'hoe'
6 require 'rake/extensiontask'
33a3bf3 @larskanis use rbconfig for calling ruby executable
authored
7 require 'rbconfig'
c5d3bca restructured to build rubygems-packages based on hoe and rake-compiler
Kanis-Küche authored
8
7f3cf8c @larskanis renamed autogenerated files from *.c to *.inc to avoid problems with …
authored
9 CLEAN.include 'ext/pk11_struct_def.inc'
10 CLEAN.include 'ext/pk11_struct_impl.inc'
11 CLEAN.include 'ext/pk11_const_def.inc'
16cf225 @larskanis Wrap all PKCS#11 calls by rb_thread_blocking_region() for Ruby 1.9.
authored
12 CLEAN.include 'ext/pk11_thread_funcs.h'
13 CLEAN.include 'ext/pk11_thread_funcs.c'
7b35d4b Add parser for PKCS#11 structs and generator for Ruby wrapper classes
Lars Kanis authored
14 CLEAN.include 'lib/pkcs11_ext.so'
7f3cf8c @larskanis renamed autogenerated files from *.c to *.inc to avoid problems with …
authored
15 CLEAN.include 'tmp'
7b35d4b Add parser for PKCS#11 structs and generator for Ruby wrapper classes
Lars Kanis authored
16
c5d3bca restructured to build rubygems-packages based on hoe and rake-compiler
Kanis-Küche authored
17 hoe = Hoe.spec 'pkcs11' do
18 developer('Ryosuke Kutsuna', 'ryosuke@deer-n-horse.jp')
19 developer('GOTOU Yuuzou', 'gotoyuzo@notwork.org')
20 developer('Lars Kanis', 'kanis@comcard.de')
be740f6 add development dependency gems
Isabel Kanis authored
21 extra_dev_deps << ['yard', '>= 0.6']
22 extra_dev_deps << ['rake-compiler', '>= 0.7']
3b8c837 @larskanis always use different extension dirs for ruby 1.8 and 1.9
authored
23
12b7ed0 Add project homepage to Rakefile, because it's misinterpretet from RE…
Kanis-Küche authored
24 self.url = 'http://github.com/larskanis/pkcs11'
dca40ba Add summary and description to Rakefile - were missing for the 0.1.0 …
Kanis-Küche authored
25 self.summary = 'PKCS#11 binding for Ruby'
26 self.description = 'This module allows Ruby programs to interface with "RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki)".'
27
9713aa5 Updated README file
Kanis-Küche authored
28 self.readme_file = 'README.rdoc'
e15e8e8 include pk11.c into rdoc to get PKCS.open documented
Kanis-Küche authored
29 self.extra_rdoc_files << self.readme_file << 'ext/pk11.c'
dce3a0c Adding "fat gem" compatible loader, set the default RUBY_CC_VERSION
Kanis-Küche authored
30 spec_extras[:extensions] = 'ext/extconf.rb'
7b35d4b Add parser for PKCS#11 structs and generator for Ruby wrapper classes
Lars Kanis authored
31 spec_extras[:files] = File.read_utf("Manifest.txt").split(/\r?\n\r?/)
7f3cf8c @larskanis renamed autogenerated files from *.c to *.inc to avoid problems with …
authored
32 spec_extras[:files] << 'ext/pk11_struct_impl.inc'
33 spec_extras[:files] << 'ext/pk11_struct_def.inc'
16cf225 @larskanis Wrap all PKCS#11 calls by rb_thread_blocking_region() for Ruby 1.9.
authored
34 spec_extras[:files] << 'ext/pk11_const_def.inc'
35 spec_extras[:files] << 'ext/pk11_thread_funcs.h'
36 spec_extras[:files] << 'ext/pk11_thread_funcs.c'
263496e @larskanis add generating and publish task for yardoc, mark gem as yard-based
authored
37 spec_extras[:has_rdoc] = 'yard'
c5d3bca restructured to build rubygems-packages based on hoe and rake-compiler
Kanis-Küche authored
38 end
39
13f1cc0 @larskanis don't overwrite RUBY_CC_VERSION if already defined
authored
40 ENV['RUBY_CC_VERSION'] ||= '1.8.6:1.9.2'
dce3a0c Adding "fat gem" compatible loader, set the default RUBY_CC_VERSION
Kanis-Küche authored
41
42 Rake::ExtensionTask.new('pkcs11_ext', hoe.spec) do |ext|
43 ext.ext_dir = 'ext'
c5d3bca restructured to build rubygems-packages based on hoe and rake-compiler
Kanis-Küche authored
44 ext.cross_compile = true # enable cross compilation (requires cross compile toolchain)
45 ext.cross_platform = ['i386-mswin32', 'i386-mingw32'] # forces the Windows platform instead of the default one
46 end
47
16cf225 @larskanis Wrap all PKCS#11 calls by rb_thread_blocking_region() for Ruby 1.9.
authored
48 file 'ext/extconf.rb' => ['ext/pk11_struct_def.inc', 'ext/pk11_thread_funcs.c']
7f3cf8c @larskanis renamed autogenerated files from *.c to *.inc to avoid problems with …
authored
49 file 'ext/pk11_struct_def.inc' => 'ext/generate_structs.rb' do
ca666a2 @larskanis refactured code generation for PKCS#11 structs and constants
authored
50 sh "#{Config::CONFIG['ruby_install_name']} ext/generate_structs.rb --def ext/pk11_struct_def.inc --impl ext/pk11_struct_impl.inc --doc ext/pk11_struct.doc ext/include/pkcs11t.h"
7b35d4b Add parser for PKCS#11 structs and generator for Ruby wrapper classes
Lars Kanis authored
51 end
7f3cf8c @larskanis renamed autogenerated files from *.c to *.inc to avoid problems with …
authored
52 file 'ext/pk11_struct_impl.inc' => 'ext/pk11_struct_def.inc'
ca666a2 @larskanis refactured code generation for PKCS#11 structs and constants
authored
53 file 'ext/pk11_const_def.inc' => 'ext/generate_constants.rb' do
54 sh "#{Config::CONFIG['ruby_install_name']} ext/generate_constants.rb --const ext/pk11_const_def.inc ext/include/pkcs11t.h"
55 end
7f3cf8c @larskanis renamed autogenerated files from *.c to *.inc to avoid problems with …
authored
56 file 'ext/pk11.c' => 'ext/pk11_struct_def.inc'
ca666a2 @larskanis refactured code generation for PKCS#11 structs and constants
authored
57 file 'ext/pk11_const.c' => 'ext/pk11_const_def.inc'
7b35d4b Add parser for PKCS#11 structs and generator for Ruby wrapper classes
Lars Kanis authored
58
16cf225 @larskanis Wrap all PKCS#11 calls by rb_thread_blocking_region() for Ruby 1.9.
authored
59 file 'ext/pk11_thread_funcs.h' => 'ext/generate_thread_funcs.rb' do
33a3bf3 @larskanis use rbconfig for calling ruby executable
authored
60 sh "#{Config::CONFIG['ruby_install_name']} ext/generate_thread_funcs.rb --impl ext/pk11_thread_funcs.c --decl ext/pk11_thread_funcs.h ext/include/pkcs11f.h"
16cf225 @larskanis Wrap all PKCS#11 calls by rb_thread_blocking_region() for Ruby 1.9.
authored
61 end
62 file 'ext/pk11_thread_funcs.c' => 'ext/pk11_thread_funcs.h'
63 file 'ext/pk11.h' => 'ext/pk11_thread_funcs.h'
64
263496e @larskanis add generating and publish task for yardoc, mark gem as yard-based
authored
65 desc "Generate static HTML documentation with YARD"
66 task :yardoc do
67 sh "yardoc"
68 end
69
70 desc "Publish YARD to wherever you want."
71 task :publish_yard => [:yardoc] do
72 rdoc_locations = hoe.rdoc_locations
73 warn "no rdoc_location values" if rdoc_locations.empty?
74 rdoc_locations.each do |dest|
75 sh %{rsync -av --delete doc/ #{dest}}
76 end
77 end
78
f9b98d0 @larskanis deactivated github upload
authored
79 # RDoc-upload task for github (currently on rubyforge)
80 #
81 # require 'grancher/task'
82 # Grancher::Task.new do |g|
83 # g.branch = 'gh-pages' # alternatively, g.refspec = 'ghpages:/refs/heads/ghpages'
84 # g.push_to = 'origin'
85 # g.directory 'doc'
86 # end
cb0cde7 add grancher task for publishing rdoc to github
Kanis-Küche authored
87
c5d3bca restructured to build rubygems-packages based on hoe and rake-compiler
Kanis-Küche authored
88 # vim: syntax=ruby
Something went wrong with that request. Please try again.