 +unpatch:
 +	if test -f patch-stamp; \
 +	then \
-+	    for patch in $(PATCHES); \
++	    for patch in $(RPATCHES); \
 +	    do \
 +	      patch -p0 -R < debian/patches/$$patch; \
 +	      rm -f debian/patches/$$patch.stamp; \
 +	    done; \
++	    rm -f patch-stamp; \
 +	fi
-+	rm -f patch-stamp
 +
  binary: binary-indep binary-arch
  .PHONY: build clean binary-indep binary-arch binary install configure

 	dh_testdir
 
 	-mv sope-core/NGStreams/config.guess sope-core/NGStreams/config.guess.upstream
@@ -71,14 +73,14 @@
 	CFLAGS="$(CFLAGS)" . $(GNUSTEP_SETUP); \
 		$(MAKE) $(MAKE_FLAGS) all
 

 
 	-. $(GNUSTEP_SETUP); $(MAKE) clean
 	-. $(GNUSTEP_SETUP); $(MAKE) distclean
@@ -116,24 +121,24 @@
 	dh_clean -k 
 	dh_installdirs
 
