### this file is sourced not run
PKGVER=1.14.2
PKGBUILD=1
PKGARCH=x86_64

PYTHON_VER=3.11

# source: BLFS 11.3
TARBALL=subversion-$PKGVER.tar.bz2
MD5SUM=9927b167d1c67d663ca63125907f6f69
SRC_URL=http://archive.apache.org/dist/subversion/$TARBALL
BUNDLE=

SLACKREQ='libapr-util sqlite3 libserf openssl' # swig build-time only
SLACKDESC="subversion: subversion $PKGVER (Version control system)  
subversion:  
subversion: Subversion is a version control system that is designed to be a 
subversion: compelling replacement for CVS in the open source community. It 
subversion: extends and enhances CVS feature set, while maintaining a similar 
subversion: interface for those already familiar with CVS. These instructions 
subversion: install the client and server software used to manipulate a 
subversion: Subversion repository. Creation of a repository is covered at 
subversion: Running a Subversion Server.  
subversion: 
subversion:
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/subversion*

	# BLFS 11.3 - use python3
	grep -rl '^#!.*python$' | xargs sed -i '1s/python/&3/' &&

	# BLFS 11.3 - support Ruby 3.2
	sed -e 's/File.exists?/File.exist?/'               \
		-i subversion/bindings/swig/ruby/svn/util.rb   \
		   subversion/bindings/swig/ruby/test/test_wc.rb &&
	
	CONFFLAGS="$CONFFLAGS \
		--disable-static  \
		--with-apache-libexecdir \
		--with-lz4=internal      \
		--with-utf8proc=internal \
		--with-serf=/usr \
	" &&
	pkg_build_autoconf &&
	
	# perl bindings - disable if swig not installed
	make swig-pl && 
	make install-swig-pl && 

	# python bindings - disable if swig not installed
	# james note: overrated, still doesn't work even now!
	# perhaps got confused because we have to pythons?
	#make swig-py \
	#	 swig_pydir=/usr/$LIBDIR/python$PYTHON_VER/site-packages/libsvn \
	#	 swig_pydir_extra=/usr/lib/python$PYTHON_VER/site-packages/svn # for Python
	#make install-swig-py && 
						
	#doxygen doc/doxygen.conf &&
	install -v -m755 -d /usr/share/doc/subversion-$PKGVER &&
	cp      -v -R       doc/* \
						/usr/share/doc/subversion-$PKGVER &&
	pkg_build_slackdesc
}
