# security/openssl build failure



## KernelPanic (Aug 20, 2013)

This seemed a bit unusual for a fresh (and patched) FreeBSD 9.1 amd64 install. I only have perl-5.18 installed.


```
making all in engines...
echo 

making all in engines/ccgost...
making all in apps...
making all in test...
making all in tools...
installing man1/CA.pl.1
installing man1/asn1parse.1
installing man1/ca.1
installing man1/ciphers.1
installing man1/cms.1
cms.pod around line 457: Expected text after =item, not a number
cms.pod around line 461: Expected text after =item, not a number
cms.pod around line 465: Expected text after =item, not a number
cms.pod around line 470: Expected text after =item, not a number
cms.pod around line 474: Expected text after =item, not a number
POD document had syntax errors at /usr/local/bin/pod2man line 71.
*** [install_docs] Error code 255

Stop in /usr/ports/security/openssl/work/openssl-1.0.1e.
*** [do-install] Error code 1

Stop in /usr/ports/security/openssl.
*** [install] Error code 1

Stop in /usr/ports/security/openssl.
```

Since the package was up to date, I just used that instead.


----------



## SirDice (Aug 21, 2013)

It might be due to the Perl version you have installed. I think the default version is still 5.14.


----------



## gessel (Aug 21, 2013)

It may well be - I have perl-5.18.1 installed and am having the same issue:


```
installing man1/ciphers.1
installing man1/cms.1
cms.pod around line 457: Expected text after =item, not a number
cms.pod around line 461: Expected text after =item, not a number
cms.pod around line 465: Expected text after =item, not a number
cms.pod around line 470: Expected text after =item, not a number
cms.pod around line 474: Expected text after =item, not a number
POD document had syntax errors at /usr/local/bin/pod2man line 71.
*** [install_docs] Error code 255

Stop in /usr/ports/security/openssl/work/openssl-1.0.1e.
*** [do-install] Error code 1

Stop in /usr/ports/security/openssl.
*** [reinstall] Error code 1

Stop in /usr/ports/security/openssl.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20130821-35997-12d1xh env UPGRADE_TOOL=portupgrade UPGRADE_PORT=openssl-1.0.1_8 UPGRADE_PORT_VER=1.0.1_8 make -DFORCE_PKG_REGISTER reinstall
--->  Restoring the old version
Installing openssl-1.0.1_8... done
```


----------



## cpm@ (Aug 22, 2013)

It seems that the new pod2man(1)() from lang/perl5.18 has an issue with the cms(1)() manpage and probably with others too that break the build, so building using lang/perl5.16 or a lower version should work fine.


----------



## gessel (Aug 22, 2013)

Russ says:


