aboutsummaryrefslogtreecommitdiffstats
path: root/main/nano/APKBUILD
blob: 682d3abad36def022de5c8ead32e124e01b8e6cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Contributor: Michael Mason <ms13sp@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=nano
pkgver=2.9.8
pkgrel=0
pkgdesc="Enhanced clone of the Pico text editor"
url="https://www.nano-editor.org"
arch="all"
license="GPL-3.0-or-later"
makedepends="file-dev linux-headers ncurses-dev"
subpackages="$pkgname-doc $pkgname-syntax::noarch"
source="https://www.nano-editor.org/dist/v${pkgver%.*}/$pkgname-$pkgver.tar.xz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-nls \
		--with-wordbounds
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"

	make DESTDIR="$pkgdir" install
	install -Dm644 doc/sample.nanorc \
		"$pkgdir"/etc/nanorc

	# Proper syntax highlighting for APKBUILDs
	sed -i "/syntax/s/\"$/\" \"APKBUILD&/" \
		"$pkgdir"/usr/share/nano/sh.nanorc

	rm -rf "$pkgdir"/usr/lib/charset.alias
}

syntax() {
	pkgdesc="Syntax highlighting definitions for $pkgname"

	mkdir -p "$subpkgdir"/usr/share/$pkgname/
	mv "$pkgdir"/usr/share/$pkgname/*.nanorc \
		"$subpkgdir"/usr/share/$pkgname/
}

sha512sums="9a8230bb1312be4e7f44c5fb42c32d773dd4e488d41980c5aee1de0f9b5642b938a940649f3b5bfb848625c0c258ea15333cad861b5a368e3746f1f396df452b  nano-2.9.8.tar.xz"