r-nmi: use metadata checks

This commit is contained in:
Pekka Ristola 2024-03-11 15:56:42 +02:00
parent d8bf5f6d19
commit c9a7ef823c
No known key found for this signature in database
GPG key ID: 2C20BE716E05213E
5 changed files with 23 additions and 22 deletions

View file

@ -7,10 +7,7 @@ sys.path.append(os.path.normpath(f'{__file__}/../../../lilac-extensions'))
from lilac_r_utils import r_pre_build
def pre_build():
r_pre_build(
_G,
expect_license = "GNU General Public License version 2",
)
r_pre_build(_G)
def post_build():
git_pkgbuild_commit()

View file

@ -3,24 +3,25 @@
_pkgname=NMI
_pkgver=2.0
pkgname=r-${_pkgname,,}
pkgver=2.0
pkgver=${_pkgver//-/.}
pkgrel=6
pkgdesc='Normalized Mutual Information of Community Structure in Network'
arch=('any')
url="https://cran.r-project.org/package=${_pkgname}"
license=('GPL')
pkgdesc="Normalized Mutual Information of Community Structure in Network"
arch=(any)
url="https://cran.r-project.org/package=$_pkgname"
license=('GPL-2.0-only')
depends=(
r
)
source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz")
sha256sums=('c39fd733944601dd314dc37a4b0332d374236aa2bb21f263833f79989387b7e7')
md5sums=('4c7ff8b6dc4834b2cfbe0b8cc9b5d88a')
b2sums=('828166b2e3d94f5238e9c20bef3cada33d7b48ac2c23e39ead02066c48d6cc1e8d119f39c311162a02c39257ecd47a15a28af65a6e46e61c3220250d7745cd99')
build() {
R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}"
mkdir build
R CMD INSTALL -l build "$_pkgname"
}
package() {
install -dm0755 "${pkgdir}/usr/lib/R/library"
cp -a --no-preserve=ownership "${_pkgname}" "${pkgdir}/usr/lib/R/library"
install -d "$pkgdir/usr/lib/R/library"
cp -a --no-preserve=ownership "build/$_pkgname" "$pkgdir/usr/lib/R/library"
}
# vim:set ts=2 sw=2 et:

View file

@ -1,12 +1,13 @@
#!/usr/bin/env python3
from lilaclib import *
import os
import sys
sys.path.append(os.path.normpath(f'{__file__}/../../../lilac-extensions'))
from lilac_r_utils import r_pre_build
def pre_build():
for line in edit_file('PKGBUILD'):
if line.startswith('_pkgver='):
line = f'_pkgver={_G.newver}'
print(line)
update_pkgver_and_pkgrel(_G.newver.replace(':', '.').replace('-', '.'))
r_pre_build(_G)
def post_build():
git_pkgbuild_commit()

View file

@ -3,7 +3,8 @@ maintainers:
- github: starsareintherose
email: kuoi@bioarchlinux.org
update_on:
- regex: NMI_([\d._-]+).tar.gz
source: regex
url: https://cran.r-project.org/package=NMI
- source: rpkgs
pkgname: NMI
repo: cran
md5: true
- alias: r

View file

@ -201,6 +201,7 @@ license_map = {
"CC0": "CC0-1.0",
"CeCILL": "CECILL-2.0",
"EPL": "EPL",
"GNU General Public License version 2": "GPL-2.0-only",
"GPL": "GPL-2.0-or-later",
"GPL (>= 2)": "GPL-2.0-or-later",
"GPL (>= 2.0)": "GPL-2.0-or-later",