package /etc/myplc-release in a separate myplc-release package
Thierry Parmentelat [Thu, 9 Oct 2008 02:56:57 +0000 (02:56 +0000)]
hoping to get more accurate information out of GetPlcRelease

build-native.sh
myplc-native.spec
myplc-release.spec [new file with mode: 0644]

index 653f4f4..a57232e 100755 (executable)
 # Install configuration scripts
 echo "* myplc-native: Installing configuration scripts"
 pldistro=$1; shift
-tmpdir=$1 ; shift
-rm -rf ${tmpdir}
-mkdir -p ${tmpdir}
+RPM_BUILD_ROOT=$1 ; shift
+rm -rf ${RPM_BUILD_ROOT}
+mkdir -p ${RPM_BUILD_ROOT}
 echo "* myplc-native: installing plc_config.py in /usr/share/myplc"
-install -D -m 755 plc_config.py ${tmpdir}/usr/share/myplc/plc_config.py
-install -D -m 755 plc-config ${tmpdir}/usr/bin/plc-config
-install -D -m 755 plc-config-tty ${tmpdir}/usr/bin/plc-config-tty
-install -D -m 755 db-config ${tmpdir}/usr/bin/db-config
-install -D -m 755 dns-config ${tmpdir}/usr/bin/dns-config
-install -D -m 755 plc-map.py ${tmpdir}/usr/bin/plc-map.py
-install -D -m 755 plc-kml.py ${tmpdir}/usr/bin/plc-kml.py
-install -D -m 755 refresh-peer.py ${tmpdir}/usr/bin/refresh-peer.py
-install -D -m 755 clean-empty-dirs.py ${tmpdir}/usr/bin/clean-empty-dirs.py
-install -D -m 755 mtail.py ${tmpdir}/usr/bin/mtail.py
-install -D -m 755 check-ssl-peering.py ${tmpdir}/usr/bin/check-ssl-peering.py
+install -D -m 755 plc_config.py ${RPM_BUILD_ROOT}/usr/share/myplc/plc_config.py
+install -D -m 755 plc-config ${RPM_BUILD_ROOT}/usr/bin/plc-config
+install -D -m 755 plc-config-tty ${RPM_BUILD_ROOT}/usr/bin/plc-config-tty
+install -D -m 755 db-config ${RPM_BUILD_ROOT}/usr/bin/db-config
+install -D -m 755 dns-config ${RPM_BUILD_ROOT}/usr/bin/dns-config
+install -D -m 755 plc-map.py ${RPM_BUILD_ROOT}/usr/bin/plc-map.py
+install -D -m 755 plc-kml.py ${RPM_BUILD_ROOT}/usr/bin/plc-kml.py
+install -D -m 755 refresh-peer.py ${RPM_BUILD_ROOT}/usr/bin/refresh-peer.py
+install -D -m 755 clean-empty-dirs.py ${RPM_BUILD_ROOT}/usr/bin/clean-empty-dirs.py
+install -D -m 755 mtail.py ${RPM_BUILD_ROOT}/usr/bin/mtail.py
+install -D -m 755 check-ssl-peering.py ${RPM_BUILD_ROOT}/usr/bin/check-ssl-peering.py
 # Extra scripts (mostly for mail and dns) not installed by myplc by default.  Used in production
-mkdir -p ${tmpdir}/etc/support-scripts
-cp support-scripts/* ${tmpdir}/etc/support-scripts
+mkdir -p ${RPM_BUILD_ROOT}/etc/support-scripts
+cp support-scripts/* ${RPM_BUILD_ROOT}/etc/support-scripts
 # copy initscripts to etc/plc_sliceinitscripts
-mkdir -p ${tmpdir}/etc/plc_sliceinitscripts
-cp plc_sliceinitscripts/* ${tmpdir}/etc/plc_sliceinitscripts
+mkdir -p ${RPM_BUILD_ROOT}/etc/plc_sliceinitscripts
+cp plc_sliceinitscripts/* ${RPM_BUILD_ROOT}/etc/plc_sliceinitscripts
 
 # Install initscripts
 echo "* myplc-native: Installing initscripts"
-find plc.d | cpio -p -d -u ${tmpdir}/etc/
-install -D -m 755 guest.init ${tmpdir}/etc/init.d/plc
-
-# fetch the release stamp from the build if any
-if [ -f ../../../myplc-release ] ; then
-  cp ../../../myplc-release myplc-release
-else
-  echo "Cannot find release information." > myplc-release
-  date >> myplc-release
-  echo "$HeadURL$" >> myplc-release
-fi
-# install it in /etc/myplc-release 
-install -m 444 myplc-release ${tmpdir}/etc/myplc-release
+find plc.d | cpio -p -d -u ${RPM_BUILD_ROOT}/etc/
+install -D -m 755 guest.init ${RPM_BUILD_ROOT}/etc/init.d/plc
 
 # Install configuration file
 echo "* myplc: Installing configuration file"
-install -D -m 444 default_config.xml ${tmpdir}/etc/planetlab/default_config.xml
-install -D -m 444 plc_config.dtd ${tmpdir}/etc/planetlab/plc_config.dtd
+install -D -m 444 default_config.xml ${RPM_BUILD_ROOT}/etc/planetlab/default_config.xml
+install -D -m 444 plc_config.dtd ${RPM_BUILD_ROOT}/etc/planetlab/plc_config.dtd
 
 # yumgroups.xml and yum repo : let noderepo handle that
 
index 1504e39..33f4e8f 100644 (file)
@@ -71,6 +71,7 @@ Requires: nodeconfig
 Requires: PLCAPI
 Requires: bootstrapfs-%{pldistro}-%{_arch}
 Requires: myplc-docs
+Requires: myplc-release
 
 # argh - ugly - we might wish to use something from build/config.%{pldistro} instead
 %if "%{pldistro}" == "onelab"
@@ -101,7 +102,6 @@ popd
 
 %install
 
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -188,7 +188,6 @@ fi
 %files
 %defattr(-,root,root,-)
 # Host startup script and configuration file
-/etc/myplc-release
 /etc/init.d/plc
 /etc/plc.d
 /etc/planetlab
diff --git a/myplc-release.spec b/myplc-release.spec
new file mode 100644 (file)
index 0000000..fa57579
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# $Id$
+#
+%define url $URL$
+
+%define name myplc-release
+%define version 5.0
+%define taglevel 1
+
+%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+
+Summary: PlanetLab Central (PLC) release file
+Name: %{name}
+Version: %{version}
+Release: %{release}
+License: PlanetLab
+Group: Applications/Systems
+Source0: %{name}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+BuildArch: noarch
+
+Vendor: PlanetLab
+Packager: PlanetLab Central <support@planet-lab.org>
+Distribution: PlanetLab %{plrelease}
+URL: %(echo %{url} | cut -d ' ' -f 2)
+
+%define debug_package %{nil}
+
+%description 
+This package contains in /etc/myplc-release the details of the
+contents of that release. This is used by the GetPlcRelease API call.
+
+%prep
+%setup -q
+
+%build
+rm -rf $RPM_BUILD_ROOT
+
+# fetch the release stamp from the build if any
+if [ -f ../../../myplc-release ] ; then
+  cp ../../../myplc-release myplc-release
+else
+  echo "Cannot find release information." > myplc-release
+  date >> myplc-release
+  echo "$HeadURL$" >> myplc-release
+fi
+# install it in /etc/myplc-release 
+install -m 444 myplc-release ${RPM_BUILD_ROOT}/etc/myplc-release
+
+%install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+/etc/myplc-release
+
+%changelog