]> git.ipfire.org Git - thirdparty/pdns.git/blob - build-scripts/dist-recursor
Merge pull request #3041 from pieterlexis/release-versioning
[thirdparty/pdns.git] / build-scripts / dist-recursor
1 #!/usr/bin/env bash
2
3 set -e
4
5 if [ "$0" != "./build-scripts/dist-recursor" ]; then
6 echo "Please run me from the root checkout dir"
7 exit 1
8 fi
9
10 if [ -z "$VERSION" ]; then
11 VERSION=$(./build-aux/gen-version)
12 if [ -z "$VERSION" ]; then
13 VERSION="UNKNOWN"
14 fi
15 fi
16
17 set -x
18
19 cd pdns
20
21 ragel dnslabeltext.rl -o dnslabeltext.cc
22
23 cd ../docs
24 pandoc -s -t man manpages/pdns_recursor.1.md -o pdns_recursor.1
25 pandoc -s -t man manpages/rec_control.1.md -o rec_control.1
26 cd -
27
28 DIST_HOST="$(id -u -n)@$(hostname -f 2>/dev/null || hostname 2>/dev/null || echo localhost)"
29
30 INCLUDES="iputils.hh arguments.hh base64.hh zoneparser-tng.hh \
31 rcpgenerator.hh lock.hh dnswriter.hh dnsrecords.hh dnsparser.hh utility.hh \
32 recursor_cache.hh rec_channel.hh qtype.hh misc.hh dns.hh syncres.hh \
33 sstuff.hh mtasker.hh mtasker.cc lwres.hh logger.hh pdnsexception.hh \
34 mplexer.hh pubsuffix.hh mbedtlscompat.hh \
35 dns_random.hh lua-recursor4.hh namespaces.hh \
36 recpacketcache.hh base32.hh cachecleaner.hh json.hh version.hh \
37 ws-recursor.hh ws-api.hh secpoll-recursor.hh \
38 responsestats.hh webserver.hh dnsname.hh dnspacket.hh ednssubnet.hh \
39 filterpo.hh rpzloader.hh ixfr.hh gss_context.hh resolver.hh dnssecinfra.hh \
40 dnsseckeeper.hh statbag.hh ueberbackend.hh sha.hh dnsbackend.hh comment.hh \
41 validate.hh validate-recursor.hh sortlist.hh rec-lua-conf.hh sholder.hh"
42
43 CFILES="syncres.cc iputils.cc misc.cc unix_utility.cc qtype.cc \
44 logger.cc arguments.cc lwres.cc pdns_recursor.cc \
45 recursor_cache.cc dnsparser.cc dnswriter.cc dnsrecords.cc rcpgenerator.cc \
46 base64.cc zoneparser-tng.cc rec_channel.cc rec_channel_rec.cc rec_control.cc \
47 selectmplexer.cc epollmplexer.cc kqueuemplexer.cc portsmplexer.cc pdns_hw.cc \
48 sillyrecords.cc pubsuffix.cc lua-recursor4.cc randomhelper.cc \
49 devpollmplexer.cc recpacketcache.cc dns.cc reczones.cc base32.cc nsecrecords.cc \
50 dnslabeltext.cc json.cc ws-recursor.cc ws-api.cc version.cc dns_random.cc \
51 responsestats.cc webserver.cc rec-carbon.cc secpoll-recursor.cc dnsname.cc \
52 filterpo.cc rpzloader.cc ixfr.cc dnssecinfra.cc gss_context.cc resolver.cc \
53 ednssubnet.cc validate.cc validate-recursor.cc mbedtlssigners.cc rec-lua-conf.cc \
54 sortlist.cc"
55
56 ./mkpubsuffixcc
57
58 DIRNAME=pdns-recursor-$VERSION
59 rm -rf $DIRNAME
60 mkdir $DIRNAME
61 cp $INCLUDES $CFILES $DIRNAME
62 cp Makefile-recursor $DIRNAME/Makefile.in
63 cp README-recursor $DIRNAME/README
64 cp ../COPYING ../NOTICE $DIRNAME/
65 cp config-recursor.h $DIRNAME/config.h
66 cat >>$DIRNAME/config.h <<EOF
67 #define VERSION "$VERSION"
68 #define DIST_HOST "$DIST_HOST"
69 #define HAVE_BOOST 1
70 #define HAVE_MBEDTLS2 1
71 EOF
72 mkdir -p $DIRNAME/ext/rapidjson/include/rapidjson/internal
73 cp -a ../ext/rapidjson/include/rapidjson/*.h $DIRNAME/ext/rapidjson/include/rapidjson/
74 cp -a ../ext/rapidjson/include/rapidjson/internal/*.h $DIRNAME/ext/rapidjson/include/rapidjson/internal
75 mkdir -p $DIRNAME/ext/mbedtls/include/mbedtls
76 cp -a ../ext/mbedtls/include/mbedtls/{config.h,check_config.h,aes.h,ripemd160.h,sha1.h,md.h,md5.h,sha256.h,sha512.h,md_internal.h} ../ext/mbedtls/include/mbedtls/base64.h ../ext/mbedtls/include/mbedtls/platform.h ../ext/mbedtls/include/mbedtls/version.h $DIRNAME/ext/mbedtls/include/mbedtls
77 cp -a ../ext/mbedtls/include/mbedtls/{entropy.h,ctr_drbg.h,rsa.h,ecp.h,bignum.h,oid.h,asn1.h,pk.h,ecdsa.h,cipher.h,x509.h} $DIRNAME/ext/mbedtls/include/mbedtls
78 cp -a ../ext/mbedtls/include/mbedtls/{bn_mul.h,config.h,entropy_poll.h,timing.h} $DIRNAME/ext/mbedtls/include/mbedtls
79
80 mkdir -p $DIRNAME/ext/mbedtls/library
81 cp -a ../ext/mbedtls/library/{aes.c,base64.c,md.c,md_wrap.c,md5.c,sha1.c,sha256.c,sha512.c,ripemd160.c} $DIRNAME/ext/mbedtls/library
82 cp -a ../ext/mbedtls/library/{rsa.c,bignum.c,oid.c,asn1parse.c,ctr_drbg.c,entropy.c,entropy_poll.c,timing.c} $DIRNAME/ext/mbedtls/library
83
84 cp -a ../ext/yahttp/ $DIRNAME/ext/yahttp
85
86 mkdir -p $DIRNAME/ext/luawrapper/include
87 cp ../ext/luawrapper/include/LuaContext.hpp $DIRNAME/ext/luawrapper/include
88 echo '#include "../../../config.h"' > $DIRNAME/ext/yahttp/yahttp/yahttp-config.h
89 mkdir $DIRNAME/rrd
90 cp tools/rrd/{create,update,makegraphs,index.html} $DIRNAME/rrd
91 cp dnslabeltext.rl $DIRNAME
92 cp pdns-recursor.init.d $DIRNAME
93 cp ../docs/pdns_recursor.1 ../docs/rec_control.1 $DIRNAME
94 cp configure-recursor $DIRNAME/configure
95 cp powerdns-example-script.lua $DIRNAME
96 mkdir -p $DIRNAME/contrib
97 cp ../contrib/systemd-pdns-recursor.service $DIRNAME/contrib
98 cp ../build-scripts/build-recursor-semistatic $DIRNAME/build-scripts
99 cp pdns-recursor.spec $DIRNAME
100
101 mkdir -p $DIRNAME/sysdeps
102 rm -f sysdeps-recursor/*~
103 cp sysdeps-recursor/* $DIRNAME/sysdeps
104 touch $DIRNAME/dnslabeltext.cc # avoid spurious recompiles
105 tar cf $DIRNAME.tar $DIRNAME
106 bzip2 -f $DIRNAME.tar # .. solaris