Packaging pure ruby files when using extconf.rb

P

Paul William

Hi,

I am writing a C extension but I want to include some classes written in
pure ruby. How can I package the pure ruby files so that it is install
when the user runs
ruby extconf.rb && make && make install

Thanks

Paul
 
M

Mauricio Fernández

Hi,

I am writing a C extension but I want to include some classes written in
pure ruby. How can I package the pure ruby files so that it is install
when the user runs
ruby extconf.rb && make && make install

You can use Minero Aoki's install.rb

* put extconf.rb + sources in ext/extname/
* create a MANIFEST file in ext/extname, containing the names of all files
in that dir
* put the .rb files in lib/

Add README, TODO, LICENSE, etc in the top dir (and install.rb of course :)
and you have a nice 'standard' package.

--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Win95 is not a virus; a virus does something.
-- unknown source
 
M

maillist

You can use Minero Aoki's install.rb

* put extconf.rb + sources in ext/extname/
* create a MANIFEST file in ext/extname, containing the names of all files
in that dir
* put the .rb files in lib/

Add README, TODO, LICENSE, etc in the top dir (and install.rb of course :)
and you have a nice 'standard' package.

Where do I get install.rb?
 
T

ts

m> How would I do that?

svg% ls -R
.:
extconf.rb lib/ test.c test.rb*

./lib:
b.rb*
svg%

svg% ruby extconf.rb
creating Makefile
svg%

svg% make
gcc -fPIC -g -O2 -I. -I/usr/local/lib/ruby/1.8/i686-linux -I/usr/local/lib/ruby/1.8/i686-linux -I. -c test.c
gcc -shared -L"/usr/local/lib" -o mytest.so test.o -ldl -lcrypt -lm -lc
svg%

svg# make install
mytest.so -> /usr/local/lib/ruby/site_ruby/1.8/i686-linux/mytest.so
chmod 0755 /usr/local/lib/ruby/site_ruby/1.8/i686-linux/mytest.so
./lib/b.rb -> /usr/local/lib/ruby/site_ruby/1.8/b.rb
chmod 0644 /usr/local/lib/ruby/site_ruby/1.8/b.rb
svg#



Guy Decoux
 
M

Mauricio Fernández

Where do I get install.rb?

http://raa.ruby-lang.org/list.rhtml?name=setup


--
_ _
| |__ __ _| |_ ___ _ __ ___ __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Try to remove the color-problem by restarting your computer several times.
-- Microsoft-Internet Explorer README.TXT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top