Browse Source

ruby: spin-off ruby-digest from ruby-openssl

Digest can use OpenSSL or ruby internal implementation of hash functions. The first
uses less disk space but requires openssl, that is relatively big. As internal hash
implementations are not too much bigger than openssl version, it is compiled by
default. A new config option can change it to use OpenSSL instead.

As digest is independent from openssl, ruby-digest was created as a new pkgs.

Adds pkgs:
- ruby-digest (from ruby-openssl)

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Luiz Angelo Daros de Luca 10 years ago
parent
commit
c755b298c3
1 changed files with 39 additions and 4 deletions
  1. 39
    4
      lang/ruby/Makefile

+ 39
- 4
lang/ruby/Makefile View File

91
   DEPENDS:=ruby
91
   DEPENDS:=ruby
92
 endef
92
 endef
93
 
93
 
94
+define Package/ruby-digest
95
+$(call Package/ruby/Default)
96
+  TITLE:=Ruby Digest Library
97
+  DEPENDS:=ruby +RUBY_DIGEST_USE_OPENSSL:libopenssl
98
+endef
99
+
100
+define Package/ruby-digest/config
101
+
102
+  config RUBY_DIGEST_USE_OPENSSL
103
+		bool "Use OpenSSL functions for ruby digest hash functions"
104
+        depends on PACKAGE_ruby-digest
105
+		help
106
+			Ruby can use OpenSSL hash functions or compile alternative implementations. Using
107
+			OpenSSL saves about 30KBytes (less when compressed) but requires OpenSSL (that
108
+			is way bigger than that). However, if OpenSSL is already needed by another usage,
109
+			as ruby-openssl or any other non ruby package, it is better to mark this option.
110
+		default n
111
+
112
+endef
113
+
94
 define Package/ruby-dl
114
 define Package/ruby-dl
95
 $(call Package/ruby/Default)
115
 $(call Package/ruby/Default)
96
   TITLE+= (dynamic linker support) (adds 5MB+)
116
   TITLE+= (dynamic linker support) (adds 5MB+)
239
 	--with-ruby-version=minor \
259
 	--with-ruby-version=minor \
240
 	--with-iconv-dir=$(ICONV_PREFIX) \
260
 	--with-iconv-dir=$(ICONV_PREFIX) \
241
 
261
 
262
+ifndef CONFIG_RUBY_DIGEST_USE_OPENSSL
263
+CONFIGURE_ARGS += \
264
+	--with-bundled-sha1\
265
+	--with-bundled-md5\
266
+	--with-bundled-rmd160\
267
+	--with-bundled-sha2 \
268
+
269
+endif
270
+
242
 TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
271
 TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
243
 
272
 
244
 MAKE_FLAGS += \
273
 MAKE_FLAGS += \
360
 	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
389
 	$(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
361
 endef
390
 endef
362
 
391
 
392
+define Package/ruby-digest/install
393
+	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
394
+		usr/lib/ruby/$(PKG_LIBVER)/digest \
395
+		usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
396
+		usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
397
+		usr/lib/ruby/$(PKG_LIBVER)/*/digest/* \
398
+	) | ( cd $(1); $(TAR) -xf - )
399
+endef
400
+
363
 define Package/ruby-dl/install
401
 define Package/ruby-dl/install
364
 	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
402
 	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
365
 		usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
403
 		usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
443
 
481
 
444
 define Package/ruby-openssl/install
482
 define Package/ruby-openssl/install
445
 	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
483
 	( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
446
-		usr/lib/ruby/$(PKG_LIBVER)/digest \
447
-		usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
448
-		usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
449
-		usr/lib/ruby/$(PKG_LIBVER)/*/digest/*.so \
450
 		usr/lib/ruby/$(PKG_LIBVER)/openssl \
484
 		usr/lib/ruby/$(PKG_LIBVER)/openssl \
451
 		usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
485
 		usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
452
 		usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
486
 		usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
556
 $(eval $(call BuildPackage,ruby-core))
590
 $(eval $(call BuildPackage,ruby-core))
557
 $(eval $(call BuildPackage,ruby-bigdecimal))
591
 $(eval $(call BuildPackage,ruby-bigdecimal))
558
 $(eval $(call BuildPackage,ruby-cgi))
592
 $(eval $(call BuildPackage,ruby-cgi))
593
+$(eval $(call BuildPackage,ruby-digest))
559
 $(eval $(call BuildPackage,ruby-dl))
594
 $(eval $(call BuildPackage,ruby-dl))
560
 $(eval $(call BuildPackage,ruby-enc))
595
 $(eval $(call BuildPackage,ruby-enc))
561
 $(eval $(call BuildPackage,ruby-erb))
596
 $(eval $(call BuildPackage,ruby-erb))