File: rules

package info (click to toggle)
mplayer 2%3A1.3.0-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 31,260 kB
  • ctags: 68,306
  • sloc: ansic: 318,131; xml: 116,399; sh: 9,575; perl: 1,106; objc: 1,035; makefile: 999; cpp: 876; asm: 346; awk: 223; python: 98; cs: 10
file content (128 lines) | stat: -rwxr-xr-x 3,781 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
#!/usr/bin/make -f

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

# do not run the actual rules of this makefile in parallel. sub-makes
# can go in parallel
.NOTPARALLEL:

DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS    ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

CFLAGS +=$(CPPFLAGS)
LDFLAGS += -Wl,--as-needed

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

CONFIGURE_FLAGS = \
	--prefix=/usr \
	--confdir=/etc/mplayer \
	--enable-debug \
	--enable-xvmc \
	--enable-menu \
	--disable-arts \
	--language=all \
	--disable-libmpeg2-internal \
	--disable-ffmpeg_a \
	--disable-esd \
	--extra-cflags="${CFLAGS}" \
	--extra-ldflags="${LDFLAGS}" \
	$(archconf)

CONFIGURE_DOC_FLAGS = \
	--disable-ffmpeg_a \
	--disable-mencoder \
	--disable-mplayer \
	--yasm='' \
	--language=all

# Runtime detections is available for i386, amd64 and ppc.
ifneq (,$(filter $(DEB_HOST_ARCH),i386 hurd-i386 kfreebsd-i386 amd64 kfreebsd-amd64 powerpc))
  CONFIGURE_FLAGS += --enable-runtime-cpudetection
endif

ifeq ($(DEB_HOST_ARCH),i386)
#configure optimizes for the cpu detected at ./configure time
#in order to build a generic binary, avoid non-standard opcodes through gcc
  archconf += --target=i586-linux
endif

# when run on a sparc64 kernel, configure will normally select v9 asm.
# this is hidden when running on buildds with 32bit kernel personality.
# because of #644856, this will currently lead to a FTBFS
# therefore, we force a 'generic' target.
ifeq ($(DEB_HOST_ARCH),sparc)
  archconf += --target=generic
endif

ifeq ($(DEB_HOST_ARCH),alpha)
#Avoid high optimization through gcc.
# see http://permalink.gmane.org/gmane.linux.debian.ports.alpha/7295
  archconf += --target=alpha_ev5-linux
endif

ifeq ($(DEB_HOST_ARCH_OS),linux)
    CONFIGURE_FLAGS += --enable-joystick --enable-radio --enable-radio-capture
    sound_backend := alsa
else
    sound_backend := oss
endif

# It seems x32 has some alsa issues. Add oss as fallback.
# see http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/2015-July/046049.html
# The default for all could be "ao=pulse,alsa,oss,sdl:aalib" to avoid this.
ifeq ($(DEB_HOST_ARCH),x32)
    sound_backend := alsa,oss
endif

%:
	dh $@ --parallel

override_dh_auto_build-arch:
	dh_auto_build -- mplayer
	mv mplayer gmplayer
	$(MAKE) distclean
	./configure $(CONFIGURE_FLAGS) --disable-gui
	dh_auto_build -- mplayer mencoder

override_dh_auto_build-indep:
	[ -f DOCS/HTML/en/index.html ] || dh_auto_build -- html-chunked

override_dh_auto_clean:
	[ -f config.mak ] && $(MAKE) distclean || true

override_dh_auto_configure-arch:
	./configure $(CONFIGURE_FLAGS) --enable-gui

override_dh_auto_configure-indep:
	[ -f config.mak ] || ./configure $(CONFIGURE_DOC_FLAGS)

override_dh_auto_install-arch:
	$(MAKE) install-mplayer DESTDIR=$(CURDIR)/debian/mplayer
	$(MAKE) install-mencoder DESTDIR=$(CURDIR)/debian/mencoder
	$(MAKE) install-mplayer-man DESTDIR=$(CURDIR)/debian/mplayer
	$(MAKE) install-mencoder-man DESTDIR=$(CURDIR)/debian/mencoder
	$(MAKE) install-gui-man DESTDIR=$(CURDIR)/debian/mplayer-gui
	$(MAKE) install-gui-icons DESTDIR=$(CURDIR)/debian/mplayer-gui
	find debian/mencoder -type d -empty -delete
	find debian/mplayer -type d -empty -delete
	find debian/mplayer-gui -type d -empty -delete

override_dh_auto_install-indep:
override_dh_auto_test-indep:

override_dh_compress-arch:
	dh_compress
	find debian/mencoder/usr/share/man/ -type f -name mplayer.1.gz -delete
	find debian/mplayer-gui/usr/share/man/ -type f -name mplayer.1.gz -delete

override_dh_install-arch:
	dh_install
	sed -e "s/@SOUND_BACKEND@/$(sound_backend)/" -i \
	                  $(CURDIR)/debian/mplayer/etc/mplayer/mplayer.conf

get-orig-source:
	sh debian/get-svn-source.sh

.PHONY: get-orig-source