libsodium update: 1.0.0
[tomato.git] / release / src / router / dnscrypt / packages / fpm / fpm.sh
blob4f42be79b501d1d5d9f8d66a6160aef59b49f839
1 #! /bin/sh
3 VERSION="1.4.0"
4 MAINTAINER="Frank Denis <dnscrypt@pureftpd.org>"
5 CATEGORY="net"
6 URL="http://dnscrypt.org"
7 VENDOR="Frank Denis"
8 DESCRIPTION="A tool for securing communications between a client and a DNS resolver
9 The DNSCrypt protocol is very similar to DNSCurve, but focuses on
10 securing communications between a client and its first-level resolver.
11 While not providing end-to-end security, it protects the local network
12 (which is often the weakest link in the chain) against
13 man-in-the-middle attacks. It also provides some confidentiality to
14 DNS queries.
16 The DNSCrypt daemon acts as a DNS proxy between a regular client, like
17 a DNS cache or an operating system stub resolver, and a DNSCrypt-aware
18 resolver."
19 TMPDIR=${TMPDIR:-/tmp}
20 BASE_DIR=$(mktemp -d "$TMPDIR"/dnscrypt.XXXXXX)
21 INSTALL_DIR="${BASE_DIR}/usr"
22 PKG_NAME="dnscrypt-proxy"
23 COPYRIGHT_FILE="COPYING"
24 DEBIAN_COPYRIGHT_FILE="${INSTALL_DIR}/share/doc/${PKG_NAME}/copyright"
25 DEBIAN_CHANGELOG_FILE="${INSTALL_DIR}/share/doc/${PKG_NAME}/changelog.gz"
26 LICENSE="bsd"
28 export TZ=""
29 export LC_ALL="C"
30 export LC_TIME="C"
32 ./configure --prefix="$INSTALL_DIR" \
33 --enable-plugins --enable-plugins-root && \
34 make -j4 install
36 mkdir -p -- $(dirname "$DEBIAN_COPYRIGHT_FILE") || exit 1
37 cp -- "$COPYRIGHT_FILE" "$DEBIAN_COPYRIGHT_FILE" || exit 1
39 echo "${PKG_NAME} (${VERSION}) unstable; urgency=medium
40 * See ${URL}
42 -- ${MAINTAINER} $(date -R)" | gzip -9 > "$DEBIAN_CHANGELOG_FILE"
44 find "${INSTALL_DIR}/share/man" -type f -name "*.[0-9]" -exec gzip -9 {} \;
46 find "$BASE_DIR" -type d -exec chmod 755 {} \;
48 sudo chown -R 0:0 "$BASE_DIR" || exit 1
50 for t in deb rpm; do
51 fpm -s dir -t "$t" -n "$PKG_NAME" -v "$VERSION" -C "$BASE_DIR" \
52 -m "$MAINTAINER" --category "$CATEGORY" --url "$URL" --license "$LICENSE" \
53 --vendor "$VENDOR" --description "$DESCRIPTION" \
55 done