#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=leafpad-noheader
_pkgname=leafpad
pkgver=0.8.19
pkgrel=01
pkgdesc="A notepad clone for GTK+ 2.0 with print header disabled"
arch=(x86_64)
url="http://tarot.freeshell.org/leafpad/"
depends=('gtk2' 'desktop-file-utils' 'gtk-update-icon-cache')
makedepends=('intltool')
conflicts=('leafpad')
provides=('leafpad')
# key not on server at this time 
#source=("https://download.savannah.gnu.org/releases/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.sig}
source=(https://download.savannah.gnu.org/releases/${_pkgname}/${_pkgname}-${pkgver}.tar.gz
		gtkprint.c.diff
		0001-fix-format-security-error-from-gcc.patch)
prepare() {
  cd "${srcdir}/${_pkgname}-${pkgver}"

  patch -Np1 < ../0001-fix-format-security-error-from-gcc.patch
  patch -p0 <../gtkprint.c.diff
}

build() {
  cd "${srcdir}/${_pkgname}-${pkgver}"

  ./configure \
	--prefix=/usr \
	--enable-chooser
  make
}

package() {
  cd "${srcdir}/${_pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
  echo 'StartupNotify=true' >> "${pkgdir}/usr/share/applications/leafpad.desktop"
}

#---- license gpg-key sha256sums ----

license=('GPL')

validpgpkeys=('05B80A3FFAF8FED36ADC7A31EE109F4A0F184934') # Tarot Osuji <tarot@sdf.org>

   md5sums=(2fa09a4d80884d32a9b5e4e80c7bbdd7  # leafpad-0.8.19.tar.gz
#	SKIP
	a01afce5b77fd78845e1d4985fd3c0f7  # gtkprint.c.diff
	1b45cff49cfc9a1961256b5cbcba5ed3) # 0001-fix-format-security-error-from-gcc.patch

sha256sums=(07d3f712f4dbd0a33251fd1dee14e21afdc9f92090fc768c11ab0ac556adbe97  # leafpad-0.8.19.tar.gz
#	SKIP
	51f2008f22b4e0ba8c6dc45d1b5ff9c614a7d1eb641917848397241ef212b73f  # gtkprint.c.diff
	2b99426837e0a78077931e33bbfac280b238e0d170366c09e62bf98770e837dc) # 0001-fix-format-security-error-from-gcc.patch


