first draft of the slicerepo
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 12 Mar 2010 13:59:47 +0000 (13:59 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 12 Mar 2010 13:59:47 +0000 (13:59 +0000)
bootstrapfs.spec
slicerepo.spec [new file with mode: 0644]

index 6c46f79..da84c10 100644 (file)
@@ -61,13 +61,13 @@ for the MyPLC side.
 %setup -q
 
 %build
+
+############################## node-side
 pushd BootstrapFS
 ./build.sh %{pldistro} 
 popd
 
-# xxx in a multi-flavour myplc, we should ship for all fcdistros
-# and let the php scripts do the right thing
-
+############################## server-side
 pushd BootstrapFS/nodeconfig/yum
 # scan fcdistros and catenate all repos in 'stock.repo' so db-config can be distro-independant
 for fcdistro in $(ls); do
@@ -89,6 +89,7 @@ popd
 %install
 rm -rf $RPM_BUILD_ROOT
 
+############################## node-side
 pushd BootstrapFS
 #arch=$(uname -i)
 
@@ -106,6 +107,10 @@ for pkgs in $(ls ../build/config.%{pldistro}/bootstrapfs-*.pkgs) ; do
 done
 popd
 
+############################## server-side
+# xxx unfinished business here
+# xxx in a multi-flavour myplc, we should ship for all fcdistros
+# and let the php scripts do the right thing
 pushd BootstrapFS
 echo "* Installing MyPLC-side nodes yum config utilities"
 # expose (fixed) myplc.repo.php as                                         https://<plc>/yum/myplc.repo.php
@@ -120,9 +125,6 @@ echo "* Installing plc.d initscripts"
 find plc.d | cpio -p -d -u ${RPM_BUILD_ROOT}/etc/
 chmod 755 ${RPM_BUILD_ROOT}/etc/plc.d/*
 
-popd
-
-pushd BootstrapFS
 echo "* Installing db-config.d files"
 mkdir -p ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
 cp db-config.d/* ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
diff --git a/slicerepo.spec b/slicerepo.spec
new file mode 100644 (file)
index 0000000..4e405e1
--- /dev/null
@@ -0,0 +1,81 @@
+#
+# $Id$
+#
+%define url $URL$
+
+# build is expected to export the following rpm variables
+# %{distroname}     : e.g. Fedora
+# %{distrorelease}  : e.g. 8
+# %{slice_rpms_plus} : as a +++ separated list of rpms from the build dir
+
+%define nodefamily %{pldistro}-%{distroname}-%{_arch}
+%define obsolete_nodefamily %{pldistro}-%{_arch}
+
+%define name slicerepo-%{nodefamily}
+%define version 2.0
+%define taglevel 0
+
+# pldistro already in the rpm name
+#%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+%define release %{taglevel}%{?date:.%{date}}
+
+Vendor: PlanetLab
+Packager: PlanetLab Central <support@planet-lab.org>
+Distribution: PlanetLab %{plrelease}
+URL: %(echo %{url} | cut -d ' ' -f 2)
+
+Summary: The initial content of the yum repository for nodes
+Name: %{name}
+Version: %{version}
+Release: %{release}
+License: BSD
+Group: System Environment/Base
+Source0: %{name}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+# other archs must be able to install this
+BuildArch: noarch
+
+BuildRequires: rsync 
+Requires: myplc
+
+# 5.0 now has 3-fold nodefamily
+%define obsolete_nodefamily %{pldistro}-%{_arch}
+Obsoletes: slicerepo-%{obsolete_nodefamily}
+
+%define debug_package %{nil}
+
+%description
+This rpm contains all the rpms designed for running on a PlanetLab node
+they come organized into a yum repository 
+
+%prep
+%setup -q
+
+%build
+echo nothing to do at build time for slicerepo
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+repo=slice-%{nodefamily}
+install -d -m 755 $RPM_BUILD_ROOT/var/www/html/install-rpms/$repo
+rpms=$(echo %{slice_rpms_plus} | sed -e 's,+++, ,g')
+for rpm in $rpms; do rsync %{_topdir}/$rpm $RPM_BUILD_ROOT/var/www/html/install-rpms/$repo/ ; done
+### yumgroups
+install -D -m 644 %{_topdir}/RPMS/yumgroups.xml $RPM_BUILD_ROOT/var/www/html/install-rpms/$repo/yumgroups.xml
+# do not do this yet, as plc.d/packages will do it anyway
+#createrepo -g yumgroups.xml $RPM_BUILD_ROOT/var/www/html/install-rpms/$repo
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+service plc start packages
+
+%files
+%defattr(-,root,root,-)
+/var/www/html/install-rpms/%{nodefamily}
+# don't overwrite yumgroups.xml if exists
+%config(noreplace) /var/www/html/install-rpms/%{nodefamily}/yumgroups.xml
+
+%changelog