Package: pike7.6
Version: 7.6.58
Revision: 4

Description: Programming language with a C-like syntax
DescDetail: <<
 Pike is an interpreted, object-oriented programming language. 
 It looks a bit like C and C++, but it is much easier to learn and use. It 
 can be used for small scripts as well as for large programs. 
 
 Pike is:
 - High-level and powerful, which means that even very complex 
  things are easy to do.
 - Object-oriented, which means that you can use modern programming
  techniques to divide a large program into  small pieces, which are much
  easier to write than it would be to write 
  the entire program at once.
 - Interpreted, which means that you don't have to wait for a program to
  compile and link when you want to run it,
 - One of the fastest "scripting" languages available.
 - Garbage-collected, which makes programming much simpler, and removes 
  the risk for memory leaks and other memory-related bugs.
 - Easy to extend, which means that you can create plug-ins, written in
  Pike as well as in C or C++, and integrate them with the rest of Pike.
<<

CustomMirror: <<
	Primary: http://pike.ida.liu.se/pub/pike/beta/%v/Pike-v%v.tar.gz
<<
Source: mirror:custom:Pike-v%v.tar.gz
Source-MD5: 3220bc3e69c88f63b206029b2815141b 
SourceDirectory: Pike-v%v

# WARNING: 10.3 users BuildDepends on fileutils (for building Java) because of
# a buggy ls
# TODO: make a decision for freetype2
BuildDepends: <<
	nettle,
	gmp,
	libjpeg,
	freetype,
	gdbm,
	pdflib,
	fftw,
	mysql12-dev
<<

# bzip2-shlibs is a core package, but requiring it anyway won't hurt
# pcre-shlibs is required by monger
Depends: <<
	bzip2-shlibs,
	gmp-shlibs,
	pcre-shlibs
<<

Patch: %f.patch
PatchScript: <<
	# Put the good fink prefix in the man page
	perl -pi -e 's,\@PREFIX\@,%p,g' man/pike.1
<<

# TODO: remove --without-GL
CompileScript: <<
	make CONFIGUREARGS="%c --without-GL --with-mysql=%p --with-double-precision --disable-rpath --with-max-fd=60000 --with-relocatable-dumped-module"
<<

InstallScript: <<
	make testsuites
	make install_nodoc DESTDIR=%d prefix=%p buildroot=%d exec_prefix=%p/bin/ share_prefix=%p/share/pike/%n/ include_prefix="%p/include/pike/%n/" lib_prefix=%p/lib/pike/%n/ man_prefix=%p/share/man/ INSTALLARGS=--traditional

	# Rename some files so that they don't conflict with other pike versions
	mv %i/bin/pike %i/bin/pike7.6
	mv %i/bin/hilfe %i/bin/hilfe7.6
	mv %i/share/man/man1/pike.1 %i/share/man/man1/pike7.6.1

	# Move the doc to an appropriate place
	# Doing this here since make doc_prefix seems not to work
	mkdir -p %i/share/doc/%N
	mv %i/doc %i/share/doc/%N

	# Create a place for putting the testsuites...
	mkdir -p %i/share/pike/%N/testsuites
	# ... and copy the testsuites that contains data there
	(cd build/`uname -s -r -m|sed "s/ /-/g"|tr "[A-Z]" "[a-z]"|tr "/()" "___"` && find . -name testsuite -not -size 0 -exec cp --parent -pr {} %i/share/pike/%N/testsuites \;)
<<

DocFiles: ANNOUNCE COPYING COPYRIGHT README README-CVS

PostInstScript: <<
	update-alternatives --install %p/bin/pike pike %p/bin/pike7.6 40
	update-alternatives --install %p/bin/hilfe hilfe %p/bin/hilfe7.6 40
	update-alternatives --install %p/share/man/man1/pike.1 pike.1 %p/share/man/man1/pike7.6.1 40
<<
PreRmScript: <<
	if [ $1 != "upgrade" ]; then
		update-alternatives --remove pike %p/bin/pike7.6
		update-alternatives --remove hilfe %p/bin/hilfe7.6
  	update-alternatives --remove pike.1 %p/share/man/man1/pike7.6.1
	fi
<<

