# Error while building PHP5 (gettext related)



## MauroEldritch (Jan 28, 2014)

Hi.

As always on a fresh install, I try to install lang/php5. Every single time I tried to build it in the past was successful with not even a warning. Today I was having the following issue relating p5-Locale-gettext. This is the second time it shows up, the first one while building emulators/virtualbox-ose. Reading the dump I believed this was an issue on Perl not being found, tried to install it but still have this disturbing around.

Any help will be appreciated.

(FreeBSD 9.2 on x86).

```
===>  Installing for m4-1.4.17,1
===>  Checking if devel/m4 already installed
===>   Returning to build of autoconf-2.69
===>   autoconf-2.69 depends on executable: help2man - not found
===>    Verifying install for help2man in /usr/ports/misc/help2man
===>   help2man-1.43.3_1 depends on package: p5-Locale-gettext>=0 - not found
===>    Verifying install for p5-Locale-gettext>=0 in /usr/ports/devel/p5-Locale-gettext
===>  Building package for p5-Locale-gettext-1.05_3
Creating package /usr/ports/devel/p5-Locale-gettext/work/p5-Locale-gettext-1.05_3.tbz
Registering depends: gettext-0.18.3.1 libiconv-1.14 perl5.18-5.18.2.
Creating bzip'd tar ball in '/usr/ports/devel/p5-Locale-gettext/work/p5-Locale-gettext-1.05_3.tbz'
tar: lib/perl5/site_perl/5.14/mach/auto/Locale/gettext/.packlist: Cannot stat: No such file or directory
tar: lib/perl5/site_perl/5.14/mach/auto/Locale/gettext/gettext.so: Cannot stat: No such file or directory
tar: lib/perl5/site_perl/5.14/mach/auto/Locale/gettext/gettext.bs: Cannot stat: No such file or directory
tar: lib/perl5/site_perl/5.14/mach/Locale/gettext.pm: Cannot stat: No such file or directory
tar: lib/perl5/5.14/man/man3/Locale::gettext.3.gz: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors.
pkg_create: make_dist: tar command failed with code 256
*** [do-package] Error code 1

Stop in /usr/ports/devel/p5-Locale-gettext.
*** [build-depends] Error code 1

Stop in /usr/ports/misc/help2man.
*** [install] Error code 1

Stop in /usr/ports/misc/help2man.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/autoconf.
*** [build-depends] Error code 1

Stop in /usr/ports/lang/php5.
*** [install] Error code 1

Stop in /usr/ports/lang/php5.
```


----------



## cpm@ (Jan 28, 2014)

To avoid this annoying error, just add in your $PORTNAME/Makefile

```
NO_STAGE= yes
```


----------



## MauroEldritch (Jan 28, 2014)

Works like a charm. Thank you very much, sir.


----------



## MauroEldritch (Jan 28, 2014)

Sorry for double-posting, but I still can't get past this error while building misc/help2man:

In fact, I was reading the second entry (first one throws ViewVC Exception - 400 Bad Request), and did exactly as stated in this second document, rebuilding every p5-* port available (after updating ports). But just didn't worked. Do I have to update an specific port or do another workaround? Thanks.


```
===>  Script "configure" failed unexpectedly.
Please read UPDATING entry 20130612
(http://svnweb.freebsd.org/ports/head/UPDATING?r1=320405&r2=32067) and
PR/184276 (http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/184276) to fix
your Perl installation if you got the error message "configure: error: perl
module Locale::gettext required".
*** [do-configure] Error code 1

Stop in /usr/ports/misc/help2man.
*** [install] Error code 1

Stop in /usr/ports/misc/help2man.
*** [build-depends] Error code 1

Stop in /usr/ports/devel/autoconf.
*** [build-depends] Error code 1

Stop in /usr/ports/lang/php5.
*** [install] Error code 1

Stop in /usr/ports/lang/php5.
#
```

UPDATE 1: Tried to rebuild devel/p5-Locale-gettext and while everything seems fine, at the end I'm stuck with the following error:


