Properly rename debug shared objects.

Fixes https://trac.nginx.org/nginx/ticket/2230.
diff --git a/alpine/APKBUILD-module.in b/alpine/APKBUILD-module.in
index a5c462d..281bc75 100644
--- a/alpine/APKBUILD-module.in
+++ b/alpine/APKBUILD-module.in
@@ -132,7 +132,7 @@
 	CFLAGS= %%MODULE_ENV%% ./configure %%BASE_CONFIGURE_ARGS%% %%MODULE_CONFIGURE_ARGS%% --with-cc-opt="$CFLAGS %%MODULE_CC_OPT_DEBUG%%" --with-ld-opt="$LDFLAGS %%MODULE_LD_OPT_DEBUG%%" --with-debug
 	make $_make_opts modules
 	for so in `find objs/ -maxdepth 1 -type f -name "*.so"`; do \
-		debugso=`echo ${so} | sed -e "s|.so|-debug.so|"` ; \
+		debugso=`echo ${so} | sed -e 's|\.so$|-debug.so|'` ; \
 		mv ${so} ${debugso} ; \
         done
 	CFLAGS= %%MODULE_ENV%% ./configure %%BASE_CONFIGURE_ARGS%% %%MODULE_CONFIGURE_ARGS%% --with-cc-opt="$CFLAGS %%MODULE_CC_OPT%%" --with-ld-opt="$LDFLAGS %%MODULE_LD_OPT%%"
diff --git a/alpine/APKBUILD-plus-module.in b/alpine/APKBUILD-plus-module.in
index aeff795..6409a47 100644
--- a/alpine/APKBUILD-plus-module.in
+++ b/alpine/APKBUILD-plus-module.in
@@ -139,7 +139,7 @@
 		CFLAGS= %%MODULE_ENV%% ./configure %%BASE_CONFIGURE_ARGS%% %%MODULE_CONFIGURE_ARGS%% --with-cc-opt="$CFLAGS %%MODULE_CC_OPT_DEBUG%%" --with-ld-opt="$LDFLAGS %%MODULE_LD_OPT_DEBUG%%" --with-debug
 		make $_make_opts modules
 		for so in `find objs/ -maxdepth 1 -type f -name "*.so"`; do \
-			debugso=`echo ${so} | sed -e "s|.so|-debug.so|"` ; \
+			debugso=`echo ${so} | sed -e 's|\.so$|-debug.so|'` ; \
 			mv ${so} ${debugso} ; \
     	    done
 		CFLAGS= %%MODULE_ENV%% ./configure %%BASE_CONFIGURE_ARGS%% %%MODULE_CONFIGURE_ARGS%% --with-cc-opt="$CFLAGS %%MODULE_CC_OPT%%" --with-ld-opt="$LDFLAGS %%MODULE_LD_OPT%%"
diff --git a/debian/nginx-module.rules.in b/debian/nginx-module.rules.in
index 05908bb..4842d7b 100755
--- a/debian/nginx-module.rules.in
+++ b/debian/nginx-module.rules.in
@@ -105,7 +105,7 @@
 post-build:
 ifeq ($(META_MODULE), 0)
 	for so in `find $(BUILDDIR_nginx_debug)/objs/ -maxdepth 1 -type f -name "*.so"`; do \
-	    debugso=`echo $${so} | sed -e "s|.so|-debug.so|"` ; \
+	    debugso=`echo $${so} | sed -e 's|\.so$$|-debug.so|'` ; \
 	    mv $${so} $${debugso} ; \
 	done
 endif
diff --git a/rpm/SPECS/nginx-module.spec.in b/rpm/SPECS/nginx-module.spec.in
index 5376cbe..ec227d9 100644
--- a/rpm/SPECS/nginx-module.spec.in
+++ b/rpm/SPECS/nginx-module.spec.in
@@ -97,7 +97,7 @@
 	--with-debug
 make %{?_smp_mflags} modules
 for so in `find %{bdir}/objs/ -type f -name "*.so"`; do
-debugso=`echo $so | sed -e "s|.so|-debug.so|"`
+debugso=`echo $so | sed -e 's|\.so$|-debug.so|'`
 mv $so $debugso
 done
 %%MODULE_ENV%%
diff --git a/rpm/SPECS/nginx-plus-module.spec.in b/rpm/SPECS/nginx-plus-module.spec.in
index 13f7d2c..cc8923e 100644
--- a/rpm/SPECS/nginx-plus-module.spec.in
+++ b/rpm/SPECS/nginx-plus-module.spec.in
@@ -107,7 +107,7 @@
 		--with-debug
 	make %{?_smp_mflags} modules
 	for so in `find %{bdir}/objs/ -type f -name "*.so"`; do
-	debugso=`echo $so | sed -e "s|.so|-debug.so|"`
+	debugso=`echo $so | sed -e 's|\.so$|-debug.so|'`
 	mv $so $debugso
 	done
 	%%MODULE_ENV%%