summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b0dcee2cf20b8dfab3650c57c482799e9e12c39b (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Maintainer: nl6720 <nl6720@archlinux.org>
# Contributor: Keshav Amburay <(the ddoott ridikulus ddoott rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: David Runge <dvzrv@archlinux.org>

pkgname='refind-git'
pkgver=0.12.0.r693.g5b1a975
pkgrel=1
pkgdesc='rEFInd Boot Manager - git version'
url='https://www.rodsbooks.com/refind/'
arch=('any')
license=('BSD' 'CCPL' 'FDL1.3' 'GPL2' 'GPL3' 'LGPL3')
depends=('bash' 'dosfstools' 'efibootmgr' 'which')
makedepends=('git' 'gnu-efi-libs')
optdepends=('gptfdisk: for finding non-vfat ESP with refind-install'
            'imagemagick: for refind-mkfont'
            'openssl: for generating local certificates with refind-install'
            'preloader-signed: pre-signed Secure Boot shim loader'
            'python: for refind-mkdefault'
            'sudo: for privilege elevation in refind-install and refind-mkdefault'
            'shim-signed: pre-signed Secure Boot shim loader'
            'sbsigntools: for EFI binary signing with refind-install')
conflicts=("${pkgname%-git}" "refind-efi")
replaces=('refind-efi-git')
provides=("${pkgname%-git}=${pkgver}" "refind-efi=${pkgver}")
# the drivers don't build with many jobs
options=('!makeflags')
source=('refind::git+https://git.code.sf.net/p/refind/code#branch=master')
sha512sums=('SKIP')
_arch='x64'

pkgver() {
	cd "${srcdir}/${pkgname%-git}/"
	printf '%s.r%s.g%s' "$(grep -Po 'REFIND_VERSION L"\K[\d.]+' "${srcdir}/${pkgname%-git}/include/version.h")" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	cd "${srcdir}/${pkgname%-git}/"
	# removing the path prefix from the css reference, so that the css can live in the same directory
	sed -e 's|../Styles/||g' -i "docs/${pkgname%-git}/"*.html
	# hardcode RefindDir, so that refind-install can find refind_x64.efi
	sed -e 's|RefindDir=\"\$ThisDir/refind\"|RefindDir="/usr/share/refind/"|g' -i refind-install
}

build() {
	cd "${srcdir}/${pkgname%-git}/"
	make
	make gptsync
	make fs
}

package() {
	cd "${srcdir}/${pkgname%-git}/"
	# the install target calls refind-install, therefore we install things manually

	# efi binaries
	install -vDm 0644 refind/*.efi -t "${pkgdir}/usr/share/${pkgname%-git}"
	install -vDm 0644 drivers_*/*.efi -t "${pkgdir}/usr/share/refind/drivers_${_arch}"
	install -vDm 0644 gptsync/*.efi -t "${pkgdir}/usr/share/${pkgname%-git}/tools_${_arch}"
	# sample config
	install -vDm 0644 "${pkgname%-git}.conf-sample" -t "${pkgdir}/usr/share/${pkgname%-git}"
	# keys
	install -vDm 0644 keys/*{cer,crt} -t "${pkgdir}/usr/share/${pkgname%-git}/keys"
	# keysdir
	install -vdm 0700 "${pkgdir}/etc/refind.d/keys"
	# fonts
	install -vDm 0644 fonts/*.png -t "${pkgdir}/usr/share/${pkgname}/fonts"
	# icons
	install -vDm 0644 icons/*.png -t "${pkgdir}/usr/share/${pkgname%-git}/icons"
	install -vDm 0644 icons/svg/*.svg -t "${pkgdir}/usr/share/${pkgname%-git}/icons/svg"
	# scripts
	install -vDm 0755 {refind-{install,mkdefault},mkrlconf,mvrefind} -t "${pkgdir}/usr/bin"
	install -vDm 0755 fonts/mkfont.sh "${pkgdir}/usr/bin/${pkgname%-git}-mkfont"
	# man pages
	install -vDm 0644 docs/man/*.8 -t "${pkgdir}/usr/share/man/man8"
	# docs
	install -vDm 0644 {CREDITS,NEWS,README}.txt -t "${pkgdir}/usr/share/doc/${pkgname%-git}"
	install -vDm 0644 fonts/README.txt "${pkgdir}/usr/share/doc/${pkgname%-git}/README.${pkgname%-git}-mkfont.txt"
	install -vDm 0644 icons/README "${pkgdir}/usr/share/doc/${pkgname%-git}/README.icons.txt"
	install -vDm 0644 keys/README.txt "${pkgdir}/usr/share/doc/${pkgname%-git}/README.keys.txt"
	install -vDm 0644 "docs/${pkgname%-git}/"*.{html,png,svg,txt} -t "${pkgdir}/usr/share/doc/${pkgname%-git}/html"
	install -vDm 0644 docs/Styles/*.css -t "${pkgdir}/usr/share/doc/${pkgname%-git}/html"
	# license
	install -vDm 0644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
}