URL: https://github.com/freeipa/bind-dyndb-ldap/pull/10
Author: tomaskrizek
 Title: #10: spec: fix sed error and re-sync with fedora
Action: synchronized

To pull the PR as Git branch:
git remote add ghbind-dyndb-ldap https://github.com/freeipa/bind-dyndb-ldap
git fetch ghbind-dyndb-ldap pull/10/head:pr10
git checkout pr10
From 12a5306fd30d2b6a7f2f90b783165def823ba6cf Mon Sep 17 00:00:00 2001
From: Tomas Krizek <tkri...@redhat.com>
Date: Mon, 13 Mar 2017 13:15:51 +0100
Subject: [PATCH 1/2] spec: fix regex in postinstall sed script

Post install sed script would fail with invalid range, because
a-Z is not supported.
---
 contrib/bind-dyndb-ldap.spec | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/contrib/bind-dyndb-ldap.spec b/contrib/bind-dyndb-ldap.spec
index d8c0347..9c91d39 100644
--- a/contrib/bind-dyndb-ldap.spec
+++ b/contrib/bind-dyndb-ldap.spec
@@ -65,7 +65,7 @@ do
 done <<EOF
 /^\s*dynamic-db/,/};/ {
 
-  s/\(\s*\)arg\s\+\(["']\)\([a-Z_]\+\s\)/\1\3\2/g;
+  s/\(\s*\)arg\s\+\(["']\)\([a-zA-Z_]\+\s\)/\1\3\2/g;
 
   s/^dynamic-db/dyndb/;
 
@@ -95,6 +95,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Mon Mar 13 2017 Tomas Krizek <tkri...@redhat.com>
+- Fixed sed script regex error
+
 * Thu Jan 26 2017 Tomas Krizek <tkri...@redhat.com>
 - Added named.conf API transofrmation script
 - Bumped the required BIND version to 9.11.0-6.P2

From d53e509f3827b057d2680d33c4099fd697cb71d2 Mon Sep 17 00:00:00 2001
From: Tomas Krizek <tkri...@redhat.com>
Date: Mon, 13 Mar 2017 13:21:56 +0100
Subject: [PATCH 2/2] spec: re-sync spec file with Fedora

---
 contrib/bind-dyndb-ldap.spec | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/contrib/bind-dyndb-ldap.spec b/contrib/bind-dyndb-ldap.spec
index 9c91d39..7d0e887 100644
--- a/contrib/bind-dyndb-ldap.spec
+++ b/contrib/bind-dyndb-ldap.spec
@@ -7,17 +7,18 @@ Summary:        LDAP back-end plug-in for BIND
 
 Group:          System Environment/Libraries
 License:        GPLv2+
-URL:            https://fedorahosted.org/bind-dyndb-ldap
-Source0:        https://fedorahosted.org/released/%{name}/%{name}-%{VERSION}.tar.bz2
+URL:            https://releases.pagure.org/bind-dyndb-ldap
+Source0:        https://releases.pagure.org/%{name}/%{name}-%{VERSION}.tar.bz2
+Source1:        https://releases.pagure.org/%{name}/%{name}-%{VERSION}.tar.bz2.asc
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires:  bind-devel >= 32:9.11.0-6.P2, bind-lite-devel >= 32:9.11.0-6.P2
+BuildRequires:  bind-devel >= 32:9.11.0-6.P2, bind-lite-devel >= 32:9.11.0-6.P2, bind-pkcs11-devel >= 32:9.11.0-6.P2
 BuildRequires:  krb5-devel
 BuildRequires:  openldap-devel
 BuildRequires:  libuuid-devel
 BuildRequires:  automake, autoconf, libtool
 
-Requires:       bind >= 32:9.11.0-6.P2
+Requires:       bind-pkcs11 >= 32:9.11.0-6.P2, bind-pkcs11-utils >= 32:9.11.0-6.P2
 
 %description
 This package provides an LDAP back-end plug-in for BIND. It features
@@ -29,6 +30,7 @@ off of your LDAP server.
 %setup -q -n %{name}-%{VERSION}
 
 %build
+autoreconf -fiv
 %configure
 make %{?_smp_mflags}
 
@@ -43,6 +45,15 @@ rm %{buildroot}%{_libdir}/bind/ldap.la
 rm -r %{buildroot}%{_datadir}/doc/%{name}
 
 %post
+# SELinux boolean named_write_master_zones has to be enabled
+# otherwise the plugin will not be able to write to /var/named.
+# This scriptlet enables the boolean after installation or upgrade.
+# SELinux is sensitive area so I want to inform user about the change.
+if [ -x "/usr/sbin/setsebool" ] ; then
+        echo "Enabling SELinux boolean named_write_master_zones"
+        /usr/sbin/setsebool -P named_write_master_zones=1 || :
+fi
+
 # Transform named.conf if it still has old-style API.
 PLATFORM=$(uname -m)
 
@@ -83,13 +94,21 @@ EOF
 sed -i.bak -e "$SEDSCRIPT" /etc/named.conf
 
 
+# This scriptlet disables the boolean after uninstallation.
+%postun
+if [ "0$1" -eq "0" ] && [ -x "/usr/sbin/setsebool" ] ; then
+        echo "Disabling SELinux boolean named_write_master_zones"
+        /usr/sbin/setsebool -P named_write_master_zones=0 || :
+fi
+
+
 %clean
 rm -rf %{buildroot}
 
 
 %files
 %defattr(-,root,root,-)
-%doc NEWS README COPYING doc/{example,schema}.ldif
+%doc NEWS README.md COPYING doc/{example,schema}.ldif
 %dir %attr(770, root, named) %{_localstatedir}/named/dyndb-ldap
 %{_libdir}/bind/ldap.so
 
@@ -97,6 +116,7 @@ rm -rf %{buildroot}
 %changelog
 * Mon Mar 13 2017 Tomas Krizek <tkri...@redhat.com>
 - Fixed sed script regex error
+- Re-synced specfile with fedora
 
 * Thu Jan 26 2017 Tomas Krizek <tkri...@redhat.com>
 - Added named.conf API transofrmation script
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to