File: rules

package info (click to toggle)
librep 0.90.2-1.3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,940 kB
  • sloc: ansic: 32,948; lisp: 11,025; sh: 9,844; makefile: 545; sed: 93
file content (151 lines) | stat: -rwxr-xr-x 3,626 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
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
#!/usr/bin/make -f

#export DH_VERBOSE=1

include /usr/share/dpatch/dpatch.make

version := $(shell sed -n 's/Package: \(librep.*\)/\1/p' debian/control | head -n 1)

DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),m68k))
	CFLAGS = -Wall -g -O0
endif

ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),amd64))
	CFLAGS = -Wall -g -O0
endif

ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),alpha))
       ARCH_CONF = --with-stack-direction=-1
endif

ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),ia64))
       ARCH_CONF = --with-stack-direction=-1
endif

ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),mips))
       ARCH_CONF = --with-stack-direction=-1
endif

ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),mipsel))
       ARCH_CONF = --with-stack-direction=-1
endif

configure: configure-stamp
configure-stamp: patch-stamp
	dh_testdir

	cp /usr/share/misc/config.guess .
	cp /usr/share/misc/config.sub .

	CONFIG_SHELL=/bin/bash /bin/bash ./configure \
	--prefix=/usr --libexecdir=/usr/lib --mandir=/usr/share/man \
	--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
	--with-readline CFLAGS="$(CFLAGS)" $(ARCH_CONF)

	# Avoid putting an rpath in 64 bit arches
	sed -i -e 's/lib64/lib/g' libtool

	touch configure-stamp

build: build-stamp
build-stamp: configure-stamp
	dh_testdir

	LC_ALL=C $(MAKE)

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	[ ! -f Makefile ] || $(MAKE) realclean

	debian/rules unpatch

	dh_clean debian/librep-dev.install debian/${version}.install \
	 src/rep-xgettext config.sub config.guess

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(MAKE) install DESTDIR=`pwd`/debian/tmp

	#Fix libdir in *.la files and remove dependency_libs
	find debian/tmp -name '*.la' |\
	 while read file; do\
	  DIRNAME=$$(dirname $$file | sed 's@debian/tmp@@');\
	  sed -i "/libdir/ s@^.*@libdir=$$DIRNAME@" $$file;\
	  sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'`;\
	 done

	-rm -rf debian/tmp/usr/info
	-rm debian/tmp/usr/share/info/dir*

	#Create the librep*.install files
	-rm debian/librep-dev.install
	cp debian/librep-dev.install.standard debian/librep-dev.install

	find debian/tmp \
	 -name install-aliases -o -name rep_config.h -o -name *.a -o -name *.jl \
	 | cut -d/ -f3- >> debian/librep-dev.install

	-rm debian/${version}.install
	cp debian/${version}.install.standard debian/${version}.install
	find debian/tmp/usr/lib/rep debian/tmp/usr/share/rep \
	 -name *.la -o -name *.jlc -o -name *.so \
	 | cut -d/ -f3- >> debian/${version}.install

	dh_install --fail-missing
	touch install-stamp

binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installinfo -i
	dh_lintian -i
	dh_installchangelogs -i NEWS
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -p ${version}
	dh_installman -a
	dh_lintian -a
	dh_installchangelogs -p${version} NEWS
	dh_link -a
	dh_strip -a --dbg-package=librep-dbg
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -p${version} -Xusr/lib/rep/
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure patch unpatch