Difference between revisions of "Perl package guidelines"

From ArchWiki
Jump to: navigation, search
m (Example Makefile.PL PKGBUILD: license + variables)
m (Example Build.PL PKGBUILD: license + variables)
Line 57: Line 57:
 
url="http://search.cpan.org/~STEVE/String-Random"
 
url="http://search.cpan.org/~STEVE/String-Random"
 
makedepends=('perl-module-build')
 
makedepends=('perl-module-build')
license="GPL"
+
license=('GPL')
 
options=('!emptydirs')
 
options=('!emptydirs')
 
arch=('i686' 'x86_64')
 
arch=('i686' 'x86_64')
Line 64: Line 64:
  
 
build() {
 
build() {
   cd  $startdir/src/String-Random-$pkgver
+
   cd  ${srcdir}/String-Random-$pkgver
 
   eval `perl -V:archname`
 
   eval `perl -V:archname`
   perl Build.PL destdir=$startdir/pkg \
+
   perl Build.PL destdir=${pkgdir} \
 
       --install_path lib=/usr/lib/perl5/site_perl/current \
 
       --install_path lib=/usr/lib/perl5/site_perl/current \
 
       --install_path arch=/usr/lib/perl5/site_perl/current/${archname}
 
       --install_path arch=/usr/lib/perl5/site_perl/current/${archname}
 
   ./Build
 
   ./Build
 
   ./Build install
 
   ./Build install
   /usr/bin/find $startdir/pkg -name '.packlist' -delete
+
   /usr/bin/find ${pkgdir} -name '.packlist' -delete
   /usr/bin/find $startdir/pkg -name '*.pod' -delete
+
   /usr/bin/find ${pkgdir} -name '*.pod' -delete
 
}
 
}
 
</pre>
 
</pre>

Revision as of 22:06, 4 September 2008


There are basically two types of “distributions” on CPAN: those that rely on Makefile.PL and those that use Build.PL.


Perl 5.10.0-1 And After

Will be posted soon.


Before Perl 5.10.0-1

Packages before perl 5.10.0-1 installed modules into /usr/lib/perl5/current and /usr/lib/perl5/site_perl/current.


Example Makefile.PL PKGBUILD

# Contributor:  Your Name <your_email@foobar.org>
pkgname=perl-dbd-pg
pkgver=1.49
pkgrel=1
pkgdesc="Postgres Driver for DBI"
url="http://search.cpan.org/~DBDPG/DBD-Pg"
depends=('perl-dbi>=1.45')
license=('GPL')
options=('!emptydirs')
arch=('i686' 'x86_64')
source=(http://www.cpan.org/authors/id/D/DB/DBDPG/DBD-Pg-$pkgver.tar.gz) 
md5sums=('76b9d6a2f4cbaefcba23380f83998215')

build() {
  cd  ${srcdir}/DBD-Pg-$pkgver
  eval `perl -V:archname`
  /usr/bin/perl Makefile.PL \
      INSTALLARCHLIB=/usr/lib/perl5/current/${archname} \
      INSTALLSITELIB=/usr/lib/perl5/site_perl/current \
      INSTALLSITEARCH=/usr/lib/perl5/site_perl/current/${archname}
  /usr/bin/make || return 1
  /usr/bin/make DESTDIR=${pkgdir} install
  /usr/bin/find ${pkgdir} -name '.packlist' -delete
  /usr/bin/find ${pkgdir} -name '*.pod' -delete
}

Example Build.PL PKGBUILD

# Contributor:  Your Name <your_email@foobar.org>
pkgname=perl-string-random
pkgver=0.22
pkgrel=1
pkgdesc="Generate random strings"
url="http://search.cpan.org/~STEVE/String-Random"
makedepends=('perl-module-build')
license=('GPL')
options=('!emptydirs')
arch=('i686' 'x86_64')
source=(http://www.cpan.org/authors/id/S/ST/STEVE/String-Random-$pkgver.tar.gz) 
md5sums=('c0319f95c56450624cc646f7425e327e')

build() {
  cd  ${srcdir}/String-Random-$pkgver
  eval `perl -V:archname`
  perl Build.PL destdir=${pkgdir} \
       --install_path lib=/usr/lib/perl5/site_perl/current \
       --install_path arch=/usr/lib/perl5/site_perl/current/${archname}
  ./Build
  ./Build install
  /usr/bin/find ${pkgdir} -name '.packlist' -delete
  /usr/bin/find ${pkgdir} -name '*.pod' -delete
}