-echo "%_install_langs C:de:en:es:fr" > $vroot/etc/rpm/macros
-echo "%_netsharedpath /proc:/dev/pts" >> $vroot/etc/rpm/macros
-# append to the vserver's rpm macros
-echo "%_install_langs C:de:en:es:fr" > /etc/rpm/macros
-echo "%_netsharedpath /proc:/dev/pts" >> /etc/rpm/macros
-# Mount /proc in reference image
+cat > /etc/rpm/macros <<EOF
+%_install_langs C:de:en:es:fr
+%_netsharedpath /proc:/dev/pts
+%_excludedocs yes
+EOF
+# copy to the vserver's rpm macros
+mkdir -p $vroot/etc/rpm
+cp /etc/rpm/macros $vroot/etc/rpm/macros
+
+# Mount in reference image
+mount -t devpts none $vroot/dev/pts
+mount -t tmpfs none $vroot/dev/shm