Skip to content

Instantly share code, notes, and snippets.

@holybit
Last active December 23, 2015 12:09
Show Gist options
  • Save holybit/6632973 to your computer and use it in GitHub Desktop.
Save holybit/6632973 to your computer and use it in GitHub Desktop.
Perl rpm for CentOS 6.x. Perl was installed to /opt/perls/perl-5.16.3 in this case. The script below uses fpm and the -C option so I can have a my Perl in /opt/perls and at the same time build the rpm and then `yum install` it to /usr/local/perls. The problem I am running into is once Perl is installed into /usr/local/perls/perl-15.16.3/bin/perl…
$ cat ./fpm-perl-5.16.3
#!/bin/env bash
# Note, this will build a Perl RPM based on what's in /opt/perls/perl-$VERSION
# and package it for install to /usr/local/perls.
VERSION="5.16.3"
ITER=1
fpm -s dir -t rpm\
-v "$VERSION"\
-n "rp-perl-$VERSION"\
-p "rp-perl-VERSION-ITERATION.ARCH.rpm"\
--iteration "$ITER"\
--prefix /usr/local/perls\
--verbose\
-C /opt/perls\
-d "glibc"\
-d "glibc-devel"\
-d "nss-softokn-freebl"\
"perl-$VERSION"
$ ./fpm-perl-5.16.3
...
...
$ sudo yum install rp-perl-5.16.3.x86_64
$ /usr/local/perls/perl-5.16.3/bin/perl -V
Can't locate Config.pm in @INC (@INC contains: /opt/perls/perl-5.16.3/lib/site_perl/5.16.3/x86_64-linux-ld /opt/perls/perl-5.16.3/lib/site_perl/5.16.3 /opt/perls/perl-5.16.3/lib/5.16.3/x86_64-linux-ld /opt/perls/perl-5.16.3/lib/5.16.3 .).
BEGIN failed--compilation aborted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment