# Maintainer: PktSurf <smlinux@pktsurf.in>
app=perl-modules
version=5.24.3
build=3sml
homepage="https://www.perl.org/"
download="https://www.perl.org/"
desc="Collection of support addons for default perl installation"
requires="perl"

# modules and their versions
uriver=1.71
gettextver=1.07
dbiver=1.636
htmlparserver=3.72
xmlparserver=2.44
xmlsimplever=2.22
parseyapp=1.21
jsonver=4.10

prepbuilddir() {
  mkandenterbuilddir
  rm -rf DBI* HTML-Parser* Locale* URI* XML* 
}

build() {

  prepperlpackage() {
    fixbuilddirpermissions
    perl Makefile.PL INSTALLDIRS=vendor
    make
    make install DESTDIR=$pkg
    cd ..
  }
  
  # URI module
  tar xf $srcdir/URI-"$uriver".tar.?z*
  cd URI-"$uriver"
  cp LICENSE $pkgdocs/LICENSE.URI
  head -n 1000 Changes > $pkgdocs/CHANGES.URI
  prepperlpackage

  # gettext module
  tar xf $srcdir/gettext-"$gettextver".tar.?z*
  cd Locale-gettext-"$gettextver"
  prepperlpackage

  # DBI module
  tar xf $srcdir/DBI-"$dbiver".tar.?z*
  cd DBI-"$dbiver"
  cp LICENSE $pkgdocs/LICENSE.DBI
  prepperlpackage
  
  # HTML-Parser module
  tar xf $srcdir/HTML-Parser-"$htmlparserver".tar.?z*
  cd HTML-Parser-"$htmlparserver"
  cp README $pkgdocs/README.HTML-PARSER
  prepperlpackage

  # XML-Parser module
  tar xf $srcdir/XML-Parser-"$xmlparserver".tar.?z*
  cd XML-Parser-"$xmlparserver"
  cp README $pkgdocs/README.XML-PARSER
  prepperlpackage

  # Parse-Yapp module
  tar xf $srcdir/Parse-Yapp-"$parseyapp".tar.?z*
  cd Parse-Yapp-"$parseyapp"
  cp README $pkgdocs/README.PARSE-YAPP
  prepperlpackage

  # JSON module
  tar xf $srcdir/JSON-"$jsonver".tar.?z*
  cd JSON-"$jsonver"
  prepperlpackage

  # finally, XML-Simple module
  tar xf $srcdir/XML-Simple-"$xmlsimplever".tar.?z*
  cd XML-Simple-"$xmlsimplever"
  cp LICENSE $pkgdocs/LICENSE.XML-SIMPLE
  prepperlpackage

  mkfinalpkg
}

sha512sums="
8d541ada1fabb7e82dd4f47c43edf79cc70c783ef3582a9911b13239734876aee9f27095f2526e6923d07b7ac86df48ee081af1ca6000df0559a13c75b6f6ed3  DBI-1.636.tar.gz
9fded69219791af085018ffbe6737e74e370c543af52aa221aec174daf52d1b8d3cdd07f025176c0212ae572a924555262f2eefc73781f82cdb7d9cff58ae716  HTML-Parser-3.72.tar.gz
dbf6182d4813ff7e355ea1713c748bfdf8290040a93f123acec645c7a1733fe457ab6e0ab51c4ec83cf82bc43d7fb35cbf89875df7b5c2ffc9635e85458cfeee  Parse-Yapp-1.21.tar.gz
db412b75054a4d315eb861060fa4641832c2428b9dfe56bbe35f530c9ba572d4de2061d9782454750293dd5a64f3375830988d8512f410e84a9d599c80458405  URI-1.71.tar.gz
4790d20d89478880b18255679727e5b2fb2860bb4de67d5032c805fd44c9f90697a240a612aba51255325192253aa578b346d658b29f631a4e92ad96e7d65b61  XML-Parser-2.44.tar.gz
b5e5d36726b8a0efcf7200522d802a7f733c883526db2dba64ce23bf7e044d20d9186fac3bb2f2940807a30f746301f690129c4c542341c8a57a735471b5f4d7  XML-Simple-2.22.tar.gz
d3716a597d586ee2ff29472ca7b13aaf67770299de31e5f12abafebc879bbe4a1e1dbc0025cf4f3dc29992955f26cffc3be387d974c3911af095d5b49e67a1c6  gettext-1.07.tar.gz
"
