[Pkg-ruby-extras-maintainers] r349 - in tools/ruby-pkg-tools/trunk: 1/class debian

Thierry Reding beatle-guest at costa.debian.org
Fri Feb 24 17:57:46 UTC 2006


Author: beatle-guest
Date: 2006-02-24 17:57:45 +0000 (Fri, 24 Feb 2006)
New Revision: 349

Added:
   tools/ruby-pkg-tools/trunk/1/class/ruby-common.mk
   tools/ruby-pkg-tools/trunk/1/class/ruby-extconf-rb.mk
Modified:
   tools/ruby-pkg-tools/trunk/1/class/ruby-setup-rb.mk
   tools/ruby-pkg-tools/trunk/debian/changelog
Log:
* This has been sitting in my working copy way too long. This provides a CDBS
  class which can be used with packages that ship an extconf.rb script. The
  class has some code in common with ruby-setup-rb.mk, so I split those parts
  into a separate file.


Added: tools/ruby-pkg-tools/trunk/1/class/ruby-common.mk
===================================================================
--- tools/ruby-pkg-tools/trunk/1/class/ruby-common.mk	2006-02-18 11:44:44 UTC (rev 348)
+++ tools/ruby-pkg-tools/trunk/1/class/ruby-common.mk	2006-02-24 17:57:45 UTC (rev 349)
@@ -0,0 +1,66 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2005 Esteban Manchado Velázquez <zoso at debian.org>
+# Copied from python-distutils.mk,
+#             Copyright © 2003 Colin Walters <walters at debian.org>,
+#             then adapted to Ruby conventions
+# 
+# Description: configure, compile, binary, and clean Ruby libraries and programs
+#  This class works for Ruby packages which use the setup.rb script.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA.
+
+ifndef _cdbs_bootstrap
+_cdbs_scripts_path ?= /usr/lib/cdbs
+_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+_cdbs_class_path ?= /usr/share/cdbs/1/class
+endif
+
+ifndef _cdbs_class_ruby_common
+_cdbs_class_ruby_common := 1
+
+include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
+include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+
+DEB_RUBY_COMPILE_VERSION = 
+
+DEB_RUBY_VERSIONS = 1.6 1.8 1.9
+DEB_RUBY_LIBDIR=/usr/lib/ruby # FIXME: hardcoded!
+
+# Separate lib packages from the rest
+LIB_PACKAGE_FILTER = %-ruby $(patsubst %,\%-ruby%,$(DEB_RUBY_VERSIONS))
+LIB_DOC_PACKAGE_FILTER = %-ruby-doc
+DEB_RUBY_LIB_PACKAGES := $(strip $(filter $(LIB_PACKAGE_FILTER),$(DEB_ALL_PACKAGES)))
+DEB_RUBY_REAL_LIB_PACKAGES := $(strip $(filter-out %-ruby, $(DEB_RUBY_LIB_PACKAGES)))
+DEB_RUBY_DUMMY_LIB_PACKAGES := $(strip $(filter %-ruby, $(DEB_RUBY_LIB_PACKAGES)))
+DEB_RUBY_LIB_DOC_PACKAGES := $(strip $(filter $(LIB_DOC_PACKAGE_FILTER),$(DEB_ALL_PACKAGES)))
+ifeq (,$(DEB_RUBY_REAL_LIB_PACKAGES))
+DEB_RUBY_SIMPLE_PACKAGES := $(strip $(filter-out $(LIB_PACKAGE_FILTER),$(DEB_ALL_PACKAGES)))
+endif
+
+cdbs_ruby_ver = $(filter-out %-,$(subst -ruby,- ,$(cdbs_curpkg)))
+
+push_cfg_file = if [ -f $(DEB_SRCDIR)/.config ]; then mv -f $(DEB_SRCDIR)/.config $(DEB_SRCDIR)/.config-$(1); fi
+pop_cfg_file  = if [ -f $(DEB_SRCDIR)/.config-$(1) ]; then mv -f $(DEB_SRCDIR)/.config-$(1) $(DEB_SRCDIR)/.config; fi
+
+# Generate rdoc documentation for *-doc packages
+# Just be sure you include debhelper.mk before including this file.
+ifdef _cdbs_rules_debhelper
+$(patsubst %,binary-install/%,$(DEB_RUBY_LIB_DOC_PACKAGES)) :: binary-install/% :
+	dh_rdoc -p$(cdbs_curpkg)
+endif
+
+endif
+