```
===>  Checking if devel/p5-Locale-gettext already installed
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
===>   Registering installation for p5-Locale-gettext-1.05_3
===>  Cleaning for perl5-5.16.3_6
rm: fts_read: No such file or directory
*** [do-clean] Error code 1

Stop in /usr/ports/lang/perl5.16.
*** [clean] Error code 1

Stop in /usr/ports/lang/perl5.16.
*** [limited-clean-depends] Error code 1

Stop in /usr/ports/devel/p5-Locale-gettext.
*** [clean] Error code 1

Stop in /usr/ports/devel/p5-Locale-gettext.
```


----------



## cpm@ (Jan 29, 2014)

Please, be sure that you've already read the related entries sorted by date for gettext and Perl in /usr/ports/UPDATING. 

Primarily, read UPDATING entry 20130316.

P.S. Take in mind that you need to upgrade lang/perl5.14 to a supported version. Furthermore, you will verify that it's not necessary to use NO_STAGE option in p5-Locale-gettext/Makefile. 
P.S.S. The comment #2 may be omitted


----------



## nanotek (Jan 31, 2014)

I can't wait till UPDATING procedures are automated. Is it really a difficult task for developers to accomplish or is it just that time is better spent elsewhere? If this prehistoric environment still exists when I am qualified, this will be my first project.


----------



## Fud0h (Apr 20, 2015)

I ran into this issue trying to install sysutils/rubygem-chef, and then saw it again while trying to install another port. Both required devel/p5-Locale-gettext but the port of that was failing.


```
Registering installation for p5-Locale-gettext-1.05_4
pkg-static: Unable to access file /usr/ports/devel/p5-Locale-gettext/work/stage/usr/local/lib/perl5/site_perl/mach/5.16/auto/Locale/gettext/gettext.so: No such file or directory
pkg-static: Unable to access file /usr/ports/devel/p5-Locale-gettext/work/stage/usr/local/lib/perl5/site_perl/mach/5.16/Locale/gettext.pm: No such file or directory
pkg-static: Unable to access file /usr/ports/devel/p5-Locale-gettext/work/stage/usr/local/lib/perl5/site_perl/man/man3/Locale::gettext.3.gz: No such file or directory
```

I got into the work directory and it seems the port is placing the files in ./work/stage/usr/local/lib/perl5/5.16/mach instead but looking for them in mach/5.16. I manually copied them over and then got this error:


```
/usr/ports/devel/p5-Locale-gettext]$ sudo make install
===> Installing for p5-Locale-gettext-1.05_4
===> p5-Locale-gettext-1.05_4 depends on file: /usr/local/bin/perl5.16.3 - found
===> p5-Locale-gettext-1.05_4 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so)
===> Checking if p5-Locale-gettext already installed
===> Registering installation for p5-Locale-gettext-1.05_4
pkg-static: Unable to access file /usr/ports/devel/p5-Locale-gettext/work/stage/usr/local/lib/perl5/site_perl/man/man3/Locale::gettext.3.gz: No such file or directory
[LIST]
[*]Error code 7
[/LIST]
```
---------------------------
so I located the gettext.3 in

```
/usr/ports/devel/p5-Locale-gettext/work/stage/usr/local/lib/perl5/5.16/man/man3]$ ls
[LIST]
[*]Locale::gettext.3
[/LIST]
```

Manually gzipped it, and moved it to the proper directory listed above.
Ok now the package successfully build and installed!
But then as I went back to rubygems-chef I get this error:


```
===> Script "configure" failed unexpectedly.
Please read UPDATING entry 20130612
(http://svnweb.freebsd.org/ports/head/UPDATING?r1=320405&r2=32067) and
PR/184276 (http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/184276) to fix
your Perl installation if you got the error message "configure: error: perl
module Locale::gettext required".
```

Reading those two links (or the one that is still available) tells me I need to rebuild all my p5-* packages!

So I go digging in /usr/local/lib/perl5 and find the missing .pm and .so:

```
/usr/local/lib/perl5/site_perl/mach/5.16# cp -r * /usr/local/lib/perl5/site_perl/5.16/mach
```

And now the issue is solved. I would patch the port but not sure how to do that yet.


----------

