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)
Micah Anderson
14 years ago
0 | 0 |
facter (1.5.6-2) UNRELEASED; urgency=low
|
1 | 1 |
|
2 | 2 |
* Added depends possibility on libopenssl-ruby1.9
|
|
3 |
* Switch from install.rb to using the standardized Debian ruby CDBS
|
|
4 |
classes to use setup.rb. This stops the munging of the shebang
|
|
5 |
to a specific ruby version, as facter works with both 1.8 and 1.9
|
|
6 |
* Install facter library dependencies in ruby version neutral
|
|
7 |
directory: /usr/lib/ruby/vendor_ruby
|
3 | 8 |
|
4 | 9 |
-- Micah Anderson <micah@debian.org> Tue, 30 Jun 2009 00:21:23 -0400
|
5 | 10 |
|
2 | 2 |
Priority: optional
|
3 | 3 |
Maintainer: Puppet Package Maintainers <pkg-puppet-devel@lists.alioth.debian.org>
|
4 | 4 |
Uploaders: Andrew Pollock <apollock@debian.org>, Nigel Kersten <nigelk@explanatorygap.net>, Micah Anderson <micah@debian.org>
|
5 | |
Build-Depends: debhelper (>= 5.0.0), ruby (>= 1.8), libopenssl-ruby
|
|
5 |
Build-Depends: ruby-pkg-tools, cdbs, debhelper (>= 5.0.0), ruby (>= 1.8), libopenssl-ruby
|
6 | 6 |
Standards-Version: 3.8.2
|
7 | 7 |
|
8 | 8 |
Package: facter
|
0 | |
usr/bin
|
1 | |
usr/lib/ruby/1.8
|
0 | 0 |
#!/usr/bin/make -f
|
1 | |
# -*- makefile -*-
|
2 | |
# Sample debian/rules that uses debhelper.
|
3 | |
# This file was originally written by Joey Hess and Craig Small.
|
4 | |
# As a special exception, when this file is copied by dh-make into a
|
5 | |
# dh-make output file, you may use that output file without restriction.
|
6 | |
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
7 | 1 |
|
8 | |
# Uncomment this to turn on verbose mode.
|
9 | |
#export DH_VERBOSE=1
|
|
2 |
# remove the conf directory, which contains package building
|
|
3 |
# configurations for redhat, osx and solaris if this is not removed,
|
|
4 |
# it will get installed into /etc/solaris, /etc/osx, /etc/redhat.
|
|
5 |
build/facter::
|
|
6 |
rm -rf $(CURDIR)/conf
|
10 | 7 |
|
11 | |
CFLAGS = -Wall -g
|
12 | |
|
13 | |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
14 | |
CFLAGS += -O0
|
15 | |
else
|
16 | |
CFLAGS += -O2
|
17 | |
endif
|
18 | |
|
19 | |
configure: configure-stamp
|
20 | |
configure-stamp:
|
21 | |
dh_testdir
|
22 | |
# Add here commands to configure the package.
|
23 | |
|
24 | |
touch configure-stamp
|
25 | |
|
26 | |
|
27 | |
build: build-stamp
|
28 | |
|
29 | |
build-stamp: configure-stamp
|
30 | |
dh_testdir
|
31 | |
|
32 | |
touch build-stamp
|
33 | |
|
34 | |
clean:
|
35 | |
dh_testdir
|
36 | |
dh_testroot
|
37 | |
rm -f build-stamp configure-stamp
|
38 | |
|
39 | |
dh_clean
|
40 | |
|
41 | |
install: build
|
42 | |
dh_testdir
|
43 | |
dh_testroot
|
44 | |
dh_clean -k
|
45 | |
dh_installdirs
|
46 | |
|
47 | |
$(CURDIR)/install.rb --destdir=$(CURDIR)/debian/facter/ \
|
48 | |
--bindir=/usr/bin \
|
49 | |
--sbindir=/usr/sbin \
|
50 | |
--sitelibdir=/usr/lib/ruby/1.8
|
51 | |
|
52 | |
# Build architecture-dependent files here.
|
53 | |
binary-arch: build install
|
54 | |
|
55 | |
# Build architecture-independent files here.
|
56 | |
binary-indep: build install
|
57 | |
dh_testdir
|
58 | |
dh_testroot
|
59 | |
dh_installchangelogs CHANGELOG
|
60 | |
dh_installdocs
|
61 | |
dh_compress
|
62 | |
dh_fixperms
|
63 | |
dh_installdeb
|
64 | |
dh_shlibdeps
|
65 | |
dh_gencontrol
|
66 | |
dh_md5sums
|
67 | |
dh_builddeb
|
68 | |
|
69 | |
binary: binary-indep binary-arch
|
70 | |
.PHONY: build clean binary-indep binary-arch binary install configure
|
|
8 |
include /usr/share/cdbs/1/rules/debhelper.mk
|
|
9 |
include /usr/share/ruby-pkg-tools/1/class/ruby-setup-rb.mk
|
|
10 |
DEB_RUBY_CONFIG_ARGS = --prefix=/usr --siteruby=/usr/lib/ruby/vendor_ruby --siterubyver=/usr/lib/ruby/vendor_ruby --shebang=never
|