[DRE-maint] Packaging setup.rb?

Gunnar Wolf gwolf at gwolf.org
Fri Nov 9 18:20:43 UTC 2007


Paul van Tilburg dijo [Fri, Nov 09, 2007 at 10:46:05AM +0100]:
> > Of course - but we can symlink it. We could even make it part of our
> > cdbs class - If no ./setup.rb is found, then at the beginning of the
> > build phase we can 'ln -s /usr/lib/ruby/1.8/setup.rb setup.rb', and
> > remove it in clean if it is a symlink. What do you think?
> 
> This doesn't work in the case that the upstream source has an old
> setup.rb.

Of course, as backwards compatibility is not guaranteed. Anyway,
sometimes code is more expressive than words - What do you think of:

------------------------------------------------------------
--- /usr/share/ruby-pkg-tools/1/class/ruby-setup-rb.mk	2006-08-19 21:29:37.000000000 -0500
+++ /tmp/ruby-setup-rb.mk	2007-11-09 12:18:24.000000000 -0600
@@ -34,6 +34,7 @@
 
 include /usr/share/ruby-pkg-tools/1/class/ruby-common.mk
 
+PACKAGED_RUBY_SETUP_CMD = /usr/lib/ruby/1.8/setup.rb
 DEB_RUBY_SETUP_CMD = setup.rb
 DEB_RUBY_CONFIG_ARGS = --siteruby=$(DEB_RUBY_LIBDIR) --siterubyver=$(DEB_RUBY_LIBDIR)/$(cdbs_ruby_ver)
 DEB_RUBY_CLEAN_TARGET = distclean
@@ -41,6 +42,7 @@
 
 # Build simple packages
 $(patsubst %,build/%,$(DEB_RUBY_SIMPLE_PACKAGES)) :: build/% :
+	[ -f $(DEB_RUBY_SETUP_CMD) ] || ln -s $(PACKAGED_RUBY_SETUP_CMD) $(DEB_RUBY_SETUP_CMD)
 	cd $(DEB_SRCDIR) && /usr/bin/ruby $(DEB_RUBY_SETUP_CMD) config $(DEB_RUBY_CONFIG_ARGS) && /usr/bin/ruby $(DEB_RUBY_SETUP_CMD) setup
 	$(call push_cfg_file,$(cdbs_curpkg))
 
@@ -67,5 +69,6 @@
 	/usr/bin/ruby $(DEB_RUBY_SETUP_CMD) config $(DEB_RUBY_CONFIG_ARGS)
 	/usr/bin/ruby $(DEB_RUBY_SETUP_CMD) $(DEB_RUBY_CLEAN_TARGET)
 	rm -f $(DEB_SRCDIR)/.config-*
+	[ -L $(DEB_RUBY_SETUP_CMD) ] && rm -f $(DEB_RUBY_SETUP_CMD)
 
 endif
------------------------------------------------------------

Greetings,

-- 
Gunnar Wolf - gwolf at gwolf.org - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973  F800 D80E F35A 8BB5 27AF



More information about the Pkg-ruby-extras-maintainers mailing list