You are not logged in.

#1 2013-11-29 12:48:28

Tristelune
Member
Registered: 2007-10-09
Posts: 86

[SOLVED] PKGBUILD for a perl application (gscan2pdf)

Hello, I'm the maintainer of the package gscan2pdf and I have some problems to update the PKGBUILD
for the version 1.2.0. I'm a beginner, so perhaps I missed something that is well-known. The build() function contains
the following:

perl Makefile.PL
make
make DESTDIR=${pkgdir} install

But unfortunately it doesn't work. I get the following error when I run makepkg:

ln: target ‘usr/bin/’ is not a directory: No such file or directory
==> ERROR: A failure occurred in build().
    Aborting...

By the way, the PKGBUILD is:

# Maintainer: Tristelune  <tristelune1 at gmail dot com>
# Contributor: LeCrayonVert <greenarrow at archlinux dot us>
# Contributor: yugrotavele <yugrotavele at archlinux dot us>
# Contributor: Sven Salzwedel <sven_salzwedel@web.de>
# Contributor: Olaf Leidinger <leidola@newcon.de>

pkgname=gscan2pdf
pkgver=1.2.0
pkgrel=1
pkgdesc='A GUI to produce a multipage PDF from a scan'
arch=('i686' 'x86_64')
url='http://gscan2pdf.sourceforge.net/'
license=('GPL')
depends=('xsane' 'gtk2-perl' 'perl-locale-gettext' 'libtiff' 'sane'
         'perl-gtk2-ex-simple-list' 'imagemagick' 'perl-config-general>=2.40'
         'perl-pdf-api2' 'perl-goo-canvas' 'perl-gtk2-imageview' 'perl-sane' 
	 'perl-test-critic' 'perl-set-intspan' 'perl-proc-processtable' 'perl-log-log4perl' 'perl-html-parser' 'perl-try-tiny' 'unpaper' )
optdepends=('djvulibre' 'gocr' 'ocropus' 'xdg-utils' 'tesseract' 'cuneiform' )
source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz)
sha512sums=('98546936ff2b178c8047f46e6b38d0e9244e51cecbbfa69bf3f08d9f71cbbab261e47f8f5514558a892d5e7a178eb67c1cb3db50eb75b5d6a0a08cadb0095a17')

build() {

  cd ${srcdir}/${pkgname}-${pkgver}
  perl Makefile.PL
  make
  make DESTDIR=${pkgdir} install

  # Create symlinks to /usr/bin/site_perl/* in /usr/bin/
  cd ${pkgdir}
  ln -sf site_perl/gscan2pdf usr/bin/
  ln -sf site_perl/scanadf-perl usr/bin/
  ln -sf site_perl/scanimage-perl usr/bin/
  

  # Standard perl cleaning
  /usr/bin/find ${pkgdir} -name '.packlist' -o -name 'perllocal.pod' -delete
}

package() {
  # Create symlinks to /usr/bin/site_perl/* in /usr/bin/
  cd ${pkgdir}
  ln -sf site_perl/gscan2pdf usr/bin/
  ln -sf site_perl/scanadf-perl usr/bin/
  ln -sf site_perl/scanimage-perl usr/bin/
}

After searching what is wrong, I saw some files are installed in the HOME directory of the user, what I don't want to. I was told, I should rather change

  perl Makefile.PL
  make
  make DESTDIR=${pkgdir} install

to

  perl Makefile.PL INSTALL_BASE=${pkgdir}
  make
  make install

But I still have the problem. This time, it's the following:

$ makepkg 

msgfmt -c po/gscan2pdf-ab.po -o /usr/share/locale/ab/LC_MESSAGES/gscan2pdf.mo
msgfmt -c po/gscan2pdf-bg.po -o /usr/share/locale/bg/LC_MESSAGES/gscan2pdf.mo
msgfmt -c po/gscan2pdf-ca.po -o /usr/share/locale/ca/LC_MESSAGES/gscan2pdf.mo
po/gscan2pdf-ab.po:7: warning: header field 'Language' missing in header
msgfmt: error while opening "/usr/share/locale/ab/LC_MESSAGES/gscan2pdf.mo" for writing: Permission denied
Makefile:1036: recipe for target '/usr/share/locale/ab/LC_MESSAGES/gscan2pdf.mo' failed
make: *** [/usr/share/locale/ab/LC_MESSAGES/gscan2pdf.mo] Error 1
make: *** Waiting for unfinished jobs....
po/gscan2pdf-be.po:7: warning: header field 'Language' missing in header
msgfmt: error while opening "/usr/share/locale/be/LC_MESSAGES/gscan2pdf.mo" for writing: Permission denied
Makefile:1036: recipe for target '/usr/share/locale/be/LC_MESSAGES/gscan2pdf.mo' failed
make: *** [/usr/share/locale/be/LC_MESSAGES/gscan2pdf.mo] Error 1
po/gscan2pdf-bg.po:7: warning: header field 'Language' missing in header
msgfmt: error while opening "/usr/share/locale/bg/LC_MESSAGES/gscan2pdf.mo" for writing: Permission denied
Makefile:1036: recipe for target '/usr/share/locale/bg/LC_MESSAGES/gscan2pdf.mo' failed
make: *** [/usr/share/locale/bg/LC_MESSAGES/gscan2pdf.mo] Error 1
po/gscan2pdf-ca.po:7: warning: header field 'Language' missing in header
msgfmt: error while opening "/usr/share/locale/ca/LC_MESSAGES/gscan2pdf.mo" for writing: Permission denied
Makefile:1036: recipe for target '/usr/share/locale/ca/LC_MESSAGES/gscan2pdf.mo' failed
make: *** [/usr/share/locale/ca/LC_MESSAGES/gscan2pdf.mo] Error 1
==> ERROR: A failure occurred in build().
    Aborting...

It's because during the creation of the PKGBUILD, some files are installed in /usr/share/ rather than usr/share.
I had a look at the  Makefile.PL and it seems I can specify the location of usr/share with the variables SHAREINSTDIR and
SHAREDIR. But it's unclear for me If I have to set both. And perhaps the most important question: did I miss some perl Tool or am I going
in the right direction ?

Thank you!

Last edited by Tristelune (2013-12-06 11:52:05)

Offline

#2 2013-12-06 11:50:55

Tristelune
Member
Registered: 2007-10-09
Posts: 86

Re: [SOLVED] PKGBUILD for a perl application (gscan2pdf)

I have found the problem. I had the following in my .zshrc:

export PERL_LOCAL_LIB_ROOT="/home/user/perl5:$PERL_LOCAL_LIB_ROOT";
export PERL_MB_OPT="--install_base "/home/user/perl5"";
export PERL_MM_OPT="INSTALL_BASE=/home/user/perl5";
export PERL5LIB="/home/user/perl5/lib/perl5:$PERL5LIB";

Without those variables, nothing is installed in my HOME.

So the package can be updated now!

Offline

Board footer

Powered by FluxBB