> Changed in Pod::Simple 3.24, of which pod2man is only a client.  I believe
> OpenSSL upstream already has a patch/solution for this.  (In brief, if you
> want a numeric argument to =item to be parsed as a description list title
> instead, you have to do something to make it not a number.  The easiest
> ...



I can verify that downgrading to Perl 5.16 works. 

I tested openssl-1.0.2-stable-SNAP-20130822 against Perl 5.18.


```
# wget http://mirrors.ibiblio.org/openssl/snapshot/openssl-1.0.2-stable-SNAP-20130822.tar.gz
# ./config --prefix=/usr/local --openssldir=/usr/local/openssl
# make depend
# make
# make test
# make install
```

and got 


```
installing man1/cms.1
cms.pod around line 457: Expected text after =item, not a number
cms.pod around line 461: Expected text after =item, not a number
cms.pod around line 465: Expected text after =item, not a number
cms.pod around line 470: Expected text after =item, not a number
cms.pod around line 474: Expected text after =item, not a number
POD document had syntax errors at /usr/local/bin/pod2man line 71.
*** [install_docs] Error code 255

Stop in /root/openssl/openssl-1.0.2-stable-SNAP-20130822.
```

(1.0.2 installs normally with Perl 5.16)


----------



## cpm@ (Aug 23, 2013)

Please, apply the following patch to fix those errors:

```
--- doc/apps/cms.pod.orig       2013-08-23 14:21:12.000000000 +0200
+++ doc/apps/cms.pod    2013-08-23 14:24:39.000000000 +0200
@@ -450,28 +450,28 @@
 
 =over 4
 
-=item 0
+=item C<0>
 
 the operation was completely successfully.
 
-=item 1 
+=item C<1> 
 
 an error occurred parsing the command options.
 
-=item 2
+=item C<2>
 
 one of the input files could not be read.
 
-=item 3
+=item C<3>
 
 an error occurred creating the CMS file or when reading the MIME
 message.
 
-=item 4
+=item C<4>
 
 an error occurred decrypting or verifying the message.
 
-=item 5
+=item C<5>
 
 the message was verified correctly but an error occurred writing out
 the signers certificates.
```

Save it as patch-cms in /usr/ports/security/openssl/files, then you can install it normally with lang/perl5.18.


----------



## gessel (Aug 24, 2013)

*Thanks!*

The patch seems to be successful for fixing cms.pod, but there are still problems with man1/smime.1


```
installing man1/smime.1
smime.pod around line 315: Expected text after =item, not a number
smime.pod around line 319: Expected text after =item, not a number
smime.pod around line 323: Expected text after =item, not a number
smime.pod around line 328: Expected text after =item, not a number
smime.pod around line 332: Expected text after =item, not a number
POD document had syntax errors at /usr/local/bin/pod2man line 71.
*** [install_docs] Error code 255

Stop in /var/ports/usr/ports/security/openssl/work/openssl-1.0.1e.
*** [do-install] Error code 1

Stop in /usr/ports/security/openssl.
```

It appears Linux From Scratch has some patches for openssl-1.0.1e and Perl 5.18, which I edited to match your example and attached. I verified that the attached patch set works for OpenSSL 1.0.1e and Perl 5.18 on FreeBSD 9.1.

I have also verified that these patches do not break compatibility with Perl 5.16.


----------



## cpm@ (Aug 24, 2013)

@gessel,

Please, feel free to file a PR with the fixes at the freebsd-ports-bugs mailing list


----------



## kpa (Aug 25, 2013)

I believe freebsd-ports-bugs is not for posting fixes directly but the posts on the list come from the GNATS bug database automatically.


----------



## cpm@ (Aug 25, 2013)

kpa said:
			
		

> I believe freebsd-ports-bugs is not for posting fixes directly but the posts on the list come from the GNATS bug database automatically.



You are correct 


> About freebsd-ports-bugs
> 
> This is the mailing list for reporting bugs in FreeBSD ports.
> 
> ...


----------



## skillcoder (Sep 4, 2013)

> The patch seems to be successful for fixing cms.pod, but there are still problems with man1/smime.1


How to fix this problem with man1/smime.1?


```
installing man1/s_time.1
installing man1/sess_id.1
installing man1/smime.1
smime.pod around line 315: Expected text after =item, not a number
smime.pod around line 319: Expected text after =item, not a number
smime.pod around line 323: Expected text after =item, not a number
smime.pod around line 328: Expected text after =item, not a number
smime.pod around line 332: Expected text after =item, not a number
POD document had syntax errors at /usr/local/bin/pod2man line 71.
*** Error code 255

Stop in /usr/ports/security/openssl/work/openssl-1.0.1e.
*** Error code 1
```


----------



## cpm@ (Sep 4, 2013)

Hi @skillcoder,

Please, download and apply the attached patches of the comment #7.

Extract openssl-perl-5-18-patches.tar.gz to /usr/ports/security/openssl/files followed by an ordinary install:

```
# mv $HOME/openssl-perl-5-18-patches.tar.gz /usr/ports/security/openssl/files
# cd /usr/ports/security/openssl/files && tar -xvf openssl-perl-5-18-patches.tar.gz && rm openssl-perl-5-18-patches.tar.gz
# cd ..
# make install clean
```

See also the PR submitted by @gessel.


----------



## skillcoder (Sep 4, 2013)

I downloaded it, but how do I apply it? I don't know what I need to do with openssl-perl-5-18-patches.tar.gz


----------

