diff --git a/templates/glibc.tmpl b/templates/glibc.tmpl
index e080cb86b34..5b7c5d62a65 100644
--- a/templates/glibc.tmpl
+++ b/templates/glibc.tmpl
@@ -22,6 +22,8 @@ long_desc="
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system."
+conf_files="/etc/localtime /etc/ld.so.cache /etc/ld.so.conf /etc/rpc
+ /etc/nsswitch.conf"
base_chroot=yes
build_depends="gcc-4.3.2"
diff --git a/templates/irssi.tmpl b/templates/irssi.tmpl
index 46f06e5cba8..c7d911c5568 100644
--- a/templates/irssi.tmpl
+++ b/templates/irssi.tmpl
@@ -16,5 +16,6 @@ long_desc="
anymore, there's already a working SILC module available. Support for other
protocols like ICQ could be created some day too."
+conf_files="/etc/irssi.conf"
build_depends="glib-2.18.2 perl-5.10.0 openssl-0.9.8i ncurses-5.6"
run_depends="glib-2.18.2 openssl-0.9.8i ncurses-5.6"
diff --git a/templates/openssl.tmpl b/templates/openssl.tmpl
index 29a994729ea..90637d7ca40 100644
--- a/templates/openssl.tmpl
+++ b/templates/openssl.tmpl
@@ -19,6 +19,8 @@ long_desc="
# Does not build with -j.
disable_parallel_build=yes
+keep_dirs="/etc/ssl"
+conf_files="/etc/ssl/openssl.cnf"
build_depends="perl-5.10.0 zlib-1.2.3"
run_depends="glibc-2.8 zlib-1.2.3"
diff --git a/templates/wget.tmpl b/templates/wget.tmpl
index baf0b02b909..4a971baf707 100644
--- a/templates/wget.tmpl
+++ b/templates/wget.tmpl
@@ -29,6 +29,7 @@ long_desc="
re-downloaded when mirroring
* GNU Wget is distributed under the GNU General Public License."
+conf_files="/etc/wgetrc"
base_chroot=yes
run_depends="glibc-2.8"
# TODO : Add openssl dependency
diff --git a/utils/sh/binpkg.sh b/utils/sh/binpkg.sh
index a77949d9ddb..8b1c644836c 100644
--- a/utils/sh/binpkg.sh
+++ b/utils/sh/binpkg.sh
@@ -88,6 +88,15 @@ _EOF
done
printf "\t\n" >> $TMPFPROPS
fi
+ # Keep directories while removing.
+ if [ -n "$keep_dirs" ]; then
+ printf "\tkeep_dirs\n" >> $TMPFPROPS
+ printf "\t\n" >> $TMPFPROPS
+ for f in ${keep_dirs}; do
+ printf "\t\t$f\n" >> $TMPFPROPS
+ done
+ printf "\t\n" >> $TMPFPROPS
+ fi
# Terminate the property list file.
printf "\n\n" >> $TMPFPROPS
diff --git a/utils/sh/tmpl_funcs.sh b/utils/sh/tmpl_funcs.sh
index 73c3d892d1d..c876e7c2e6b 100644
--- a/utils/sh/tmpl_funcs.sh
+++ b/utils/sh/tmpl_funcs.sh
@@ -67,7 +67,7 @@ reset_tmpl_vars()
tar_override_cmd xml_entries sgml_entries \
build_depends libtool_fixup_la_stage no_fixup_libtool \
disable_parallel_build run_depends cross_compiler \
- only_for_archs patch_args \
+ only_for_archs patch_args conf_files keep_dirs \
XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \
XBPS_BUILD_DONE XBPS_INSTALL_DONE"