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

# source: james
TARBALL=fossil-src-$PKGVER.tar.gz
MD5SUM=b915e9d9a00ef2310d3043a471b8f050
#SRC_URL=http://fossil-scm.org/index.html/uv/$TARBALL
SRC_URL=http://distro.ibiblio.org/fatdog/source/800/$TARBALL
BUNDLE=

SLACKREQ='openssl libfuse'
SLACKDESC="fossil: fossil $PKGVER (Fossil SCM)  
fossil:  
fossil: Fossil is a distributed version control systems (also known as source 
fossil: code management - SCM). In addition to the usual SCM functions, Fossil 
fossil: comes with built-in bug tracker, wiki, events/milestones and 
fossil: web-interface.  
fossil: 
fossil: 
fossil: 
fossil: 
fossil:
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/fossil* &&
	patch -Np1 -i ../pkg/openssl-1.1.patch &&
	patch -Np0 -i ../pkg/upstream-0df5249d51b9c49ae323602a04c11590dff5dea4.patch &&
	patch -Np1 -i ../pkg/fossil-fix-append-to-ticket.patch
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/fossil* &&
	
	### old way to build
	# make $MAKEFLAGS -f Makefile.classic &&
	# cp fossil /usr/bin &&
		
	### modern build, needed to support "fossil fuse" command
	./configure --prefix=/usr &&
	make $MAKEFLAGS && make install &&

	pkg_build_slackdesc
}
