File: rules

package info (click to toggle)
ruby1.8 1.8.7.302-2squeeze5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 26,692 kB
  • ctags: 38,616
  • sloc: ruby: 245,002; ansic: 144,156; yacc: 5,890; sh: 2,677; lisp: 1,626; tcl: 949; makefile: 358; sed: 129; xml: 122; awk: 36; cpp: 28; asm: 25; perl: 18; python: 6
file content (248 lines) | stat: -rwxr-xr-x 9,494 bytes parent folder | download | duplicates (3)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
#!/usr/bin/make -f

ruby_ver = 1.8
tcltk_ver = 8.4

arch_name = $(subst linux-gnu,linux-,$(patsubst %linux-gnu,%linux,$(DEB_BUILD_GNU_TYPE)))
ruby_libdir = usr/lib/ruby/$(ruby_ver)
ruby_archdir = usr/lib/ruby/$(ruby_ver)/$(arch_name)
bin_dir = usr/bin
man_dir = usr/share/man/man1

el_dir = usr/share/emacs/site-lisp/ruby$(ruby_ver)-elisp
el_etc = etc/emacs/site-start.d

examples_dir = $(CURDIR)/debian/ruby$(ruby_ver)-examples/usr/share/doc/ruby$(ruby_ver)-examples/examples

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

DEB_AUTO_UPDATE_AUTOCONF = YES

CFLAGS := -fno-strict-aliasing -g
CXXFLAGS := -fno-strict-aliasing -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g -O0
else
	CFLAGS += -g -O2
endif

ifneq (,$(filter $(DEB_BUILD_GNU_CPU),i386 i486 i586 i686))
	DEB_CONFIGURE_USER_FLAGS += --enable-frame-address
endif
ifeq ($(DEB_BUILD_GNU_CPU),i686)
	DEB_CONFIGURE_USER_FLAGS += --with-extra-site-search-path='/usr/local/lib/site_ruby/$(ruby_ver)/i486-linux'
	DEB_CONFIGURE_USER_FLAGS += --with-extra-search-path='/usr/lib/ruby/$(ruby_ver)/i486-linux'
endif
ifeq ($(DEB_BUILD_GNU_CPU),i486)
	DEB_CONFIGURE_USER_FLAGS += --with-extra-site-search-path='/usr/local/lib/site_ruby/$(ruby_ver)/i386-linux'
	DEB_CONFIGURE_USER_FLAGS += --with-extra-search-path='/usr/lib/ruby/$(ruby_ver)/i386-linux'
endif
DEB_CONFIGURE_USER_FLAGS += --program-suffix=$(ruby_ver)
DEB_CONFIGURE_USER_FLAGS += --enable-pthread
DEB_CONFIGURE_USER_FLAGS += --enable-shared
DEB_CONFIGURE_USER_FLAGS += --enable-ipv6
DEB_CONFIGURE_USER_FLAGS += --with-lookup-order-hack=INET
DEB_CONFIGURE_USER_FLAGS += --disable-rpath
DEB_CONFIGURE_USER_FLAGS += --disable-install-doc
DEB_CONFIGURE_USER_FLAGS += --with-sitedir='/usr/local/lib/site_ruby'
DEB_CONFIGURE_USER_FLAGS += --with-default-kcode=none
DEB_CONFIGURE_USER_FLAGS += --with-dbm-type=gdbm_compat
DEB_CONFIGURE_USER_FLAGS += --with-tklib=tk$(tcltk_ver)
DEB_CONFIGURE_USER_FLAGS += --with-tcllib=tcl$(tcltk_ver)
DEB_CONFIGURE_USER_FLAGS += --with-tcl-include=/usr/include/tcl$(tcltk_ver)
DEB_CONFIGURE_USER_FLAGS += --with-bundled-sha1
DEB_CONFIGURE_USER_FLAGS += --with-bundled-md5
DEB_CONFIGURE_USER_FLAGS += --with-bundled-rmd160

DEB_MAKE_BUILD_TARGET = all test

common-post-build-arch::
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	-make test-all
endif

DEB_INSTALL_DIRS_ruby$(ruby_ver)-elisp += $(el_dir)
DEB_INSTALL_DIRS_ruby$(ruby_ver)-elisp += $(el_etc)
DEB_INSTALL_DOCS_ruby$(ruby_ver)-elisp += $(DEB_SRCDIR)/misc/README

DEB_INSTALL_DIRS_ri$(ruby_ver) += $(bin_dir)
DEB_INSTALL_DIRS_ri$(ruby_ver) += $(man_dir)
DEB_INSTALL_MANPAGES_ri$(ruby_ver) += debian/ri$(ruby_ver).1

DEB_INSTALL_DOCS_libtcltk-ruby$(ruby_ver) += $(DEB_SRCDIR)/ext/tk/README*
DEB_INSTALL_DOCS_libtcltk-ruby$(ruby_ver) += $(DEB_SRCDIR)/ext/tk/MANUAL*

