stupid me
[nodeconfig.git] / nodeconfig.spec
index a08241d..c130029 100644 (file)
@@ -27,6 +27,8 @@ URL: %(echo %{url} | cut -d ' ' -f 2)
 # We use set everywhere
 Requires: php >= 5.0
 Requires: PLCAPI >= 5.0
+# need the apache user at install-time
+Requires: httpd 
 
 %description
 
@@ -40,15 +42,33 @@ reasons these scripts get installed in /var/www/html/PlanetLabConf.
 %setup -q
 
 %build
-EXCLUDE="exclude=kernel* util-vserver* iptables iproute"
+pushd nodeconfig/yum
+
+KEXCLUDE="exclude=$(../../build/getkexcludes.sh)"
+
+# expand list of kexcludes
 for filein in $(find . -name '*.in') ; do
     file=$(echo $filein | sed -e "s,\.in$,,")
-    sed -e "s,@EXCLUDE@,$EXCLUDE,g" $filein > $file
+    sed -e "s,@KEXCLUDE@,$KEXCLUDE,g" $filein > $file
+done
+
+# scan fcdistros and catenate all repos in 'stock.repo' so db-config can be distro-independant
+
+for fcdistro in $(ls); do
+    [ -d $fcdistro ] || continue
+    pushd $fcdistro/yum.myplc.d
+    rm -f stock.repo
+    cat *.repo > stock.repo
+    popd
 done
 
+popd
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
+pushd nodeconfig
+
 echo "* nodeconfig: Installing PlanetLabConf pages"
 
 for dir in boot PlanetLabConf PLCAPI ; do
@@ -56,14 +76,31 @@ for dir in boot PlanetLabConf PLCAPI ; do
     rsync -a --exclude .svn ./$dir/ $RPM_BUILD_ROOT/var/www/html/$dir/
 done
 
+# the yum area -- se db-config
+# expose (fixed) myplc.repo.php as                                         https://<plc>/yum/myplc.repo.php
+install -D -m 644 ./yum/myplc.repo.php                      $RPM_BUILD_ROOT/var/www/html/yum/myplc.repo.php
+# expose the fcdistro-dependant yum.conf as                                https://<plc>/yum/yum.conf
+install -D -m 644 ./yum/%{distroname}/yum.conf              $RPM_BUILD_ROOT/var/www/html/yum/yum.conf
+# expose the (fcdistro-dependant) stock.repo as                                    https://<plc>/yum/stock.repo
+install -D -m 644 ./yum/%{distroname}/yum.myplc.d/stock.repo $RPM_BUILD_ROOT/var/www/html/yum/stock.repo
+
+popd
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+# the boot manager upload area
+mkdir -p /var/log/bm
+chown apache:apache /var/log/bm
+chmod 700 /var/log/bm
+
 %files
 %defattr(-,root,root,-)
 /var/www/html/boot
 /var/www/html/PlanetLabConf
 /var/www/html/PLCAPI
+/var/www/html/yum
 
 %changelog
 * Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeconfig-5.0-1