Index: /trunk/Makefile.in
===================================================================
--- /trunk/Makefile.in	(revision 531)
+++ /trunk/Makefile.in	(revision 532)
@@ -928,6 +928,14 @@
 	rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz; 
 	@RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
-	if test x"$$RPMTOP" = x; then RPMTOP=`echo $$HOME/rpmbuild`; fi; \
-	if ! test -d "$$RPMTOP"; then \
+	if test x"$$RPMTOP" = x; then \
+	  try_RPMTOP=`echo $${HOME}/rpmbuild`; \
+	else \
+	  if test ! -d "$${try_RPMTOP}"; then \
+	    try_RPMTOP=`echo $${HOME}/rpmbuild`; \
+	  fi; \
+	fi; \
+	if test -d "$${try_RPMTOP}"; then \
+	  RPMTOP="$${try_RPMTOP}"; \
+	else \
 	  RPMTOP=/usr/src; \
 	fi; \
@@ -948,6 +956,14 @@
 	rpmbuild -ta ./$(PACKAGE)-$(VERSION).tar.gz; 
 	@RPMTOP=`cat ~/.rpmmacros 2>/dev/null | grep '%_topdir' | awk '{ print $$2}'`; \
-	if test x"$$RPMTOP" = x; then RPMTOP=`echo $$HOME/rpmbuild`; fi; \
-	if ! test -d "$$RPMTOP"; then \
+	if test x"$$RPMTOP" = x; then \
+	  try_RPMTOP=`echo $${HOME}/rpmbuild`; \
+	else \
+	  if test ! -d "$${try_RPMTOP}"; then \
+	    try_RPMTOP=`echo $${HOME}/rpmbuild`; \
+	  fi; \
+	fi; \
+	if test -d "$${try_RPMTOP}"; then \
+	  RPMTOP="$${try_RPMTOP}"; \
+	else \
 	  RPMTOP=/usr/src; \
 	fi; \
Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 531)
+++ /trunk/docs/Changelog	(revision 532)
@@ -3,4 +3,7 @@
 	* fix compiler warning because of deprecated _BSD_SOURCE macro
 	* fix 'make deb' for Debian stretch (reported by Alasdair)
+	* add RPM spec file patch for SLES12 (by Pirmin)
+	* better fix for RPMTOP detection
+	* fix missing entry for yuleadmin.pl in RPM spec file
 
 4.2.3:
Index: /trunk/samhain.spec.in
===================================================================
--- /trunk/samhain.spec.in	(revision 531)
+++ /trunk/samhain.spec.in	(revision 532)
@@ -14,5 +14,9 @@
 Packager: Andre Oliveira da Costa <brblueser@uol.com.br>
 Provides: %{name}
+%if 0%{?suse_version}
+Requires(pre): shadow
+%else
 Requires(pre): shadow-utils
+%endif
 
 # dummy (fix configure warning)
@@ -202,4 +206,5 @@
 %if "%{withpwd_prg}" == "xDSH_WITH_SERVER"
         @sbindir@/@install_name@ctl
+	@sbindir@/@install_name@admin.pl
         %exclude @sbindir@/@install_name@_setpwd
 %endif
@@ -214,4 +219,8 @@
 
 %changelog
+* Mon Dec 18 2017 Rainer Wichmann
+- patch for SLES12 by Pirmin
+- fix missing yuleadmin.pl file
+
 * Tue Oct 23 2012 Rainer Wichmann
 - fixes for yule installation
