[Pkg-puppet-devel] [SCM] Packaging of Facter for debian branch, master, updated. debian/1.5.6-1-3-gf695058
Micah Anderson
micah at riseup.net
Tue Jun 30 16:53:37 UTC 2009
The following commit has been merged in the master branch:
commit 9b25e4ae9cea6dfce1db3f253d461c01533720c7
Author: Micah Anderson <micah at riseup.net>
Date: Tue Jun 30 12:36:51 2009 -0400
Now that upstream has done quite a bit of work to get facter to work
with ruby 1.9 we need to make the Debian package work with ruby1.9.
This came about because there was a lintian problem:
E: facter: ruby-script-but-no-ruby-dep ./usr/bin/facter
That happened because the install.rb, provided by facter, munges the
perfectly fine shebang in bin/facter (#!/usr/bin/env ruby) into the
ruby1.8 specific one (#!/usr/bin/ruby1.8) just because my
/usr/bin/ruby is a symlink to /usr/bin/ruby1.8.
Because facter can work with both 1.8 and 1.9, having a shebang that
specifically uses 1.8, when someone might have only 1.9 installed is
actually an error.
So, after some investigation, I found that the way to do this is to
switch to the newer setup.rb mechanism for installation (as install.rb
has been deprecated by Minero Aoki in favor of setup.rb for years)
which allows for a switch that keeps the shebang from being
re-written.
So, to summarize, the changes I made to get this to work:
* Added an optional dependency on the libopenssl-ruby1.9 package
* Stopped using the upstream provided install.rb (which btw. has been
deprecated by Minero Aoki years ago) and switched to using the
standardized Debian ruby CDBS classes that provide a setup.rb
* Shipping the facter libraries into /usr/lib/ruby/vendor_ruby instead
of /usr/lib/ruby/ruby1.8 (NB: the vendor_ruby directory seems to be
the one the Debian Ruby team intends to use for version independent
ruby libraries, as most recently discussed here:
http://www.mail-archive.com/debian-ruby@lists.debian.org/msg00528.html)
diff --git a/debian/changelog b/debian/changelog
index c3a6e79..af871d1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,11 @@
facter (1.5.6-2) UNRELEASED; urgency=low
* Added depends possibility on libopenssl-ruby1.9
+ * Switch from install.rb to using the standardized Debian ruby CDBS
+ classes to use setup.rb. This stops the munging of the shebang
+ to a specific ruby version, as facter works with both 1.8 and 1.9
+ * Install facter library dependencies in ruby version neutral
+ directory: /usr/lib/ruby/vendor_ruby
-- Micah Anderson <micah at debian.org> Tue, 30 Jun 2009 00:21:23 -0400
diff --git a/debian/control b/debian/control
index 21b87f4..7808417 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: admin
Priority: optional
Maintainer: Puppet Package Maintainers <pkg-puppet-devel at lists.alioth.debian.org>
Uploaders: Andrew Pollock <apollock at debian.org>, Nigel Kersten <nigelk at explanatorygap.net>, Micah Anderson <micah at debian.org>
-Build-Depends: debhelper (>= 5.0.0), ruby (>= 1.8), libopenssl-ruby
+Build-Depends: ruby-pkg-tools, cdbs, debhelper (>= 5.0.0), ruby (>= 1.8), libopenssl-ruby
Standards-Version: 3.8.2
Package: facter
diff --git a/debian/dirs b/debian/dirs
deleted file mode 100644
index e46c8fd..0000000
--- a/debian/dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/bin
-usr/lib/ruby/1.8
diff --git a/debian/rules b/debian/rules
index c0d5144..0132cc6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,71 +1,11 @@
#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+# remove the conf directory, which contains package building
+# configurations for redhat, osx and solaris if this is not removed,
+# it will get installed into /etc/solaris, /etc/osx, /etc/redhat.
+build/facter::
+ rm -rf $(CURDIR)/conf
-CFLAGS = -Wall -g
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
-else
- CFLAGS += -O2
-endif
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- # Add here commands to configure the package.
-
- touch configure-stamp
-
-
-build: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
-
- touch build-stamp
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp configure-stamp
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- $(CURDIR)/install.rb --destdir=$(CURDIR)/debian/facter/ \
- --bindir=/usr/bin \
- --sbindir=/usr/sbin \
- --sitelibdir=/usr/lib/ruby/1.8
-
-# Build architecture-dependent files here.
-binary-arch: build install
-
-# Build architecture-independent files here.
-binary-indep: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs CHANGELOG
- dh_installdocs
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/ruby-pkg-tools/1/class/ruby-setup-rb.mk
+DEB_RUBY_CONFIG_ARGS = --prefix=/usr --siteruby=/usr/lib/ruby/vendor_ruby --siterubyver=/usr/lib/ruby/vendor_ruby --shebang=never
--
Packaging of Facter for debian
More information about the Pkg-puppet-devel
mailing list