From f1148ab84aee8641d11241ae250951118bcd386b Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy@redhat.com>
Date: Apr 09 2019 10:44:48 +0000
Subject: [PATCH 1/2] Update spec file to what is in Fedora rawhide


Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>

---

diff --git a/slapi-nis.spec b/slapi-nis.spec
index 247a73d..5bee258 100644
--- a/slapi-nis.spec
+++ b/slapi-nis.spec
@@ -11,14 +11,15 @@
 
 Name:		slapi-nis
 Version:	0.56.2
-Release:	1%{?dist}
+Release:	8%{?dist}
 Summary:	NIS Server and Schema Compatibility plugins for Directory Server
-Group:		System Environment/Daemons
 License:	GPLv2
-URL:		http://slapi-nis.fedorahosted.org/
-Source0:	https://fedorahosted.org/releases/s/l/slapi-nis/slapi-nis-%{version}.tar.gz
-#Source1:	https://fedorahosted.org/releases/s/l/slapi-nis/slapi-nis-%{version}.tar.gz.sig
-BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+URL:		http://pagure.io/slapi-nis/
+Source0:	https://releases.pagure.org/slapi-nis/slapi-nis-%{version}.tar.gz
+Source1:	https://releases.pagure.org/slapi-nis/slapi-nis-%{version}.tar.gz.sig
+BuildRequires:  autoconf
+BuildRequires:  automake
+BuildRequires:  libtool
 BuildRequires:	389-ds-base-devel >= 1.3.5.6, %{ldap_impl}-devel
 BuildRequires:	nspr-devel, nss-devel, /usr/bin/rpcgen
 %if 0%{?fedora} > 18 || 0%{?rhel} > 6
@@ -30,11 +31,11 @@ BuildRequires:	libsss_nss_idmap-devel > 1.16.0-5
 BuildRequires:	pam-devel
 %if (0%{?fedora} > 14 && 0%{?fedora} < 28) || (0%{?rhel} > 6 && 0%{?rhel} < 8)
 BuildRequires:	libtirpc-devel
-%else
+%else:
 BuildRequires:  libnsl2-devel
 %endif
-%if 0%{?rhel} > 0 && 0%{?rhel} < 7
-ExclusiveArch:	x86_64 %{ix86}
+%if 0%{?fedora} > 27
+ExcludeArch: %{ix86}
 %endif
 Requires: 389-ds-base >= 1.3.5.6
 
@@ -55,6 +56,7 @@ for attributes from multiple entries in the tree.
 %setup -q
 
 %build
+autoconf --force
 %configure --disable-static --with-ldap=%{ldap_impl} \
 	--with-nsswitch --with-pam --with-pam-service=system-auth \
 	%{sss_nss_opts} %{betxn_opts}
@@ -72,26 +74,50 @@ rm $RPM_BUILD_ROOT/%{_libdir}/dirsrv/plugins/*.la
 make check
 %endif
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 %files
-%defattr(-,root,root,-)
 %doc COPYING NEWS README STATUS doc/*.txt doc/examples/*.ldif doc/ipa
 %{_mandir}/man1/*
 %{_libdir}/dirsrv/plugins/*.so
 %{_sbindir}/nisserver-plugin-defs
 
 %changelog
-* Wed May 02 2018 Alexander Bokovoy <abokovoy@redhat.com> - 0.56.2-2
-- Remove tcpwrappers support from a default build
-- Use libnsl2 for Fedora 28 or later
+* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.56.2-8
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+
+* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.56.2-7
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+
+* Wed May 02 2018 Alexander Bokovoy <abokovoy@redhat.com> - 0.56.2-6
+- Force rebuild of configure
+
+* Wed May 02 2018 Alexander Bokovoy <abokovoy@redhat.com> - 0.56.2-5
+- Link with libnsl explicitly in Fedora 28 or later
+- Require libnsl2-devel for build
+- Resolves rhbz#1573636
+
+* Thu Mar 15 2018 Alexander Bokovoy <abokovoy@redhat.com> - 0.56.2-4
+- Remove tcpwrappers support as they aren't available in Fedora anymore
+
+* Thu Mar 15 2018 Alexander Bokovoy <abokovoy@redhat.com> - 0.56.2-3
+- Do not build on i686 in Fedora 28 or later as 389-ds-base is not available there anymore
+- Resolves rhbz#1556448
+- Remove outdated ExclusiveArch for RHEL6
+
+* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.56.2-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
 
 * Fri Jan 19 2018 Alexander Bokovoy <abokovoy@redhat.com> - 0.56.2-1
 - New upstream release
+- Update links to the upstream project page and releases
 - Use extended SSSD API to signal that an entry should not be cached anymore
 - Add support for timeout-based NSS queries with libsss_nss_idmap
 
+* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.56.1-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
+
+* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.56.1-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
 * Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.56.1-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
 

From 4cfc05a64804c97d861af2b930dc16823df477d5 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy@redhat.com>
Date: Apr 09 2019 12:58:27 +0000
Subject: [PATCH 2/2] Add COPR makefile and target to use 'make srpm' in COPR


Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>

---

diff --git a/.copr/Makefile b/.copr/Makefile
new file mode 100644
index 0000000..da64492
--- /dev/null
+++ b/.copr/Makefile
@@ -0,0 +1,21 @@
+VERSION != grep AC_INIT configure.ac|cut -d, -f2|tr -d ")"
+outdir=.
+
+srpm:
+	./autogen.sh; \
+	./configure; \
+	tmpdir=`mktemp -d /tmp/make_archive_XXXXXX`;\
+	make dist;\
+	mv slapi-nis-$(VERSION).tar.gz $$tmpdir; \
+	touch $$tmpdir/slapi-nis-$(VERSION).tar.gz.sig;\
+	rpmbuild \
+		--define "_topdir $$tmpdir" \
+		--define "_sourcedir $$tmpdir" \
+		--define "_specdir $$tmpdir" \
+		--define "_builddir $$tmpdir" \
+		--define "_srcrpmdir $$tmpdir" \
+		--define "_rpmdir $$tmpdir" \
+		--build-in-place \
+		-ts $$tmpdir/slapi-nis-$(VERSION).tar.gz;\
+	cp -v $$tmpdir/slapi-nis-$(VERSION)-*.src.rpm $(outdir)/; \
+	rm -rf $$tmpdir

