File: rules

package info (click to toggle)
ogle 0.9.2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,940 kB
  • ctags: 3,499
  • sloc: ansic: 35,155; sh: 7,555; makefile: 259; asm: 71
file content (138 lines) | stat: -rwxr-xr-x 3,537 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This is the debhelper compatability version to use.
export DH_COMPAT=3
export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

ARCH := $(shell dpkg --print-architecture)

TARGETS := ogle

ifeq "$(ARCH)" "i386"
TARGETS += ogle-mmx
endif
ifeq "$(ARCH)" "powerpc"
TARGETS += ogle-altivec
endif
#ifeq "$(ARCH)" "sparc"
#TARGETS += ogle-sparcasm
#endif

LINKSUFFIX = docs manpages
LINKTMP = $(foreach f,$(LINKSUFFIX),$(p).$(f))
LINKFILES := $(foreach p,ogle-noopt ogle-mmx ogle-altivec,$(LINKTMP))

ogle-%: 
	@echo Building  $@

	dh_installdirs -s

	-$(MAKE) clean
	./configure --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
	--prefix=/usr --mandir=\$${prefix}/share/man \
	 --sysconfdir=\$${prefix}/etc \
	 $(if $(findstring ogle-noopt,$@),--disable-altivec --disable-mmx)

	$(MAKE)

	$(MAKE) install DESTDIR=$(CURDIR)/debian/$@ \
		LIBRARY_PATH=$(CURDIR)/debian/$@/usr/lib/ogle
#	chrpath -d $(CURDIR)/debian/$@/usr/lib/ogle/*
	chrpath -d $(CURDIR)/debian/$@/usr/bin/ifo_dump
	mkdir -p debian/$@/etc
	mv debian/$@/usr/share/ogle/oglerc debian/$@/etc/oglerc
	ln -sf /etc/oglerc debian/$@/usr/share/ogle/oglerc
	install -m 644 debian/ogle.xpm debian/$@/usr/share/ogle/ogle.xpm

	install -d debian/$@/usr/share/lintian/overrides/
	install -m 644 debian/lintian.override \
		debian/$@/usr/share/lintian/overrides/$(patsubst %-noopt,%,$@)


	cd debian; \
	for f in $(LINKSUFFIX); do\
		ln -fs ogle.$$f $@.$$f; \
	done

	touch $@

ogle: ogle-stamp
	:

ogle-stamp: ogle-noopt
	$(RM) -r debian/$(patsubst %-stamp,%,$@)
	mv debian/$^ debian/$(patsubst %-stamp,%,$@)
	touch $@

clean:
	dh_testdir
	dh_testroot
	$(RM) ogle-*
	$(RM) configure-*-stamp

	# Add here commands to clean up after the build process.
	-$(MAKE) distclean
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	cp -f /usr/share/misc/config.guess config.guess
endif


	$(RM) -r debian/ogle-noopt
	cd debian; $(RM) $(LINKFILES)
	dh_clean

# Build architecture-independent files here.
binary-indep:
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build $(TARGETS)
	dh_testdir
	dh_testroot
#	dh_installdebconf -s
	dh_installdocs -A -s
	dh_installexamples -A -s
	dh_installmenu -s
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
#	dh_installcron
	dh_installman -s
#	dh_installinfo
#	dh_undocumented
	dh_installchangelogs -s
#	dh_link
	dh_strip -s
	dh_compress -s
	dh_fixperms -s
	dh_makeshlibs -s --noscripts -V 'ogle'
	dh_installdeb -s
#	dh_perl
	dh_shlibdeps -s -ldebian/ogle/usr/lib/ogle

	#Ugly hack, cannot find anything better. Please help!
	cd debian; touch ogle-mmx.substvars ogle-altivec.substvars; \
	sed -e s@ogle,@@ < ogle.substvars > ogle.substvars.new; \
	mv  ogle.substvars.new ogle.substvars; \
	sed -e s@ogle,@@ < ogle-mmx.substvars > ogle-mmx.substvars.new; \
	mv  ogle-mmx.substvars.new ogle-mmx.substvars; \
	sed -e s@ogle,@@ < ogle-altivec.substvars > ogle-altivec.substvars.new ; \
	mv ogle-altivec.substvars.new ogle-altivec.substvars;

	dh_gencontrol -s
	dh_md5sums -s
	dh_builddeb -s

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