File: rules

package info (click to toggle)
rubygems 3.6.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 37,448 kB
  • sloc: ruby: 141,650; sh: 94; makefile: 28
file content (52 lines) | stat: -rwxr-xr-x 2,129 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/make -f

#export DH_VERBOSE=1

export GEM2DEB_TEST_RUNNER = --check-dependencies
export DH_RUBY = --gem-install

RUBYGEMS_GEMSPEC=rubygems-update.gemspec
RUBYGEMS_VERSION=$(shell debian/get-gem-version.rb ${RUBYGEMS_GEMSPEC})
BUNDLER_GEMSPEC=bundler/bundler.gemspec
BUNDLER_VERSION=$(shell debian/get-gem-version.rb ${BUNDLER_GEMSPEC})
BUNDLER_VERSION := $(subst .rc,~rc,$(BUNDLER_VERSION))
DEBIAN_REVISION=$(shell dpkg-parsechangelog --show-field Version | cut -d '-' -f 2)

GEMS_DIR=usr/share/rubygems-integration/all/gems

%:
	dh $@ --buildsystem=ruby --with ruby

override_dh_install:
	dh_install -O--buildsystem=ruby

	# Remove remaining bundler files from ruby-rubygems binary package
	rm -rf debian/ruby-rubygems/${GEMS_DIR}/rubygems-update-${RUBYGEMS_VERSION}/bundler

	# Mimick rubygems-update installation process. The files (other than
	# the gemspec) should *not* be available in the gem directory, and only
	# under the vendor_ruby.
	########################################################################
	# Move rubygems files to vendor_ruby
	install -d -m 0755 $(CURDIR)/debian/ruby-rubygems/usr/lib/ruby/vendor_ruby
	for f in rubygems rubygems.rb; do \
		mv $(CURDIR)/debian/ruby-rubygems/${GEMS_DIR}/rubygems-update-${RUBYGEMS_VERSION}/lib/$$f \
		$(CURDIR)/debian/ruby-rubygems/usr/lib/ruby/vendor_ruby/$$f; \
	done
	# Move gem binary to /usr/bin
	install -d -m 0755 $(CURDIR)/debian/ruby-rubygems/usr/bin
	mv $(CURDIR)/debian/ruby-rubygems/${GEMS_DIR}/rubygems-update-${RUBYGEMS_VERSION}/exe/gem \
		$(CURDIR)/debian/ruby-rubygems/usr/bin/gem
	# Delete the rest
	$(RM) -rf $(CURDIR)/debian/ruby-rubygems/${GEMS_DIR}/rubygems-update-${RUBYGEMS_VERSION}

override_dh_gencontrol:
	# bundler binary package needs to know the bundler version to depend on
	# the correct ruby-bundler version
	echo "bundler:Version=${BUNDLER_VERSION}-${DEBIAN_REVISION}" >> debian/bundler.substvars

	dh_gencontrol

	# Bundler has a different version than rubygems at the moment
	dh_gencontrol -pbundler -- -v${BUNDLER_VERSION}-${DEBIAN_REVISION}
	dh_gencontrol -pruby-bundler -- -v${BUNDLER_VERSION}-${DEBIAN_REVISION}