]> git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/dist-recursor
Set module versions to VERSION
[thirdparty/pdns.git] / pdns / dist-recursor
1 #!/usr/bin/env bash
2
3 set -e
4
5 ragel dnslabeltext.rl -o dnslabeltext.cc
6
7 cd ../docs
8 pandoc -s -t man manpages/pdns_recursor.1.md -o pdns_recursor.1
9 pandoc -s -t man manpages/rec_control.1.md -o rec_control.1
10 cd -
11 ## The following lines will be patched by set-version-recursor.
12 VERSION=""
13 DIST_HOST=""
14 ## End patch area.
15
16 if [ -z "$VERSION" ]; then
17 VERSION=$(git describe --always --dirty=+ 2>/dev/null || true)
18 if [ -z "$VERSION" ]; then
19 VERSION="UNKNOWN"
20 else
21 VERSION="git-"$VERSION
22 fi
23 DIST_HOST="$(id -u -n)@$(hostname -f 2>/dev/null || hostname 2>/dev/null || echo localhost)"
24 fi
25
26 INCLUDES="iputils.hh arguments.hh base64.hh zoneparser-tng.hh \
27 rcpgenerator.hh lock.hh dnswriter.hh dnsrecords.hh dnsparser.hh utility.hh \
28 recursor_cache.hh rec_channel.hh qtype.hh misc.hh dns.hh syncres.hh \
29 sstuff.hh mtasker.hh mtasker.cc lwres.hh logger.hh pdnsexception.hh \
30 mplexer.hh pubsuffix.hh \
31 dns_random.hh lua-pdns.hh lua-recursor.hh namespaces.hh \
32 recpacketcache.hh base32.hh cachecleaner.hh json.hh version.hh \
33 ws-recursor.hh ws-api.hh secpoll-recursor.hh \
34 responsestats.hh webserver.hh dnsname.hh"
35
36 CFILES="syncres.cc iputils.cc misc.cc unix_utility.cc qtype.cc \
37 logger.cc arguments.cc lwres.cc pdns_recursor.cc lua-iputils.cc \
38 recursor_cache.cc dnsparser.cc dnswriter.cc dnsrecords.cc rcpgenerator.cc \
39 base64.cc zoneparser-tng.cc rec_channel.cc rec_channel_rec.cc rec_control.cc \
40 selectmplexer.cc epollmplexer.cc kqueuemplexer.cc portsmplexer.cc pdns_hw.cc \
41 sillyrecords.cc pubsuffix.cc lua-pdns.cc lua-recursor.cc randomhelper.cc \
42 devpollmplexer.cc recpacketcache.cc dns.cc reczones.cc base32.cc nsecrecords.cc \
43 dnslabeltext.cc json.cc ws-recursor.cc ws-api.cc version.cc dns_random.cc \
44 responsestats.cc webserver.cc rec-carbon.cc secpoll-recursor.cc dnsname.cc"
45
46 ./mkpubsuffixcc
47
48 DIRNAME=pdns-recursor-$VERSION
49 rm -rf $DIRNAME
50 mkdir $DIRNAME
51 cp $INCLUDES $CFILES $DIRNAME
52 cp Makefile-recursor $DIRNAME/Makefile.in
53 cp README-recursor $DIRNAME/README
54 cp ../COPYING ../NOTICE $DIRNAME/
55 cp config-recursor.h $DIRNAME/config.h
56 cat >>$DIRNAME/config.h <<EOF
57 #define VERSION "$VERSION"
58 #define DIST_HOST "$DIST_HOST"
59 #define HAVE_BOOST 1
60 EOF
61 mkdir -p $DIRNAME/ext/rapidjson/include/rapidjson/internal
62 cp -a ../ext/rapidjson/include/rapidjson/*.h $DIRNAME/ext/rapidjson/include/rapidjson/
63 cp -a ../ext/rapidjson/include/rapidjson/internal/*.h $DIRNAME/ext/rapidjson/include/rapidjson/internal
64 mkdir -p $DIRNAME/ext/polarssl/include/polarssl
65 cp -a ../ext/polarssl/include/polarssl/config.h ../ext/polarssl/include/polarssl/check_config.h ../ext/polarssl/include/polarssl/aes.h ../ext/polarssl/include/polarssl/base64.h ../ext/polarssl/include/polarssl/platform.h ../ext/polarssl/include/polarssl/version.h $DIRNAME/ext/polarssl/include/polarssl
66 mkdir -p $DIRNAME/ext/polarssl/library
67 cp -a ../ext/polarssl/library/aes.c ../ext/polarssl/library/base64.c $DIRNAME/ext/polarssl/library
68 cp -a ../ext/yahttp/ $DIRNAME/ext/yahttp
69 echo '#include "../../../config.h"' > $DIRNAME/ext/yahttp/yahttp/yahttp-config.h
70 mkdir $DIRNAME/rrd
71 cp tools/rrd/{create,update,makegraphs,index.html} $DIRNAME/rrd
72 cp dnslabeltext.rl $DIRNAME
73 cp pdns-recursor.init.d $DIRNAME
74 cp ../docs/pdns_recursor.1 ../docs/rec_control.1 $DIRNAME
75 cp configure-recursor $DIRNAME/configure
76 cp powerdns-example-script.lua $DIRNAME
77 mkdir -p $DIRNAME/contrib
78 cp ../contrib/systemd-pdns-recursor.service $DIRNAME/contrib
79 mkdir -p $DIRNAME/build-scripts/redhat
80 cp ../build-scripts/redhat/pdns-recursor-test.spec $DIRNAME/build-scripts/redhat
81 cp pdns-recursor.spec $DIRNAME
82
83 mkdir -p $DIRNAME/sysdeps
84 rm -f sysdeps-recursor/*~
85 cp sysdeps-recursor/* $DIRNAME/sysdeps
86 touch $DIRNAME/dnslabeltext.cc # avoid spurious recompiles
87 tar cf $DIRNAME.tar $DIRNAME
88 bzip2 -f $DIRNAME.tar # .. solaris