1#!/bin/bash
2
3# For some reason, PAR::Packer on linux is clever and when processing link lines
4# resolves any symlinks but names the packed lib the same as the link name. This is
5# a good thing. This is a feature of PAR::Packer on ELF systems.
6
7# Have to be very careful about Perl modules with .so binary libraries as sometimes
8# (LibXML.so for example), they include RPATH which means that the PAR cache
9# is not searched first, even though it's at the top of LD_LIBRARY_PATH. So, the wrong
10# libraries will be found and things may well break. Strip any RPATH out of such libs
11# with "chrpath -d <lib>". Check for presence with "readelf -d <lib>".
12#
13# Check all perl binaries with:
14# for file in `find /usr/local/perl/lib* -name \*.so`; do echo $file >> /tmp/out ;readelf -d $file >> /tmp/out; done
15# and then grep the file for "RPATH"
16
17# Had to add /etc/ld.so.conf.d/biber.conf and put "/usr/local/perl/lib" in there
18# and then run "sudo ldconfig" so that libbtparse.so is found. Doesn't really make
19# a difference to the build, just the running of Text::BibTeX itself.
20
21# Using a newer locally built libz and libxml2 (and rebuilt XML::LibXML) in /usr/local because
22# beginning with 32-bit Debian Wheezy, the older ones would segfault
23
24# Have to explicitly include the Input* modules as the names of these are dynamically
25# constructed in the code so Par::Packer can't auto-detect them.
26# Same with some of the output modules.
27
28PAR_VERBATIM=1 /usr/local/perl/bin/pp \
29  --compress=6 \
30  --module=deprecate \
31  --module=Biber::Input::file::bibtex \
32  --module=Biber::Input::file::biblatexml \
33  --module=Biber::Input::file::ris \
34  --module=Biber::Input::file::zoterordfxml \
35  --module=Biber::Input::file::endnotexml \
36  --module=Biber::Output::dot \
37  --module=Biber::Output::bbl \
38  --module=Biber::Output::bibtex \
39  --module=Biber::Output::biblatexml \
40  --module=Pod::Simple::TranscodeSmart \
41  --module=Pod::Simple::TranscodeDumb \
42  --module=List::MoreUtils::XS \
43  --module=List::MoreUtils::PP \
44  --module=Encode::Byte \
45  --module=Encode::CN \
46  --module=HTTP::Status \
47  --module=HTTP::Date \
48  --module=Encode::Locale \
49  --module=Encode::CJKConstants \
50  --module=Encode::EBCDIC \
51  --module=Encode::Encoder \
52  --module=Encode::GSM0338 \
53  --module=Encode::Guess \
54  --module=Encode::JP \
55  --module=Encode::KR \
56  --module=Encode::MIME::Header \
57  --module=Encode::Symbol \
58  --module=Encode::TW \
59  --module=Encode::Unicode \
60  --module=Encode::Unicode::UTF7 \
61  --module=Encode::EUCJPASCII \
62  --module=Encode::JIS2K \
63  --module=Encode::HanExtra \
64  --module=File::Find::Rule \
65  --module=IO::Socket::SSL \
66  --link=/usr/local/perl/lib/libbtparse.so \
67  --link=/usr/local/lib/libxml2.so.2 \
68  --link=/usr/local/lib/libz.so.1 \
69  --link=/usr/lib/libxslt.so.1 \
70  --link=/usr/lib/libexslt.so.0 \
71  --link=/usr/lib/libssl.so.1.0.0 \
72  --link=/usr/lib/libcrypto.so.1.0.0 \
73  --addlist=biber.files \
74  --cachedeps=scancache \
75  --output=biber-linux_x86_32 \
76  /usr/local/perl/bin/biber
77