Added: tools/ruby-pkg-tools/trunk/1/class/ruby-extconf-rb.mk
===================================================================
--- tools/ruby-pkg-tools/trunk/1/class/ruby-extconf-rb.mk	2006-02-18 11:44:44 UTC (rev 348)
+++ tools/ruby-pkg-tools/trunk/1/class/ruby-extconf-rb.mk	2006-02-24 17:57:45 UTC (rev 349)
@@ -0,0 +1,48 @@
+# -*- mode: makefile; coding: utf-8 -*-
+# Copyright © 2006 Thierry Reding <thierry at doppeltgemoppelt.de>
+# Description:
+#
+
+ifndef _cdbs_bootstrap
+	_cdbs_scripts_path ?= /usr/lib/cdbs
+	_cdbs_rules_path ?= /usr/share/cdbs/1/rules
+	_cdbs_class_path ?= /usr/share/cdbs/1/class
+endif
+
+ifndef _cdbs_class_ruby-extconf-rb
+_cdbs_class_ruby-extconf-rb := 1
+
+include /usr/share/ruby-pkg-tools/1/class/ruby-common.mk
+
+DEB_RUBY_SETUP_CMD = extconf.rb
+DEB_RUBY_SETUP_ARGS =
+
+cdbs_pkgdir = $(CURDIR)/debian/$(cdbs_curpkg)
+
+DEB_RUBY_INSTALL_ARGS = DESTDIR=$(cdbs_pkgdir) \
+	sitelibdir=$(cdbs_pkgdir)$(strip $(DEB_RUBY_LIBDIR))/$(cdbs_ruby_ver)
+
+# Build simple packages.
+$(patsubst %,build/%,$(DEB_RUBY_SIMPLE_PACKAGES)) :: build/% :
+	cd $(DEB_SRCDIR)
+	/usr/bin/ruby $(DEB_RUBY_SETUP_CMD) $(DEB_RUBY_SETUP_ARGS)
+	$(MAKE)
+
+# Install simple packages.
+$(patsubst %,install/%,$(DEB_RUBY_SIMPLE_PACKAGES)) :: install/% :
+	cd $(DEB_SRCDIR)
+	$(MAKE) install $(DEB_RUBY_INSTALL_ARGS)
+
+# Install regular library packages.
+$(patsubst %,install/%,$(DEB_RUBY_REAL_LIB_PACKAGES)) :: install/% :
+	cd $(DEB_SRCDIR) 
+	-$(MAKE) distclean
+	/usr/bin/ruby$(cdbs_ruby_ver) $(DEB_RUBY_SETUP_CMD) $(DEB_RUBY_SETUP_ARGS)
+	$(MAKE)
+	$(MAKE) install $(DEB_RUBY_INSTALL_ARGS)
+
+clean::
+	-$(MAKE) distclean
+
+endif
+

Modified: tools/ruby-pkg-tools/trunk/1/class/ruby-setup-rb.mk
===================================================================
--- tools/ruby-pkg-tools/trunk/1/class/ruby-setup-rb.mk	2006-02-18 11:44:44 UTC (rev 348)
+++ tools/ruby-pkg-tools/trunk/1/class/ruby-setup-rb.mk	2006-02-24 17:57:45 UTC (rev 349)
@@ -32,39 +32,12 @@
 ifndef _cdbs_class_ruby_setup_rb
 _cdbs_class_ruby_setup_rb := 1
 
-include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
-include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
+include /usr/share/ruby-pkg-tools/1/class/ruby-common.mk
 
-DEB_RUBY_COMPILE_VERSION = 
-
-DEB_RUBY_VERSIONS = 1.6 1.8 1.9
-DEB_RUBY_LIBDIR=/usr/lib/ruby # FIXME: hardcoded!
-
 DEB_RUBY_SETUP_CMD = setup.rb
 DEB_RUBY_CONFIG_ARGS = --siteruby=$(DEB_RUBY_LIBDIR)
 
-# Separate lib packages from the rest
-LIB_PACKAGE_FILTER = %-ruby $(patsubst %,\%-ruby%,$(DEB_RUBY_VERSIONS))
-LIB_DOC_PACKAGE_FILTER = %-ruby-doc
-DEB_RUBY_LIB_PACKAGES := $(strip $(filter $(LIB_PACKAGE_FILTER),$(DEB_ALL_PACKAGES)))
-DEB_RUBY_REAL_LIB_PACKAGES := $(strip $(filter-out %-ruby, $(DEB_RUBY_LIB_PACKAGES)))
-DEB_RUBY_DUMMY_LIB_PACKAGES := $(strip $(filter %-ruby, $(DEB_RUBY_LIB_PACKAGES)))
-DEB_RUBY_LIB_DOC_PACKAGES := $(strip $(filter $(LIB_DOC_PACKAGE_FILTER),$(DEB_ALL_PACKAGES)))
-ifeq (,$(DEB_RUBY_REAL_LIB_PACKAGES))
-DEB_RUBY_SIMPLE_PACKAGES := $(strip $(filter-out $(LIB_PACKAGE_FILTER),$(DEB_ALL_PACKAGES)))
-endif
 
-cdbs_ruby_ver = $(filter-out %-,$(subst -ruby,- ,$(cdbs_curpkg)))
-
-push_cfg_file = if [ -f $(DEB_SRCDIR)/.config ]; then mv -f $(DEB_SRCDIR)/.config $(DEB_SRCDIR)/.config-$(1); fi
-pop_cfg_file  = if [ -f $(DEB_SRCDIR)/.config-$(1) ]; then mv -f $(DEB_SRCDIR)/.config-$(1) $(DEB_SRCDIR)/.config; fi
-
-
-# Build regular library packages
-$(patsubst %,build/%,$(DEB_RUBY_REAL_LIB_PACKAGES)) :: build/% :
-	cd $(DEB_SRCDIR) && /usr/bin/ruby$(cdbs_ruby_ver) $(DEB_RUBY_SETUP_CMD) config $(DEB_RUBY_CONFIG_ARGS) && /usr/bin/ruby$(cdbs_ruby_ver) $(DEB_RUBY_SETUP_CMD) setup
-	$(call push_cfg_file,$(cdbs_curpkg))
-
 # Build simple packages
 $(patsubst %,build/%,$(DEB_RUBY_SIMPLE_PACKAGES)) :: build/% :
 	cd $(DEB_SRCDIR) && /usr/bin/ruby $(DEB_RUBY_SETUP_CMD) config $(DEB_RUBY_CONFIG_ARGS) && /usr/bin/ruby $(DEB_RUBY_SETUP_CMD) setup
@@ -74,7 +47,11 @@
 # Install regular library packages
 $(patsubst %,install/%,$(DEB_RUBY_REAL_LIB_PACKAGES)) :: install/% :
 	$(call pop_cfg_file,$(cdbs_curpkg))
-	cd $(DEB_SRCDIR) && /usr/bin/ruby$(cdbs_ruby_ver) $(DEB_RUBY_SETUP_CMD) install --prefix=debian/$(cdbs_curpkg)
+	cd $(DEB_SRCDIR)
+	/usr/bin/ruby$(cdbs_ruby_ver) $(DEB_RUBY_SETUP_CMD) distclean
+	/usr/bin/ruby$(cdbs_ruby_ver) $(DEB_RUBY_SETUP_CMD) config $(DEB_RUBY_CONFIG_ARGS)
+	/usr/bin/ruby$(cdbs_ruby_ver) $(DEB_RUBY_SETUP_CMD) setup
+	/usr/bin/ruby$(cdbs_ruby_ver) $(DEB_RUBY_SETUP_CMD) install --prefix=debian/$(cdbs_curpkg)
 	$(call push_cfg_file,$(cdbs_curpkg))
 
 # Install simple packages
@@ -83,14 +60,7 @@
 	cd $(DEB_SRCDIR) && /usr/bin/ruby $(DEB_RUBY_SETUP_CMD) install --prefix=debian/$(cdbs_curpkg)
 	$(call push_cfg_file,$(cdbs_curpkg))
 
-# Generate rdoc documentation for *-doc packages
-# Just be sure you include debhelper.mk before including this file.
-ifdef _cdbs_rules_debhelper
-$(patsubst %,binary-install/%,$(DEB_RUBY_LIB_DOC_PACKAGES)) :: binary-install/% :
-	dh_rdoc -p$(cdbs_curpkg)
-endif
 
-
 clean::
 # Ignore errors from this rule.  In a tarball build, the file
 # may not exist.

Modified: tools/ruby-pkg-tools/trunk/debian/changelog
===================================================================
--- tools/ruby-pkg-tools/trunk/debian/changelog	2006-02-18 11:44:44 UTC (rev 348)
+++ tools/ruby-pkg-tools/trunk/debian/changelog	2006-02-24 17:57:45 UTC (rev 349)
@@ -1,4 +1,4 @@
-ruby-pkg-tools (0.7) UNRELEASED; urgency=low
+ruby-pkg-tools (0.7) unstable; urgency=low
 
   [ Paul van Tilburg ]
   * NOT RELEASED YET
@@ -18,8 +18,13 @@
      + Added support for HTTP redirections.
   * Added upstream tarball for the liblog4r-ruby package.
   * Added upstream tarball for the libgpgme-ruby package.
+  * The CDBS class now correctly builds library packages for different Ruby
+    versions.
+  * Added a CDBS class for extconf.rb based Ruby packages. I've also split off
+    some of the common code from the setup.rb class so that it can be shared
+    by both ruby-setup-rb and ruby-extconf-rb classes.
 
- -- Lucas Nussbaum <lucas at lucas-nussbaum.net>  Fri, 17 Feb 2006 16:19:37 +0100
+ -- Thierry Reding <thierry at doppeltgemoppelt.de>  Fri, 24 Feb 2006 18:56:24 +0100
 
 ruby-pkg-tools (0.6) unstable; urgency=low
 




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