DEB_INSTALL_DIRS_ruby$(ruby_ver) += $(bin_dir)
DEB_INSTALL_DIRS_ruby$(ruby_ver) += $(man_dir)
DEB_INSTALL_DOCS_ruby$(ruby_ver) += 
DEB_INSTALL_DOCS_ruby$(ruby_ver) += $(DEB_SRCDIR)/LEGAL
DEB_INSTALL_DOCS_ruby$(ruby_ver) += $(DEB_SRCDIR)/README
DEB_INSTALL_DOCS_ruby$(ruby_ver) += $(DEB_SRCDIR)/README.ja
DEB_INSTALL_DOCS_ruby$(ruby_ver) += $(DEB_SRCDIR)/ToDo
DEB_INSTALL_DOCS_ruby$(ruby_ver) += $(DEB_SRCDIR)/NEWS
DEB_INSTALL_DOCS_ruby$(ruby_ver) += $(DEB_SRCDIR)/doc/NEWS-1.8.0
DEB_INSTALL_MANPAGES_ruby$(ruby_ver) += debian/testrb$(ruby_ver).1
DEB_INSTALL_MANPAGES_ruby$(ruby_ver) += debian/erb$(ruby_ver).1
DEB_INSTALL_MANPAGES_ruby$(ruby_ver) += debian/rdoc$(ruby_ver).1
DEB_INSTALL_MANPAGES_ruby$(ruby_ver) += debian/irb$(ruby_ver).1

