File: rules

package info (click to toggle)
ruby-nokogiri 1.11.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,576 kB
  • sloc: xml: 28,086; ruby: 18,456; java: 13,067; ansic: 5,138; yacc: 265; sh: 208; makefile: 27
file content (38 lines) | stat: -rwxr-xr-x 1,096 bytes parent folder | download
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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export GEM2DEB_TEST_RUNNER = --check-dependencies

GEM_VERSION=$(word 1, $(subst +, ,$(DEB_VERSION_UPSTREAM)))

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

gemspec:
	gem fetch -v $(GEM_VERSION) --platform ruby nokogiri
	gem specification nokogiri-$(GEM_VERSION).gem --ruby > debian/gemspec
	# remove reference to mini_portile2 gem
	sed -i '/mini_portile2/ d' debian/gemspec
	rm -rf nokogiri-$(GEM_VERSION).gem

override_dh_auto_build:
	GEMSPEC_VERSION=$$(grep "s\.version = " debian/gemspec |awk '{ print $$3 }'); \
	if ! [ "$$GEMSPEC_VERSION" = "\"$(GEM_VERSION)\"" ]; then \
        	echo "Debian version is $(GEM_VERSION) but 'debian/gemspec' is only $$GEMSPEC_VERSION"; \
        	echo "Run 'debian/rules gemspec' to update gemspec file"; \
		exit 1; \
	fi
	dh_auto_build

override_dh_installman:
	mkdir man
	pod2man --center "" --release "" --name NOKOGIRI --utf8 debian/nokogiri.1.pod man/nokogiri.1
	dh_installman

override_dh_auto_clean:
	rm -rf man/
	dh_auto_clean

override_dh_installchangelogs:
	dh_installchangelogs CHANGELOG.md