3 # Note: this script was written on Ubuntu 14.04 and will need work in order to
4 # work on additional platforms. This is left as an exercise for the reader.
8 BOOST_VERSION=${BOOST_VERSION:-1.54.0}
9 LIBEVENT_VERSION=${LIBEVENT_VERSION:-2.0-5}
10 SSL_VERSION=${SSL_VERSION:-1.0.0}
12 VERSION=${VERSION:-"$(sed 's/:/./' VERSION)"}
13 ITERATION=${ITERATION:-1}
15 DESTDIR=${DESTDIR:-$(mktemp -d)}
16 DEBUGDIR=${DEBUGDIR:-$DESTDIR/usr/lib/debug}
17 PKGDIR=${PKGDIR:-/tmp}
19 DESC="Folly is an open-source C++ library developed and used at Facebook
20 as a foundation for our infrastructure."
21 URL=https://github.com/facebook/folly
22 LICENSE="Apache License v2.0"
23 MAINTAINER="Folly Eng"
25 which fpm || (echo "Please install fpm from https://github.com/jordansissel/fpm" && exit 1)
29 [ -e ./configure ] || autoreconf -if
30 [ -e Makefile ] || ./configure --prefix=/usr
32 make install DESTDIR="$DESTDIR"
34 # Move symbols to debug file
35 [ -d "$DEBUGDIR/usr/lib" ] || mkdir -p "$DEBUGDIR/usr/lib"
36 find "$DESTDIR/usr/lib" -maxdepth 1 -iname "lib*.so.*" -type f \
37 -execdir objcopy --only-keep-debug {} "$DEBUGDIR/usr/lib/{}.debug" \; \
38 -execdir strip --strip-debug --strip-unneeded {} \; \
39 -execdir objcopy --add-gnu-debuglink "$DEBUGDIR/usr/lib/{}.debug" {} \;
44 -n "libfolly$VERSION" \
45 -v "$VERSION" --iteration "$ITERATION" \
46 -p "$PKGDIR/NAME_VERSION-ITERATION_ARCH.deb" \
48 --description "$DESC" \
51 --license "$LICENSE" \
52 --maintainer "$MAINTAINER" \
56 --depends libstdc++6 \
57 --depends libboost-context"$BOOST_VERSION" \
58 --depends libboost-filesystem"$BOOST_VERSION" \
59 --depends libboost-program-options"$BOOST_VERSION" \
60 --depends libboost-regex"$BOOST_VERSION" \
61 --depends libboost-system"$BOOST_VERSION" \
62 --depends libboost-thread"$BOOST_VERSION" \
63 --depends libdouble-conversion1 \
64 --depends libevent-"$LIBEVENT_VERSION" \
65 --depends libgflags2 \
66 --depends libgoogle-glog0 \
68 --depends libjemalloc1 \
71 --depends libsnappy1 \
72 --depends libssl"$SSL_VERSION" \
74 --exclude usr/lib/debug \
75 --exclude usr/lib/*.a \
76 --exclude usr/lib/*.la \
82 -v "$VERSION" --iteration "$ITERATION" \
83 -p "$PKGDIR/NAME_VERSION-ITERATION_ARCH.deb" \
85 --description "$DESC" \
88 --license "$LICENSE" \
89 --maintainer "$MAINTAINER" \
91 --depends "libfolly$VERSION" \
92 --exclude usr/lib/*.so* \