DEB_INSTALL_DOCS_libruby$(ruby_ver) += $(DEB_SRCDIR)/lib/README
DEB_INSTALL_DOCS_libruby$(ruby_ver) += $(DEB_SRCDIR)/NEWS
DEB_INSTALL_DOCS_libruby$(ruby_ver) += $(DEB_SRCDIR)/doc/NEWS-1.8.0
DEB_INSTALL_DOCS_libruby$(ruby_ver) += $(DEB_SRCDIR)/doc/*.rd*


DEB_INSTALL_DOCS_ruby$(ruby_ver)-dev += $(DEB_SRCDIR)/README.EXT*

DEB_COMPRESS_EXCLUDE = .rb .pl .py .scm .awk .dat
DEB_SHLIBDEPS_INCLUDE = $(CURDIR)/debian/libruby$(ruby_ver)/usr/lib
DEB_DH_MAKESHLIBS_ARGS_ALL = -m$(ruby_ver) -V

binary-install/libtcltk-ruby$(ruby_ver)::
	dh_movefiles -p$(cdbs_curpkg) \
	    $(ruby_archdir)/tcltklib.so \
	    $(ruby_archdir)/tkutil.so
	sh $(CURDIR)/debian/extfixup_rubylibs.sh $(cdbs_curpkg) \
	    $(DEB_SRCDIR)/ext/tk

	install -d \
	    $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/examples
	(cd $(DEB_SRCDIR)/ext/tk/sample && \
	 tar cf - .) | \
	  (cd $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/examples && tar xf -)
	chmod a-x $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/examples/tkextlib/tktable/tcllogo.gif
	mv $(CURDIR)/debian/tmp/usr/lib/ruby/$(ruby_ver)/tkextlib/SUPPORT_STATUS \
	    $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/
	install \
	    $(DEB_SRCDIR)/ext/tk/lib/README \
	    $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/README.lib
	install \
	    $(DEB_SRCDIR)/ext/tk/lib/tkextlib/tcllib/README \
	    $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/README.tcllib
	install \
	    $(DEB_SRCDIR)/ext/tk/lib/tkextlib/tkimg/README \
	    $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/README.tkimg

binary-install/libruby$(ruby_ver):: $(patsubst %,binary-install/%,$(filter-out libruby$(ruby_ver),$(DEB_PACKAGES)))
	install -d $(CURDIR)/debian/$(cdbs_curpkg)/$(ruby_archdir)
	for s in $(CURDIR)/debian/$(cdbs_curpkg).*.in; do \
	    sed -e 's/@@arch@@/$(arch_name)/g' \
		< $$s > `expr $$s : '\(.*\)\.in$$'`; \
	done

	(cd $(CURDIR)/debian/tmp/usr/lib && \
	    for f in libruby$(ruby_ver).so.$(ruby_ver)*; do \
		echo usr/lib/$$f; \
	    done) | xargs dh_movefiles -p$(cdbs_curpkg) 
	dh_movefiles -p$(cdbs_curpkg) usr/lib/ruby/$(ruby_ver)

	cd $(DEB_SRCDIR)/ext && \
	for dir in \
	    bigdecimal curses digest dl enumerator etc \
	    fcntl iconv io nkf pty racc readline openssl sdbm socket \
	    stringio strscan syck syslog thread zlib \
	    ; \
	do \
	    install -d "$(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/$$dir"; \
	    find $$dir \
	  	    -name '*README*' -or -name '*.html*' -or \
	  	    -name '*.txt*' -or -name '*.rd*' | \
		while read fname; \
		do \
		    cp "$$fname" \
		     	"$(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/$$dir"; \
		done; \
		rmdir "$(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/$$dir" 2>/dev/null || :; \
	    done

binary-install/ruby$(ruby_ver)-dev::
	dh_movefiles -p$(cdbs_curpkg) \
	    usr/lib/libruby$(ruby_ver).so \
	    usr/lib/libruby$(ruby_ver)-static.a \
	    usr/lib/ruby/$(ruby_ver)/mkmf.rb
	(cd $(CURDIR)/debian/tmp/usr/lib/ruby/$(ruby_ver)/$(arch_name) && \
	    for h in *.h; do \
		echo usr/lib/ruby/$(ruby_ver)/$(arch_name)/$$h; \
		chmod a-x $$h; \
	    done) | xargs dh_movefiles -p$(cdbs_curpkg)

binary-install/ruby$(ruby_ver)::
	dh_movefiles -p$(cdbs_curpkg) \
	    usr/bin/ruby$(ruby_ver) \
	    usr/bin/erb$(ruby_ver) \
	    usr/bin/testrb$(ruby_ver) \
	    usr/bin/rdoc$(ruby_ver) \
	    usr/bin/irb$(ruby_ver) \
	    usr/share/man/man1/ruby$(ruby_ver).1

binary-post-install/ruby$(ruby_ver)-elisp::
	install -m444 $(DEB_SRCDIR)/misc/*.el \
	    $(CURDIR)/debian/$(cdbs_curpkg)/$(el_dir)

binary-install/ri$(ruby_ver)::
	dh_movefiles -p$(cdbs_curpkg) $(bin_dir)/$(cdbs_curpkg)
binary-post-install/ri$(ruby_ver)::
	$(DEB_MAKE_INVOKE) install-doc DESTDIR=$(CURDIR)/debian/$(cdbs_curpkg)
	install -m444 $(CURDIR)/debian/$(cdbs_curpkg).1 \
	    $(CURDIR)/debian/$(cdbs_curpkg)/$(man_dir)/$(cdbs_curpkg).1

binary-post-install/ruby$(ruby_ver)-examples::
	install -d $(examples_dir)/bigdecimal
	cp -a $(DEB_SRCDIR)/ext/bigdecimal/sample/* $(examples_dir)/bigdecimal
	install -d $(examples_dir)/curses
	cd $(DEB_SRCDIR)/ext/curses && \
	  cp hello.rb mouse.rb rain.rb view.rb view2.rb \
	    $(examples_dir)/curses
#	install -d $(examples_dir)/digest
#	install -d $(examples_dir)/dl
#	install -d $(examples_dir)/enumerator
#	install -d $(examples_dir)/etc
#	install -d $(examples_dir)/fcntl
#	install -d $(examples_dir)/iconv
#	install -d $(examples_dir)/io
#	install -d $(examples_dir)/nkf
	install -d $(examples_dir)/pty
	cd $(DEB_SRCDIR)/ext/pty && \
	  cp expect_sample.rb script.rb shl.rb \
	    $(examples_dir)/pty
#	install -d $(examples_dir)/racc
#	install -d $(examples_dir)/sdbm
#	install -d $(examples_dir)/socket
#	install -d $(examples_dir)/stringio
#	install -d $(examples_dir)/strscan
#	install -d $(examples_dir)/syck
#	install -d $(examples_dir)/syslog
#	install -d $(examples_dir)/zlib

	(cd $(DEB_SRCDIR)/sample && tar cf - .) | \
	  (cd $(examples_dir) && tar xf -)

$(patsubst %,binary-post-install/%,$(DEB_PACKAGES))::
	bash $(CURDIR)/debian/fixshebang.sh ruby$(ruby_ver) \
	    '$(CURDIR)/debian/$(cdbs_curpkg)/$(bin_dir)'
	bash $(CURDIR)/debian/fixshebang.sh ruby$(ruby_ver) \
	    '$(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/examples'
	sh $(CURDIR)/debian/rmshebang.sh \
	    '$(CURDIR)/debian/$(cdbs_curpkg)/$(ruby_libdir)'

clean::
	rm -f \
	    .installed.list \
	    configure \
	    parse.c \
	    debian/libruby$(ruby_ver).postinst \
	    debian/libruby$(ruby_ver).prerm

	if [ -f $(DEB_SRCDIR)/config.guess.cdbs-orig ]; \
	then \
	    mv $(DEB_SRCDIR)/config.guess.cdbs-orig \
		$(DEB_SRCDIR)/config.guess; \
	fi
	if [ -f $(DEB_SRCDIR)/config.sub.cdbs-orig ]; \
	then \
	    mv $(DEB_SRCDIR)/config.sub.cdbs-orig \
		$(DEB_SRCDIR)/config.sub; \
	fi