Package-Name: freetype
Homepage: http://www.freetype.org/
#Source: sourceforge:///freetype/freetype-(\d+.\d+.\d+).tar.gz $1
# To use the most recent version with docs available instead:
Source: sourceforge:///freetype/ftdocs-(\d+.\d+.\d+).tar.gz $1 freetype-$1.tar.gz
#FIXME: make this optional (Optional-Source-N)
More-Source-1: sourceforge:///freetype/ftdocs-$1.tar.gz
Zap-Before-Install: 1
Repack:
	tar xzvfp "$(SOURCE)"
	tar xzvfp "$(SOURCE1)"
Compile:
	mkdir -p "$(PREFIX)/docs"
	cp -a docs/{CHANGES,PATENTS,TODO,*.txt,*.html,design,freetype2,glyphs,reference,tutorial} "$(PREFIX)/docs/"
	CC="gcc -DTT_CONFIG_OPTION_BYTECODE_INTERPRETER" $(MAKE) -f ../Makefile configure
	$(MAKE)
# Avoid problems with overwriting shared libraries
	rm -f "$(PREFIX)"/lib/*.so*
# Avoid confusion with multiple include file paths
	rm -f "$(PREFIX)"/include/ft2build.h "$(PREFIX)"/include/freetype2/ft2build.h
	$(MAKE) install
	if test -f "$(PREFIX)"/include/ft2build.h -a ! -f "$(PREFIX)"/include/freetype2/ft2build.h ; then \
		ln -fs ../ft2build.h "$(PREFIX)"/include/freetype2/ ; \
	fi
Install:
	$(MAKE) instbin BIN=freetype-config
	# Deliberately do NOT install ft2build.h: it uses the wrong path!
	$(MAKE) instinc INC=freetype2
	$(MAKE) instlib LIB=freetype
	$(MAKE) addldso
	$(MAKE) instpc PC=freetype2
Clean:
	@set -e ; cd "$(PREFIX)"/lib ; \
	for lib in *.so.[0-9] ; do \
		reallib=`/bin/ls -l "$$lib" | sed 's/.* -> //'` ; \
		for file in $$lib.[0-9]*.[0-9]* ; do \
			if test "$$file" != "$$reallib" ; then \
				rm -fv "$$file" ; \
			fi ; \
		done ; \
	done

/pkg/freetype/
/usr/bin/freetype-config
/usr/include/freetype2
/usr/lib/libfreetype.*
