- escape % correctly
[sliceimage.git] / vserver-reference.spec
index 379c915..40328d5 100644 (file)
@@ -103,7 +103,9 @@ EOF
 # Prevent all locales from being installed in reference image
 mkdir -p %{installroot}/etc/rpm
 cat > %{installroot}/etc/rpm/macros <<EOF
-%_install_langs en_US:en
+%%_install_langs en_US:en
+%%_excludedocs 1
+%%__file_context_path /dev/null
 EOF
 
 # Initialize RPM database in reference image
@@ -118,6 +120,9 @@ yum -c ./yum.conf \
 --installroot=%{installroot} \
 -y groupinstall VServer
 
+# Freshen any new RPMs
+find %{_topdir}/RPMS -type f | xargs rpm --root %{installroot} -F
+
 # Clean up /dev in reference image
 MAKEDEV
 
@@ -165,6 +170,12 @@ if [ -n "$SUDO_UID" ] ; then
     done
 fi
 
+%pre
+# 1 = install, 2 = upgrade/reinstall
+if [ $1 -eq 2 ] ; then
+    chattr -R -i %{vrefdir}
+fi
+
 %post
 # Copy configuration files from host to reference image
 for file in /etc/hosts /etc/resolv.conf /etc/yum.conf ; do