INSTALL \
NOTICE \
README \
+ COPYING \
codedocs/doxygen.conf \
contrib/powerdns.solaris.init.d \
pdns/named.conf.parsertest \
RUN apk add --no-cache gcc g++ make tar autoconf automake protobuf-dev lua-dev \
libtool file boost-dev curl openssl-dev ragel py-virtualenv
-
# the pdns/ dir is a bit broad, but who cares :)
-ADD configure.ac Makefile.am INSTALL NOTICE README /pdns-authoritative/
+ADD configure.ac Makefile.am COPYING INSTALL NOTICE README /pdns-authoritative/
@EXEC sdist_dirs=(build-aux m4 pdns ext docs modules codedocs contrib regression-tests)
@EXEC for d in ${sdist_dirs[@]} ; do echo "COPY $d/ /pdns-authoritative/$d/" ; done
ADD builder/helpers/set-configure-ac-version.sh /pdns-authoritative/builder/helpers/
--- /dev/null
+FROM dist-base as package-builder
+RUN yum install -y rpm-build rpmdevtools python34 && \
+ yum groupinstall -y "Development Tools" && \
+ rpmdev-setuptree
+
+RUN mkdir /dist /pdns
+WORKDIR /pdns
+RUN rpmdev-setuptree
+
+# Only ADD/COPY the files you really need for efficient docker caching.
+ADD builder/helpers/ /pdns/builder/helpers/
+
+# Used for -p option to only build specific spec files
+ARG BUILDER_PACKAGE_MATCH
+
+ARG BUILDER_VERSION
+ARG BUILDER_RELEASE
+COPY --from=sdist /sdist /sdist
+RUN for file in /sdist/* ; do ln -s $file /root/rpmbuild/SOURCES/ ; done && ls /root/rpmbuild/SOURCES/
+
+ADD builder-support/specs/ /pdns/builder-support/specs
+RUN find /pdns/builder-support/specs/ -not -name '*.spec' -exec ln -s {} /root/rpmbuild/SOURCES/ \;
+
+@IF [ ! -z "$M_authoritative" ]
+RUN if $(grep -q 'release 6' /etc/redhat-release); then \
+ scl enable devtoolset-3 -- builder/helpers/build-specs.sh builder-support/specs/pdns.spec; \
+ else \
+ builder/helpers/build-specs.sh builder-support/specs/pdns.spec; \
+ fi
+@ENDIF
+
+# mv accross layers with overlay2 is buggy in some kernel versions (results in empty dirs)
+# See: https://github.com/moby/moby/issues/33733
+#RUN mv /root/rpmbuild/RPMS/* /dist/
+RUN cp -R /root/rpmbuild/RPMS/* /dist/
--- /dev/null
+# First do the source builds
+@INCLUDE Dockerfile.target.sdist
+
+# This defines the dstribution base layer
+# Put only the bare minimum of common commands here, without dev tools
+FROM centos:6 as dist-base
+RUN yum install -y epel-release centos-release-scl-rh && \
+ yum install -y --nogpgcheck devtoolset-3-gcc-c++
+
+# Do the actual rpm build
+@INCLUDE Dockerfile.rpmbuild
+
+# Do a test install and verify
+# Can be skipped with skiptests=1 in the environment
+# @EXEC [ "$skiptests" = "" ] && include Dockerfile.rpmtest
--- /dev/null
+# First do the source builds
+@INCLUDE Dockerfile.target.sdist
+
+# This defines the dstribution base layer
+# Put only the bare minimum of common commands here, without dev tools
+FROM centos:7 as dist-base
+RUN yum install -y epel-release
+
+# Do the actual rpm build
+@INCLUDE Dockerfile.rpmbuild
+
+# Do a test install and verify
+# Can be skipped with skiptests=1 in the environment
+# @EXEC [ "$skiptests" = "" ] && include Dockerfile.rpmtest
-@IF [ ! -z "$M_all$M_authoritative" ]
+@IF [ ! -z "$M_authoritative" ]
@INCLUDE Dockerfile.authoritative
@ENDIF
-@IF [ ! -z "$M_all$M_recursor" ]
+@IF [ ! -z "$M_recursor" ]
@INCLUDE Dockerfile.recursor
@ENDIF
-@IF [ ! -z "$M_all$M_dnsdist" ]
+@IF [ ! -z "$M_dnsdist" ]
@INCLUDE Dockerfile.dnsdist
@ENDIF
FROM alpine:3.6 as sdist
-@IF [ ! -z "$M_all$M_authoritative" ]
+@IF [ ! -z "$M_authoritative" ]
COPY --from=pdns-authoritative /sdist/ /sdist/
@ENDIF
-@IF [ ! -z "$M_all$M_recursor" ]
+@IF [ ! -z "$M_recursor" ]
COPY --from=recursor /sdist/ /sdist/
@ENDIF
-@IF [ ! -z "$M_all$M_dnsdist" ]
+@IF [ ! -z "$M_dnsdist" ]
COPY --from=dnsdist /sdist/ /sdist/
@ENDIF
--- /dev/null
+
+# chkconfig: - 80 75
+# description: PDNS is a versatile high performance authoritative nameserver
+
+### BEGIN INIT INFO
+# Provides: pdns
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $network $syslog
+# Should-Start:
+# Should-Stop:
+# Default-Start:
+# Default-Stop: 0 1 6
+# Short-Description: PowerDNS authoritative server
+# Description: PowerDNS authoritative server
+### END INIT INFO
+
+set -e
+
+prefix=/usr
+exec_prefix=/usr
+BINARYPATH=/usr/bin
+SBINARYPATH=/usr/sbin
+SOCKETPATH=/var/run
+
+[ -f "$SBINARYPATH/pdns_server" ] || exit 0
+
+[ -r /etc/default/pdns ] && . /etc/default/pdns
+
+cd $SOCKETPATH
+suffix=$(basename $0 | cut -d- -f2- -s)
+if [ -n "$suffix" ]
+then
+ EXTRAOPTS=--config-name=$suffix
+ PROGNAME=pdns-$suffix
+else
+ PROGNAME=pdns
+fi
+
+pdns_server="$SBINARYPATH/pdns_server $EXTRAOPTS"
+
+doPC()
+{
+ ret=$($BINARYPATH/pdns_control $EXTRAOPTS $1 $2 2> /dev/null)
+}
+
+NOTRUNNING=0
+doPC ping || NOTRUNNING=$?
+
+case "$1" in
+ status)
+ if test "$NOTRUNNING" = "0"
+ then
+ doPC status
+ echo $ret
+ else
+ echo "not running"
+ exit 3
+ fi
+ ;;
+
+ stop)
+ echo -n "Stopping PowerDNS authoritative nameserver: "
+ if test "$NOTRUNNING" = "0"
+ then
+ doPC quit
+ rm -f /var/lock/subsys/pdns
+ echo $ret
+ else
+ echo "not running"
+ fi
+ ;;
+
+
+ force-stop)
+ echo -n "Stopping PowerDNS authoritative nameserver: "
+ killall -v -9 pdns_server
+ rm -f /var/lock/subsys/pdns
+ echo "killed"
+ ;;
+
+ start)
+ echo -n "Starting PowerDNS authoritative nameserver: "
+ if test "$NOTRUNNING" = "0"
+ then
+ echo "already running"
+ else
+ if $pdns_server --daemon --guardian=yes
+ then
+ touch /var/lock/subsys/pdns
+ echo "started"
+ else
+ echo "starting failed"
+ exit 1
+ fi
+ fi
+ ;;
+
+ condrestart)
+ if [ -f /var/lock/subsys/pdns ];
+ then
+ echo "running, restarting"
+ $0 restart
+ else
+ echo "not running"
+ fi
+ ;;
+
+ force-reload | restart)
+ echo -n "Restarting PowerDNS authoritative nameserver: "
+ if test "$NOTRUNNING" = "1"
+ then
+ echo "not running, starting"
+ else
+
+ echo -n stopping and waiting..
+ doPC quit
+ sleep 3
+ echo done
+ fi
+ $0 start
+ ;;
+
+ reload)
+ echo -n "Reloading PowerDNS authoritative nameserver: "
+ if test "$NOTRUNNING" = "0"
+ then
+ doPC cycle
+ echo requested reload
+ else
+ echo not running yet
+ $0 start
+ fi
+ ;;
+
+ monitor)
+ if test "$NOTRUNNING" = "0"
+ then
+ echo "already running"
+ else
+ $pdns_server --daemon=no --guardian=no --control-console --loglevel=9
+ fi
+ ;;
+
+ dump)
+ if test "$NOTRUNNING" = "0"
+ then
+ doPC list
+ echo $ret
+ else
+ echo "not running"
+ fi
+ ;;
+
+ show)
+ if [ $# -lt 2 ]
+ then
+ echo Insufficient parameters
+ exit
+ fi
+ if test "$NOTRUNNING" = "0"
+ then
+ echo -n "$2="
+ doPC show $2 ; echo $ret
+ else
+ echo "not running"
+ fi
+ ;;
+
+ mrtg)
+ if [ $# -lt 2 ]
+ then
+ echo Insufficient parameters
+ exit
+ fi
+ if test "$NOTRUNNING" = "0"
+ then
+ doPC show $2 ; echo $ret
+ if [ "$3x" != "x" ]
+ then
+ doPC show $3 ; echo $ret
+ else
+ echo 0
+ fi
+ doPC uptime ; echo $ret
+ echo PowerDNS daemon
+ else
+ echo "not running"
+ fi
+
+ ;;
+
+ cricket)
+ if [ $# -lt 2 ]
+ then
+ echo Insufficient parameters
+ exit
+ fi
+ if test "$NOTRUNNING" = "0"
+ then
+ doPC show $2 ; echo $ret
+ else
+ echo "not running"
+ fi
+
+ ;;
+
+ *)
+ echo pdns [start|stop|condrestart|force-reload|reload|restart|status|dump|show|mrtg|cricket|monitor]
+
+ ;;
+esac
+