File: rules

package info (click to toggle)
ruby-backports 3.16.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 4,336 kB
  • sloc: ruby: 8,621; makefile: 25
file content (32 lines) | stat: -rwxr-xr-x 927 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
#!/usr/bin/make -f

export DH_RUBY_GEMSPEC = debian/backports.gemspec
export DH_RUBY_IGNORE_TESTS = ruby2.3

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

override_dh_installchangelogs:
	dh_installchangelogs CHANGELOG.rdoc -O--buildsystem=ruby

override_dh_auto_configure:
	dh_auto_configure -O--buildsystem=ruby
	ruby -Ilib -e ' \
		require "backports/version"; \
		spec = Gem::Specification.load(ENV["DH_RUBY_GEMSPEC"]); \
		if spec.version.to_s != Backports::VERSION; \
			$$stderr.puts "Static gemspec is outdated. Run: debian/rules clean"; \
			exit 1; \
		end \
		'

override_dh_clean:
	dh_clean -O--buildsystem=ruby
	# Let's create a static version of the gemspec as we don't build with git
	if [ -d .git ]; then \
		ruby -rrubygems -e ' \
			spec = Gem::Specification.load("backports.gemspec"); \
			spec.files.delete_if { |p| p.start_with? "debian/" }; \
			File.write(ENV["DH_RUBY_GEMSPEC"], spec.to_ruby); \
			'; \
	fi