#!/usr/bin/make -f
# debian/rules for the VideoLAN Client - uses debhelper.
# based on Joey Hess's one.
# Kludged for ipkg

# export PATH="$PATH:/usr/local/arm/2.95.3/bin"
# Compilation options
export CC=arm-linux-gcc
export LD=arm-linux-ld
export AR=arm-linux-ar
export RANLIB=arm-linux-ranlib
export STRIP=arm-linux-strip
export CONFIG_FLAGS="--enable-release --prefix=/usr --disable-gtk --disable-gnome --disable-qt --disable-kde --enable-fb --enable-sdl --disable-xvideo --disable-dvd --disable-dvdread --disable-vcd --disable-maxosx --disable-plugins --enable-mad --enable-ffmpeg --with-tuning=strongarm1100 --x-includes=/skiff/local/arm-linux/include --x-libraries=/skiff/local/arm-linux/lib/X11 --with-mad=/usr/local/arm/2.95.3/arm-linux --with-sdl-config-path=/usr/local/arm/2.95.3/arm-linux/bin --with-sdl=/usr/local/arm/2.95.3/arm-linux --with-ffmpeg-tree=/home/jpsaman/iPaq/src/ffmpeg"
export VIDDIR="usr/share/videolan"
export PIXDIR="usr/share/pixmaps"
#export DESTDIR=/tmp/vlc
export DESTDIR=/home/jpsaman/iPaq/packages/vlc

build: build-stamp
build-stamp:
	./configure --mandir=$${prefix}/share/man \
		--infodir=$${prefix}/share/info \
		$(shell echo $(CONFIG_FLAGS))

# This is ugly -- I know
	patch -p 0 < ipkg/patch

	$(MAKE)

	touch build-stamp

clean:
	rm -f build-stamp

	-$(MAKE) distclean

install: build
	mkdir -p ${DESTDIR}/CONTROL
	mkdir -p $(DESTDIR)/usr/bin
	$(STRIP) vlc
	cp ipkg/control $(DESTDIR)/CONTROL
	cp vlc $(DESTDIR)/usr/bin

.PHONY: build clean install

