File: rules

package info (click to toggle)
ruby-rails-2.3 2.3.14-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,908 kB
  • sloc: ruby: 5,808; makefile: 28
file content (54 lines) | stat: -rwxr-xr-x 2,097 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/make -f
#export DH_VERBOSE=1
#
# Uncomment to ignore all test failures (but the tests will run anyway)
#export DH_RUBY_IGNORE_TESTS=all
#
# Uncomment to ignore some test failures (but the tests will run anyway).
# Valid values:
#export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems
#
# If you need to specify the .gemspec (eg there is more than one)
#export DH_RUBY_GEMSPEC=gem.gemspec

RAILS_VERSION=$(shell sed -n "s/^  version: //p" metadata.yml)

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

override_dh_testdir: debian/control
	dh_testdir

debian/control: debian/control.in metadata.yml
	sed -e "s/@RAILS_VERSION@/$(RAILS_VERSION)/" >$@ <$<

override_dh_install:
	# Use dh_install to install files not handled by gem2deb
	dh_install --sourcedir=$(CURDIR)
	# Move /usr/bin/* to railties/bin/
	mv $(CURDIR)/debian/ruby-rails-2.3/usr/bin \
	   $(CURDIR)/debian/ruby-rails-2.3/usr/lib/ruby/vendor_ruby/railties/
	# Move commands directory to railties/lib
	mv $(CURDIR)/debian/ruby-rails-2.3/usr/lib/ruby/vendor_ruby/commands \
	   $(CURDIR)/debian/ruby-rails-2.3/usr/lib/ruby/vendor_ruby/railties/lib/
	# Move tasks directory to railties/lib
	mv $(CURDIR)/debian/ruby-rails-2.3/usr/lib/ruby/vendor_ruby/tasks \
	   $(CURDIR)/debian/ruby-rails-2.3/usr/lib/ruby/vendor_ruby/railties/lib/
	# Move all *.rb files from vendor_ruby to railties/lib/
	mv $(CURDIR)/debian/ruby-rails-2.3/usr/lib/ruby/vendor_ruby/*.rb \
	   $(CURDIR)/debian/ruby-rails-2.3/usr/lib/ruby/vendor_ruby/railties/lib/
	# Install environments
	cp -r $(CURDIR)/environments \
	      $(CURDIR)/debian/ruby-rails-2.3/usr/lib/ruby/vendor_ruby/railties/
	# Remove executable bit from fresh_rakefile
	chmod -x $(CURDIR)/debian/ruby-rails-2.3/usr/lib/ruby/vendor_ruby/railties/fresh_rakefile

override_dh_link:
	rm $(CURDIR)/debian/ruby-rails-2.3/usr/lib/ruby/vendor_ruby/railties/html/javascripts/prototype.js
	for f in controls.js dragdrop.js effects.js; do \
	  rm $(CURDIR)/debian/ruby-rails-2.3/usr/lib/ruby/vendor_ruby/railties/html/javascripts/$$f; \
	done
	dh_link

override_dh_compress:
	dh_compress -XREADME