Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 100 lines (83 sloc) 3.762 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 Lars Kanis 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 Lars Kanis 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 Lars Kanis renamed autogenerated files from *.c to *.inc to avoid problems with ext...
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 Lars Kanis 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 READM...
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 rel...
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'
b30fa69 Lars Kanis Ignore files stating with "pkcs11_". They belong to seperated packages. ...
authored
36 spec_extras[:files] = File.read_utf("Manifest.txt").split(/\r?\n\r?/).reject{|f| f=~/^pkcs11_/ }
f9ceba6 Lars Kanis remove duplicated list of generated files
authored
37 spec_extras[:files] += GENERATED_FILES
263496e Lars Kanis 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
1532a56 Lars Kanis use Ruby 1.8.7 per default for win32 cross compilation
authored
41 ENV['RUBY_CC_VERSION'] ||= '1.8.7: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)
28db7c6 Lars Kanis remove cross_platform target i386-mswin32, since it isn't in wide use an...
authored
46 ext.cross_platform = ['i386-mingw32'] # forces the Windows platform instead of the default one
c5d3bca restructured to build rubygems-packages based on hoe and rake-compiler
Kanis-Küche authored
47 end
48
16cf225 Lars Kanis 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 Lars Kanis renamed autogenerated files from *.c to *.inc to avoid problems with ext...
authored
50 file 'ext/pk11_struct_def.inc' => 'ext/generate_structs.rb' do
9f535f5 Lars Kanis replace deprecated Config in favor of RbConfig
authored
51 sh "#{RbConfig::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 Lars Kanis renamed autogenerated files from *.c to *.inc to avoid problems with ext...
authored
53 file 'ext/pk11_struct_impl.inc' => 'ext/pk11_struct_def.inc'
e5e8995 Lars Kanis renamed PKCS11::Safenet to PKCS11::ProtectServer - Safenet has two produ...
authored
54 file 'ext/pk11_struct.doc' => 'ext/pk11_struct_def.inc'
55
ca666a2 Lars Kanis refactured code generation for PKCS#11 structs and constants
authored
56 file 'ext/pk11_const_def.inc' => 'ext/generate_constants.rb' do
9f535f5 Lars Kanis replace deprecated Config in favor of RbConfig
authored
57 sh "#{RbConfig::CONFIG['ruby_install_name']} ext/generate_constants.rb --const ext/pk11_const_def.inc ext/include/pkcs11t.h"
ca666a2 Lars Kanis refactured code generation for PKCS#11 structs and constants
authored
58 end
818adb9 Lars Kanis 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 Lars Kanis 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
9f535f5 Lars Kanis replace deprecated Config in favor of RbConfig
authored
63 sh "#{RbConfig::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 Lars Kanis 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
9630e9c Lars Kanis add generation of *.doc files as yardoc dependency, use namespace pkcs11...
authored
68 task :docs_of_vendor_extensions do
69 Dir['pkcs11_*'].each do |dir|
70 chdir(dir) do
38271f4 Lars Kanis remove namespace protect_server, since it doesn't work with rake-compile...
authored
71 sh "rake doc_files"
9630e9c Lars Kanis add generation of *.doc files as yardoc dependency, use namespace pkcs11...
authored
72 end
73 end
74 end
75
263496e Lars Kanis add generating and publish task for yardoc, mark gem as yard-based
authored
76 desc "Generate static HTML documentation with YARD"
9630e9c Lars Kanis add generation of *.doc files as yardoc dependency, use namespace pkcs11...
authored
77 task :yardoc=>['ext/pk11_struct.doc', :docs_of_vendor_extensions] do
fe5410e Lars Kanis add a paragraph for vendor specific extensions
authored
78 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 - pkcs11_protect_server/README_PROTECT_SERVER.rdoc"
263496e Lars Kanis add generating and publish task for yardoc, mark gem as yard-based
authored
79 end
80
81 desc "Publish YARD to wherever you want."
82 task :publish_yard => [:yardoc] do
83 rdoc_locations = hoe.rdoc_locations
84 warn "no rdoc_location values" if rdoc_locations.empty?
85 rdoc_locations.each do |dest|
86 sh %{rsync -av --delete doc/ #{dest}}
87 end
88 end
89
f9b98d0 Lars Kanis deactivated github upload
authored
90 # RDoc-upload task for github (currently on rubyforge)
91 #
92 # require 'grancher/task'
93 # Grancher::Task.new do |g|
94 # g.branch = 'gh-pages' # alternatively, g.refspec = 'ghpages:/refs/heads/ghpages'
95 # g.push_to = 'origin'
96 # g.directory 'doc'
97 # end
cb0cde7 add grancher task for publishing rdoc to github
Kanis-Küche authored
98
c5d3bca restructured to build rubygems-packages based on hoe and rake-compiler
Kanis-Küche authored
99 # vim: syntax=ruby
Something went wrong with that request. Please try again.