-install -d $RPM_BUILD_ROOT/var/www/html/download
-pushd build/%{configuration}
-bzip2 -c PlanetLab-BootCD-%{version}.iso > \
- $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.iso.bz2
-bzip2 -c PlanetLab-BootCD-%{version}.usb > \
- $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.usb.bz2
-md5sum PlanetLab-BootCD-%{version}.{iso,usb} >> \
- $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.md5
-cd $RPM_BUILD_ROOT/var/www/html/download/
-md5sum PlanetLab-BootCD-%{version}.{iso,usb}.bz2 >> \
- PlanetLab-BootCD-%{version}.md5
+rm -rf $RPM_BUILD_ROOT
+
+pushd bootcd
+
+# Install the reference image and build scripts
+install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/%{name}
+install -m 755 build.sh $RPM_BUILD_ROOT/%{_datadir}/%{name}/
+tar cpf - \
+ build/isofs/bootcd.img \
+ build/isofs/isolinux.bin \
+ build/isofs/kernel \
+ build/passwd \
+ build/version.txt \
+ configurations \
+ syslinux/unix/syslinux | \
+ tar -C $RPM_BUILD_ROOT/%{_datadir}/%{name}/ -xpf -
+
+# Install the default images in the download/ directory
+install -d -m 755 $RPM_BUILD_ROOT/var/www/html/download
+install -m 644 PlanetLab-BootCD-%{version}.* \
+ $RPM_BUILD_ROOT/var/www/html/download/
+