aboutsummaryrefslogblamecommitdiffstats
path: root/main/lua-discount/APKBUILD
blob: d564361d2b9e3903ddb4dfb382154bf9c9ec0727 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                                    
                          

                    

                                              
                                                 
          
             






                                                                  
        
 


                                                                               
                    
                                  





                                                        
 

                    
                                  


                                                                        

 
          



                                                       
                                          
                                                                            

 



                                                
 
                                                                                                                                                                           
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
pkgname=lua-discount
pkgver=1.2.10.1
pkgrel=4
pkgdesc="Markdown implementation in C for Lua"
url="http://asbradbury.org/projects/lua-discount"
arch="all"
license="BSD"
depends=""
subpackages=""
makedepends=""
for _i in $_luaversions; do
	makedepends="$makedepends lua$_i-dev"
	subpackages="$subpackages lua$_i-discount:split_${_i/./_}"
done
install=

source="http://luaforge.net/frs/download.php/3758/lua-discount-1.2.10.1.tar.gz"

build() {
	cd "$srcdir"
	for i in $_luaversions; do
		cp -r $pkgname-$pkgver $i
		(cd $i
		make INCS="$(pkg-config --cflags lua$i)"
		) || return 1
	done
}

package() {
	cd "$srcdir"
	for i in $_luaversions; do
		install -D -m644 $i/discount.so \
			"$pkgdir"/usr/lib/lua/$i/discount.so || return 1
	done
}

_split() {
	local _ver=$1
	pkgdesc="$pkgdesc $_ver"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	depends=""
	mkdir -p "$subpkgdir"/usr/lib/lua/
	mv "$pkgdir"/usr/lib/lua/$_ver "$subpkgdir"/usr/lib/lua/ || return 1
}

for _v in $_luaversions; do
	eval "split_${_v/./_}() { _split $_v; }"
done


sha512sums="84c26a19d97ca085c785d1916b05bc0c78a2b5a0965d7feeef9a545c4b69c71627791c5d560bcb529c9ed414ed2ebe99f253879d6eae593a5b6f93291d66d5b1  lua-discount-1.2.10.1.tar.gz"