SplitOff2: <<
	Package: %N-mysql
	Description: MySQL module for the Pike language
	Depends: mysql12-shlibs, %N (= %v-%r)
	Files: <<
		%p/lib/pike/%N/7.4/include/mysql.h
		%p/lib/pike/%N/modules/Cache.pmod/Storage.pmod/MySQL.pike
		%p/lib/pike/%N/modules/Mysql.so
		%p/lib/pike/%N/modules/Sql.pmod/mysql.pike
		%p/lib/pike/%N/modules/Sql.pmod/mysql_result.pike
		%p/lib/pike/%N/modules/Sql.pmod/mysqls.pike
		%p/lib/pike/%N/modules/Sql.pmod/mysqls_result.pike
	<<
<<

SplitOff4: <<
	Package: %N-jpeg
	Description: JPEG module for the Pike language
	Depends: libjpeg-shlibs, %N (= %v-%r)
	Files: %p/lib/pike/%N/modules/_Image_JPEG.so
<<

SplitOff5: <<
	Package: %N-freetype
	Description: Freetype module for the Pike language
	# TODO: understand this message about freetype2 package if that's deprecated
	# or not
	Depends: freetype2-shlibs, %N (= %v-%r), %N-math (= %v-%r)
	Files: %p/lib/pike/%N/modules/_Image_FreeType.so
<<

SplitOff6: <<
	Package: %N-gdbm
	Description: GDBM module for the Pike language
	Depends: gdbm-shlibs, %N (= %v-%r)
	Files: <<
		%p/lib/pike/%N/modules/Cache.pmod/Storage.pmod/Gdbm.pike
		%p/lib/pike/%N/modules/Gdbm.so
		%p/share/pike/%N/testsuites/modules/Gdbm/testsuite
	<<
<<

SplitOff7: <<
	Package: %N-pdf
	Description: PDF module for the Pike language
	Depends: libtiff-shlibs, libpng3-shlibs, pdflib-shlibs, %N (= %v-%r)
	Files: %p/lib/pike/%N/modules/PDF.so
<<

SplitOff8: <<
	Package: %N-tiff
	Description: TIFF module for the Pike language
	Depends: libtiff-shlibs, libjpeg-shlibs, %N (= %v-%r)
	Files: %p/lib/pike/%N/modules/_Image_TIFF.so
<<

SplitOff10: <<
	Package: %N-math
	Description: Math module for the Pike language
	Depends: fftw-shlibs, %N (= %v-%r)
	Files: <<
		%p/lib/pike/%N/modules/___Math.so
		%p/share/pike/%N/testsuites/modules/_math/testsuite
	<<
<<

SplitOff11: <<
	Package: %N-ttf
	Description: TTF module for the Pike language
	Depends: freetype-shlibs, %N (= %v-%r)
	Files: %p/lib/pike/%N/modules/_Image_TTF.so
<<

# Since gmp-shlibs is resuired for Pike, there is no need for this SplitOff
# anymore
#SplitOff12: <<
#	Package: %N-xface
#	Description: X-Face module for the Pike language
#	Depends: gmp-shlibs, %N (= %v-%r)
#	Files: %p/lib/pike/pike7.6/modules/_Image_XFace.so
#<<

SplitOff13: <<
	Package: %N-gettext
	Description: Gettext module for the Pike language
	Depends: gettext, %N (= %v-%r)
	Files: <<
		%p/lib/pike/%N/modules/Gettext.so
		%p/share/pike/%N/testsuites/modules/Gettext/testsuite
	<<
<<

# TODO: Nettle testsuite don't work because the path for the test program are 
# in %i, _and_ these tests are not installed in %d (because it was not their
# goal to be installed i guess)
SplitOff14: <<
	Package: %N-nettle
	Depends: gmp-shlibs, %N (= %v-%r)
	Description: Nettle (crypto) module for the Pike language
	Files: <<
		%p/lib/pike/pike7.6/modules/Nettle.so
		%p/share/pike/%N/testsuites/post_modules/Nettle/testsuite
	<<
<<

SplitOff15: <<
	Package: %N-sdl
	Description: SDL module for the Pike language
	Depends: sdl-shlibs, %N (= %v-%r)
	Files: %p/lib/pike/pike7.6/modules/SDL.so
<<

License: OSI-Approved
Homepage: http://pike.ida.liu.se/
Maintainer: Bertrand LUPART <bertrand@caudium.net>
