Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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