]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add missing specfiles (thanks global gitignore!)
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 18 Dec 2017 18:31:45 +0000 (19:31 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 27 Sep 2018 11:59:26 +0000 (13:59 +0200)
builder-support/specs/dnsdist.spec [new file with mode: 0644]
builder-support/specs/pdns.spec [new file with mode: 0644]

diff --git a/builder-support/specs/dnsdist.spec b/builder-support/specs/dnsdist.spec
new file mode 100644 (file)
index 0000000..bb0d60f
--- /dev/null
@@ -0,0 +1,153 @@
+Name: dnsdist
+Version: %{getenv:BUILDER_VERSION}
+Release: %{getenv:BUILDER_RELEASE}
+Summary: Powerful and scriptable DNS loadbalancer
+License: GPLv2
+Vendor: PowerDNS.COM BV
+Group: System/DNS
+Source: dnsdist-%{version}.tar.bz2
+BuildRequires: readline-devel
+BuildRequires: libedit-devel
+
+%if 0%{?el6}
+BuildRequires: boost148-devel
+BuildRequires: lua-devel
+BuildRequires: protobuf-compiler
+BuildRequires: protobuf-devel
+BuildRequires: re2-devel
+%elif 0%{?suse_version}
+BuildRequires: boost-devel
+BuildRequires: lua-devel
+BuildRequires: systemd-units
+BuildRequires: systemd-devel
+%else
+BuildRequires: boost-devel
+BuildRequires: libsodium-devel
+BuildRequires: luajit-devel
+BuildRequires: net-snmp-devel
+BuildRequires: protobuf-compiler
+BuildRequires: protobuf-devel
+BuildRequires: re2-devel
+BuildRequires: systemd-units
+BuildRequires: systemd-devel
+%endif
+
+%if 0%{?el6}
+Requires(pre): shadow-utils
+%elif 0%{suse_version}
+Requires(pre): shadow
+%systemd_requires
+%else
+Requires(pre): shadow-utils
+%systemd_requires
+%endif
+
+%description
+dnsdist is a high-performance DNS loadbalancer that is scriptable in Lua.
+
+%prep
+%setup
+
+# run as dnsdist user
+sed -i '/^ExecStart/ s/dnsdist/dnsdist -u dnsdist -g dnsdist/' dnsdist.service.in
+
+%build
+%configure \
+  --sysconfdir=/etc/dnsdist \
+%if 0%{?el6}
+  --disable-dnscrypt \
+  --disable-libsodium \
+  --enable-re2 \
+  --with-net-snmp \
+  --with-protobuf \
+  --with-boost=/usr/include/boost148 LIBRARY_PATH=/usr/lib64/boost148
+%elif 0%{suse_version}
+  --disable-dnscrypt \
+  --disable-libsodium \
+  --disable-re2 \
+  --enable-systemd --with-systemd=/lib/systemd/system \
+  --without-protobuf \
+  --without-net-snmp
+%else
+  --with-protobuf \
+  --with-luajit \
+  --enable-libsodium \
+  --enable-dnscrypt \
+  --enable-systemd --with-systemd=/lib/systemd/system \
+  --enable-re2 \
+  --with-net-snmp
+%endif
+
+%if 0%{?el6}
+make %{?_smp_mflags} LIBRARY_PATH=/usr/lib64/boost148
+%else
+make %{?_smp_mflags}
+%endif
+mv dnsdistconf.lua dnsdist.conf.sample
+
+%check
+make %{?_smp_mflags} check || (cat test-suite.log && false)
+
+%install
+%make_install
+install -d %{buildroot}/%{_sysconfdir}/dnsdist
+%if 0%{?el6}
+install -d -m 755 %{buildroot}/%{_initrddir} && install -m 755 contrib/dnsdist.init.centos6 %{buildroot}/%{_initrddir}/dnsdist
+%else
+# EL7 and SUSE
+sed -i "s,/^\(ExecStart.*\)dnsdist\(.*\)\$,\1dnsdist -u dnsdist -g dnsdist\2," %{buildroot}/lib/systemd/system/dnsdist.service
+sed -i "s,/^\(ExecStart.*\)dnsdist\(.*\)\$,\1dnsdist -u dnsdist -g dnsdist\2," %{buildroot}/lib/systemd/system/dnsdist@.service
+%endif
+
+%pre
+getent group dnsdist >/dev/null || groupadd -r dnsdist
+getent passwd dnsdist >/dev/null || \
+       useradd -r -g dnsdist -d / -s /sbin/nologin \
+       -c "dnsdist user" dnsdist
+exit 0
+
+%post
+%if 0%{?el6}
+/sbin/chkconfig --add %{name}
+%elif 0%{?suse_version}
+%service_add_post %{name}.service
+%else
+%systemd_post %{name}.service
+%endif
+
+%preun
+%if 0%{?el6}
+if [ "\$1" -eq "0" ]; then
+  # Package removal, not upgrade
+  /sbin/service %{name} stop > /dev/null 2>&1 || :
+  /sbin/chkconfig --del %{name}
+fi
+%elif 0%{?suse_version}
+%service_del_preun %{name}.service
+%else
+%systemd_preun %{name}.service
+%endif
+
+%postun
+%if 0%{?el6}
+if [ "\$1" -ge "1" ] ; then
+  /sbin/service %{name} condrestart >/dev/null 2>&1 || :
+fi
+%elif 0%{?suse_version}
+%service_del_postun %{name}.service
+%else
+%systemd_postun_with_restart %{name}.service
+%endif
+
+%files
+%{!?_licensedir:%global license %%doc}
+%doc dnsdist.conf.sample
+%doc README.md
+%{_bindir}/*
+%{_mandir}/man1/*
+%dir %{_sysconfdir}/dnsdist
+%if 0%{?el6}
+%{_initrddir}/dnsdist
+%else
+/lib/systemd/system/dnsdist*
+%endif
diff --git a/builder-support/specs/pdns.spec b/builder-support/specs/pdns.spec
new file mode 100644 (file)
index 0000000..ade9105
--- /dev/null
@@ -0,0 +1,371 @@
+%if 0%{?rhel} < 6
+exit 1
+%endif
+
+# Only works on EL7
+%global _hardened_build 1
+%global backends %{nil}
+
+Name: pdns
+Version: %{getenv:BUILDER_VERSION}
+Release: %{getenv:BUILDER_RELEASE}%{dist}
+Summary: A modern, advanced and high performance authoritative-only nameserver
+Group: System Environment/Daemons
+License: GPLv2
+URL: https://powerdns.com
+Source0: %{name}-%{version}.tar.bz2
+%if 0%{?rhel} < 7
+Source1: pdns.init
+%endif
+
+%if 0%{?rhel} >= 7
+Requires(post): systemd-sysv
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+BuildRequires: systemd-units
+BuildRequires: systemd-devel
+
+BuildRequires: protobuf-devel
+BuildRequires: protobuf-compiler
+BuildRequires: p11-kit-devel
+%endif
+
+Requires(pre): shadow-utils
+BuildRequires: luajit-devel
+BuildRequires: boost-devel
+BuildRequires: libsodium-devel
+BuildRequires: bison
+BuildRequires: openssl-devel
+
+Provides: powerdns = %{version}-%{release}
+%global backends %{backends} bind
+
+%description
+The PowerDNS Nameserver is a modern, advanced and high performance
+authoritative-only nameserver. It is written from scratch and conforms
+to all relevant DNS standards documents.
+Furthermore, PowerDNS interfaces with almost any database.
+
+%package tools
+Summary: Extra tools for %{name}
+Group: System Environment/Daemons
+
+%description tools
+This package contains the extra tools for %{name}
+
+%package backend-mysql
+Summary: MySQL backend for %{name}
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+BuildRequires: mysql-devel
+%global backends %{backends} gmysql
+
+%description backend-mysql
+This package contains the gmysql backend for %{name}
+
+%package backend-postgresql
+Summary: PostgreSQL backend for %{name}
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+BuildRequires: postgresql-devel
+%global backends %{backends} gpgsql
+
+%description backend-postgresql
+This package contains the gpgsql backend for %{name}
+
+%package backend-pipe
+Summary: Pipe backend for %{name}
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+%global backends %{backends} pipe
+
+%description backend-pipe
+This package contains the pipe backend for %{name}
+
+%package backend-remote
+Summary: Remote backend for %{name}
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+%global backends %{backends} remote
+
+%description backend-remote
+This package contains the remote backend for %{name}
+
+%package backend-ldap
+Summary: LDAP backend for %{name}
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+BuildRequires: openldap-devel
+%global backends %{backends} ldap
+
+%description backend-ldap
+This package contains the LDAP backend for %{name}
+
+%package backend-lua
+Summary: Lua backend for %{name}
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+%global backends %{backends} lua
+
+%description backend-lua
+This package contains the lua backend for %{name}
+
+%package backend-sqlite
+Summary: SQLite backend for %{name}
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+BuildRequires: sqlite-devel
+%global backends %{backends} gsqlite3
+
+%description backend-sqlite
+This package contains the SQLite backend for %{name}
+
+%package backend-mydns
+Summary: MyDNS backend for %{name}
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+%global backends %{backends} mydns
+
+%description backend-mydns
+This package contains the MyDNS backend for %{name}
+
+%if 0%{?rhel} >= 7
+%package backend-odbc
+Summary: UnixODBC backend for %{name}
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+BuildRequires: unixODBC-devel
+%global backends %{backends} godbc
+
+%description backend-odbc
+This package contains the godbc backend for %{name}
+
+%package backend-geoip
+Summary: Geo backend for %{name}
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+BuildRequires: yaml-cpp-devel
+BuildRequires: geoip-devel
+%global backends %{backends} geoip
+
+%description backend-geoip
+This package contains the geoip backend for %{name}
+It allows different answers to DNS queries coming from different
+IP address ranges or based on the geoipgraphic location
+
+%package backend-tinydns
+Summary: TinyDNS backend for %{name}
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+BuildRequires: tinycdb-devel
+%global backends %{backends} tinydns
+
+%description backend-tinydns
+This package contains the TinyDNS backend for %{name}
+%endif
+
+%prep
+%setup -q -n %{name}-%{version}
+
+%build
+export CPPFLAGS="-DLDAP_DEPRECATED"
+
+%configure \
+  --sysconfdir=%{_sysconfdir}/%{name} \
+  --disable-static \
+  --disable-dependency-tracking \
+  --disable-silent-rules \
+  --with-modules='' \
+  --with-luajit \
+  --with-dynmodules='%{backends} random' \
+  --enable-tools \
+  --enable-libsodium \
+  --enable-unit-tests \
+%if 0%{?rhel} >= 7
+  --enable-experimental-pkcs11 \
+  --enable-systemd
+%else
+  --without-protobuf
+%endif
+
+
+make %{?_smp_mflags}
+
+%install
+make install DESTDIR=%{buildroot}
+
+%{__rm} -f %{buildroot}%{_libdir}/%{name}/*.la
+%{__rm} -rf %{buildroot}%{_docdir}
+
+%if 0%{?rhel} == 6
+%{__install} -D -p %{SOURCE1} %{buildroot}%{_initrddir}/pdns
+%endif
+
+%{buildroot}/usr/sbin/pdns_server --no-config --config | sed \
+  -e 's!# daemon=.*!daemon=no!' \
+  -e 's!# guardian=.*!guardian=no!' \
+  -e 's!# launch=.*!&\\nlaunch=!' \
+  -e 's!# setgid=.*!setgid=pdns!' \
+  -e 's!# setuid=.*!setuid=pdns!' \
+  > %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
+%{__rm} %{buildroot}%{_sysconfdir}/%{name}/pdns.conf-dist
+%{__rm} %{buildroot}/usr/bin/stubquery
+
+chmod 600 %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
+
+%if 0%{?rhel} >= 7
+# rename zone2ldap to pdns-zone2ldap (#1193116)
+%{__mv} %{buildroot}/%{_bindir}/zone2ldap %{buildroot}/%{_bindir}/pdns-zone2ldap
+%{__mv} %{buildroot}/%{_mandir}/man1/zone2ldap.1 %{buildroot}/%{_mandir}/man1/pdns-zone2ldap.1
+%endif
+
+%check
+PDNS_TEST_NO_IPV6=1 make %{?_smp_mflags} -C pdns check || (cat pdns/test-suite.log && false)
+
+%pre
+getent group pdns >/dev/null || groupadd -r pdns
+getent passwd pdns >/dev/null || \
+       useradd -r -g pdns -d / -s /sbin/nologin \
+       -c "PowerDNS user" pdns
+exit 0
+
+%post
+%if 0%{?rhel} >= 7
+%systemd_post pdns.service
+%else
+/sbin/chkconfig --add pdns
+%endif
+
+%preun
+%if 0%{?rhel} >= 7
+%systemd_preun pdns.service
+%else
+if [ \$1 -eq 0 ]; then
+  /sbin/service pdns stop >/dev/null 2>&1 || :
+  /sbin/chkconfig --del pdns
+fi
+%endif
+
+%postun
+%if 0%{?rhel} >= 7
+%systemd_postun_with_restart pdns.service
+%else
+if [ \$1 -ge 1 ]; then
+  /sbin/service pdns condrestart >/dev/null 2>&1 || :
+fi
+%endif
+
+%files
+%doc COPYING README
+%{_bindir}/pdns_control
+%{_bindir}/pdnsutil
+%{_bindir}/zone2sql
+%{_bindir}/zone2json
+%{_sbindir}/pdns_server
+%{_libdir}/%{name}/libbindbackend.so
+%{_mandir}/man1/pdns_control.1.gz
+%{_mandir}/man1/pdns_server.1.gz
+%{_mandir}/man1/zone2sql.1.gz
+%{_mandir}/man1/zone2json.1.gz
+%{_mandir}/man1/pdnsutil.1.gz
+%dir %{_libdir}/%{name}/
+%{_libdir}/%{name}/librandombackend.so
+%dir %{_sysconfdir}/%{name}/
+%config(noreplace) %{_sysconfdir}/%{name}/pdns.conf
+
+%if 0%{?rhel} >= 7
+%{_bindir}/pdns-zone2ldap
+%{_mandir}/man1/pdns-zone2ldap.1.gz
+%{_unitdir}/pdns.service
+%{_unitdir}/pdns@.service
+%else
+%{_bindir}/zone2ldap
+%{_mandir}/man1/zone2ldap.1.gz
+%{_initrddir}/pdns
+%endif
+
+%files tools
+%{_bindir}/calidns
+%{_bindir}/dnsgram
+%{_bindir}/dnsreplay
+%{_bindir}/dnsscan
+%{_bindir}/dnsscope
+%{_bindir}/dnswasher
+%{_bindir}/dumresp
+%{_bindir}/ixplore
+%{_bindir}/pdns_notify
+%{_bindir}/nproxy
+%{_bindir}/nsec3dig
+%{_bindir}/saxfr
+%{_bindir}/sdig
+%{_mandir}/man1/calidns.1.gz
+%{_mandir}/man1/dnsgram.1.gz
+%{_mandir}/man1/dnsreplay.1.gz
+%{_mandir}/man1/dnsscan.1.gz
+%{_mandir}/man1/dnsscope.1.gz
+%{_mandir}/man1/dnswasher.1.gz
+%{_mandir}/man1/dumresp.1.gz
+%{_mandir}/man1/ixplore.1.gz
+%{_mandir}/man1/pdns_notify.1.gz
+%{_mandir}/man1/nproxy.1.gz
+%{_mandir}/man1/nsec3dig.1.gz
+%{_mandir}/man1/saxfr.1.gz
+%{_mandir}/man1/sdig.1.gz
+%if 0%{?rhel} >= 7
+%{_bindir}/dnsbulktest
+%{_bindir}/dnspcap2protobuf
+%{_bindir}/dnstcpbench
+%{_mandir}/man1/dnsbulktest.1.gz
+%{_mandir}/man1/dnspcap2protobuf.1.gz
+%{_mandir}/man1/dnstcpbench.1.gz
+%endif
+
+%files backend-mysql
+%doc modules/gmysqlbackend/schema.mysql.sql
+%doc modules/gmysqlbackend/dnssec-3.x_to_3.4.0_schema.mysql.sql
+%doc modules/gmysqlbackend/nodnssec-3.x_to_3.4.0_schema.mysql.sql
+%{_libdir}/%{name}/libgmysqlbackend.so
+
+%files backend-postgresql
+%doc modules/gpgsqlbackend/schema.pgsql.sql
+%doc modules/gpgsqlbackend/dnssec-3.x_to_3.4.0_schema.pgsql.sql
+%doc modules/gpgsqlbackend/nodnssec-3.x_to_3.4.0_schema.pgsql.sql
+%{_libdir}/%{name}/libgpgsqlbackend.so
+
+%files backend-pipe
+%{_libdir}/%{name}/libpipebackend.so
+
+%files backend-remote
+%{_libdir}/%{name}/libremotebackend.so
+
+%files backend-ldap
+%{_libdir}/%{name}/libldapbackend.so
+
+%doc modules/ldapbackend/dnsdomain2.schema
+%doc modules/ldapbackend/pdns-domaininfo.schema
+
+%files backend-lua
+%{_libdir}/%{name}/libluabackend.so
+
+%files backend-sqlite
+%doc modules/gsqlite3backend/schema.sqlite3.sql
+%doc modules/gsqlite3backend/dnssec-3.x_to_3.4.0_schema.sqlite3.sql
+%doc modules/gsqlite3backend/nodnssec-3.x_to_3.4.0_schema.sqlite3.sql
+%{_libdir}/%{name}/libgsqlite3backend.so
+
+%files backend-mydns
+%doc modules/mydnsbackend/schema.mydns.sql
+%{_libdir}/%{name}/libmydnsbackend.so
+
+%if 0%{?rhel} >= 7
+%files backend-odbc
+%doc modules/godbcbackend/schema.mssql.sql
+%{_libdir}/%{name}/libgodbcbackend.so
+
+%files backend-geoip
+%{_libdir}/%{name}/libgeoipbackend.so
+
+%files backend-tinydns
+%{_libdir}/%{name}/libtinydnsbackend.so
+%endif