From 9f599809ae87f763e050e2d268abe0507146041a Mon Sep 17 00:00:00 2001
From: Sam Hocevar <sam@videolan.org>
Date: Wed, 14 May 2003 17:17:30 +0000
Subject: [PATCH]   * ./debian/control: Debian packages now build with an
 mpeg2dec CVS tree in     the extras/ directory.

---
 debian/control |  1 +
 debian/rules   | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/debian/control b/debian/control
index dbb3ac4188e9..371100c3c723 100644
--- a/debian/control
+++ b/debian/control
@@ -3,6 +3,7 @@ Section: graphics
 Priority: optional
 Maintainer: Samuel Hocevar <sam@zoy.org>
 Build-Depends: debhelper (>=3.0), gettext, fortune-mod, xlibs-dev, xlibs-pic, libgnome-dev, libggi2-dev, libglide2-dev [i386], libesd0-dev, libsdl1.2-dev (>=1.2.2-3.1), libqt3-mt-dev, libqt3-compat-headers, libasound2-dev (>=0.9.0beta10a), libarts1-dev, libmad0-dev, liblircclient-dev, liba52-0.7.4-dev, aalib1-dev, libdvbpsi1-dev, mozilla-dev, libidl0, libglib2.0-0, kdelibs4-dev, dvb-dev, libdv2-dev, libxosd-dev, svgalibg1-dev (>=1.4.0) [i386], libogg-dev, libvorbis-dev, libwxgtk2.4-dev, libdvdplay0-dev (>=1.0.1-2), libdvdread3-dev, libslp-dev, libflac-dev (>=1.1.0)
+Build-Conflicts: libmpeg2-dev, libmpeg2-0-dev, libmpeg2-1-dev, libmpeg2-2-dev, libmpeg2-3-dev
 Standards-Version: 3.5.9.0
 
 Package: vlc
diff --git a/debian/rules b/debian/rules
index bba065b2cb0e..87073c0d83e7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -48,6 +48,7 @@ CONFIG_FLAGS += \
 # These ones are currently shipped with VLC
 CONFIG_FLAGS += --enable-ffmpeg --with-ffmpeg-tree=extras/ffmpeg
 CONFIG_FLAGS += --enable-faad --with-faad-tree=extras/faad
+CONFIG_FLAGS += --enable-libmpeg2 --with-libmpeg2-tree=extras/mpeg2dec
 
 # Glide is only for x86
 ifeq ($(DEB_BUILD_ARCH),i386)
@@ -104,6 +105,21 @@ build-stamp:
 		&& $(MAKE); \
 	fi
 
+	# Check that we have an mpeg2dec tree in here (can be a symlink)
+	test -d extras/mpeg2dec
+	if test ! -d CVS; then \
+		cd extras/mpeg2dec \
+		&& touch configure.in \
+		&& touch aclocal.m4 \
+		&& touch acinclude.m4 \
+		&& touch configure \
+		&& touch `find . -name config.h.in` \
+		&& touch `find . -name Makefile.in` \
+		&& ./configure --disable-shared \
+		&& cd libmpeg2 \
+		&& $(MAKE); \
+	fi
+
 	# Configure VLC
 	./configure --mandir=$${prefix}/share/man \
 		--infodir=$${prefix}/share/info $(CONFIG_FLAGS)
@@ -128,6 +144,13 @@ ifneq ($(DEB_BUILD_ARCH),i386)
 		&& $(MAKE) clean \
 		&& $(MAKE) AM_CFLAGS=-fPIC; \
 	fi
+
+	# HACK ME PLENTY MORE!!!
+	if test ! -d CVS; then \
+		cd extras/mpeg2dec/libmpeg2 \
+		&& $(MAKE) clean \
+		&& $(MAKE) LIBMPEG2_CFLAGS=-fPIC; \
+	fi
 endif
 
 	# Build all the rest, with the PIC libs
@@ -146,6 +169,9 @@ clean:
 	# Check that we have an faad tree in here (can be a symlink)
 	test -d extras/faad
 	-if test ! -d CVS; then cd extras/faad && $(MAKE) distclean; fi
+	# Check that we have an mpeg2dec tree in here (can be a symlink)
+	test -d extras/mpeg2dec
+	-if test ! -d CVS; then cd extras/mpeg2dec && $(MAKE) distclean; fi
 
 	# Remove spurious autotools stuff
 	rm -f config.log confdefs.h
-- 
GitLab