summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 44304643d054a02b97aede088b65a5731c2f4730 (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
# Maintainer: tPenguinLTG <tpenguinltg@disroot.org>
pkgname=oed
pkgver=7.1
pkgrel=1
pkgdesc="OpenED: Portable OpenBSD ed(1) editor."
arch=(x86_64 i686)
url="https://github.com/ibara/oed"
license=('BSD' 'ISC')
depends=()
source=("https://github.com/ibara/${pkgname}/archive/refs/tags/${pkgname}-${pkgver}.tar.gz")
sha256sums=('227ad4e6e9d2adb3a4b743c8ad3a50bcda63dea146d41bd6cbd8b79f495b057b')

build() {
	local f
	local license_file

	cd "$pkgname-$pkgname-$pkgver"

	./configure --prefix=/usr --mandir=/usr/share/man
	make

	# Extract licenses from files
	mkdir ../licenses
	for f in *.c *.h; do
	  license_file="../licenses/${f}.LICENSE"
          sed '/Copyright/!d; :a; s/ \* \{0,1\}//; n; /\*\//d; $!ba' "$f" >"$license_file"
          [ -s "$license_file" ] || rm -f -- "$license_file"
        done
}

package() {
	local f

	cd "$pkgname-$pkgname-$pkgver"
	make DESTDIR="$pkgdir/" install

	# Install licenses
	for f in ../licenses/*.LICENSE; do
	  install -Dm644 "$f" "$pkgdir/usr/share/licenses/$pkgname/${f##*/}"
	done
}