# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=ikiwiki
pkgver=3.20250501
pkgrel=1
pkgdesc="Ikiwiki is a wiki compiler. It converts wiki pages into HTML pages suitable for publishing on a website."
arch="noarch"
license="GPL-2.0-or-later"
url="https://ikiwiki.info"
depends="
	perl-cgi-formbuilder
	perl-cgi-session
	perl-html-parser
	perl-html-scrubber
	perl-html-template
	perl-locale-gettext
	perl-mail-sendmail
	perl-rpc-xml
	perl-text-markdown
	perl-timedate
	perl-time-duration
	perl-uri
	perl-yaml
	perl-yaml-libyaml
	"
source="
	https://git.joeyh.name/index.cgi/ikiwiki.git/snapshot/ikiwiki-$pkgver.tar.gz
	plugin-img-add-webp.patch
	po4a-rollback-0.69-support.patch
	"
subpackages="$pkgname-doc"

prepare() {
	default_prepare

	# Install module into the vendor directories
	sed -i -e 's/sbin/bin/g' Makefile.PL
}

build() {
	perl Makefile.PL PREFIX="/usr" INSTALL_BASE= INSTALLDIRS=vendor
	make PREFIX="/usr"
}

package() {
	make install DESTDIR="$pkgdir"

	# otherwise perl breaks
	find "$pkgdir" \( -name '.packlist' -or -name '*.pod' \) -exec rm '{}' +
}

sha512sums="
f45422e954bdafb744fe7deed2a0464164d52e1f89144ecfb090ca52ac9433ea6d9bc4a73f0d2a2ffab190fbea00f33fc46d3726f291a255dbeb946282a5ecd2  ikiwiki-3.20250501.tar.gz
9a7fb16ca9f53b19d380d050d500eac5e2ad9a8865688974fe3269b4e80e660fd5c07fe37a0a914bd35e363a2006abcdf42b6f903e084264f20492a0a8559d4b  plugin-img-add-webp.patch
31f64228adcdb6c2717bc1f37626751130cb0a3d20ff1f68f3151aeee0ddea488f873ff76e23205f2ae058196e69c91c22e525eab54a4125432412354c3d6f22  po4a-rollback-0.69-support.patch
"
