Package: rhash / 1.2.9-8+deb7u1

01_configure-bindings.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Description: build dependencies corrected
 The patch fixes failed concurent builds of language bindings.
 Build targets now depend on configuration ones.

Author: Antonio Terceiro
Origin: other
Bug-Debian: http://bugs.debian.org/676110
Forwarded: not-needed
Reviewed-By: Aleksey Kravchenko <rhash.admin@gmail.com>
Last-Update: 2012-06-16

--- rhash-1.2.9.orig/bindings/Makefile
+++ rhash-1.2.9/bindings/Makefile
@@ -20,23 +20,30 @@ build: $(patsubst %, build-%, $(BINDINGS
 test: $(patsubst %, test-%, $(BINDINGS))
 install: $(patsubst %, install-%, $(filter perl ruby, $(BINDINGS)))
 
-configure-perl:
+configure-perl: perl/Makefile
+configure-ruby: ruby1.8/Makefile ruby1.9.1/Makefile
+
+perl/Makefile: perl/Makefile.PL
 	cd perl && perl Makefile.PL INSTALLDIRS=vendor
 
-configure-ruby:
-	$(RUBY) -C ruby extconf.rb
+ruby1.8/Makefile: ruby/extconf.rb
+	mkdir -p ruby1.8 && ruby1.8 -C ruby1.8 ../ruby/extconf.rb
+
+ruby1.9.1/Makefile: ruby/extconf.rb
+	mkdir -p ruby1.9.1 && ruby1.9.1 -C ruby1.9.1 ../ruby/extconf.rb
 
 build-java:
 	$(MAKE) -C java/
 
-build-perl:
+build-perl: configure-perl
 	$(MAKE) -C perl OPTIMIZE="$(PERL_OPTIMIZE)"
 
 build-python:
 # not required
 
-build-ruby:
-	$(MAKE) -C ruby
+build-ruby: configure-ruby
+	$(MAKE) -C ruby1.8
+	$(MAKE) -C ruby1.9.1
 
 build-mono:
 	$(MAKE) -C mono
@@ -48,7 +55,8 @@ test-perl:
 	$(MAKE) -C perl test
 
 test-ruby:
-	$(RUBY) -C ruby test_rhash.rb
+	ruby1.8   -C ruby1.8   -I. ../ruby/test_rhash.rb
+	ruby1.9.1 -C ruby1.9.1 -I. ../ruby/test_rhash.rb
 
 test-mono:
 	$(MAKE) -C mono test
@@ -57,7 +65,8 @@ test-python:
 	$(PYTHON) python/test_rhash.py
 
 install-ruby:
-	$(MAKE) -C ruby install DESTDIR=$(DESTDIR) sitedir=$(DESTDIR)/usr/lib/ruby
+	$(MAKE) -C ruby1.8   install DESTDIR=$(DESTDIR) sitedir=$(DESTDIR)/usr/lib/ruby
+	$(MAKE) -C ruby1.9.1 install DESTDIR=$(DESTDIR) sitedir=$(DESTDIR)/usr/lib/ruby
 
 install-perl:
 	$(MAKE) -C perl install DESTDIR=$(DESTDIR)
@@ -79,6 +88,7 @@ gzip: distclean
 distclean:
 	$(MAKE) -C java distclean
 	$(MAKE) -C mono clean
-	[ ! -f ruby/Makefile ] || $(MAKE) -C ruby distclean
+	[ ! -d ruby1.8 ] || $(RM) -r ruby1.8
+	[ ! -d ruby1.9.1 ] || $(RM) -r ruby1.9.1
 	[ ! -f perl/Makefile ] || $(MAKE) -C perl distclean
 	rm -f python/*.pyc
--- rhash-1.2.9.orig/bindings/ruby/extconf.rb
+++ rhash-1.2.9/bindings/ruby/extconf.rb
@@ -1,7 +1,7 @@
 require 'mkmf'
 
 if ENV['LIBRHASH_INC'] and ENV['LIBRHASH_LD']
-    $CFLAGS  += ENV['LIBRHASH_INC']
+    $CFLAGS  += ' ' + ENV['LIBRHASH_INC']
     $LDFLAGS += ' ' + ENV['LIBRHASH_LD']
 else
     have_header('rhash/rhash.h')