[openrtm-commit:01074] r574 - in trunk/OpenRTM-aist-Python/packages: . rpm

openrtm @ openrtm.org openrtm @ openrtm.org
2013年 5月 2日 (木) 18:45:08 JST


Author: n-ando
Date: 2013-05-02 18:45:08 +0900 (Thu, 02 May 2013)
New Revision: 574

Added:
   trunk/OpenRTM-aist-Python/packages/rpm/
   trunk/OpenRTM-aist-Python/packages/rpm/openrtm-aist.spec.in
   trunk/OpenRTM-aist-Python/packages/rpm/rpm_build.sh
Log:
rpm package build script have been added.

Added: trunk/OpenRTM-aist-Python/packages/rpm/openrtm-aist.spec.in
===================================================================
--- trunk/OpenRTM-aist-Python/packages/rpm/openrtm-aist.spec.in	                        (rev 0)
+++ trunk/OpenRTM-aist-Python/packages/rpm/openrtm-aist.spec.in	2013-05-02 09:45:08 UTC (rev 574)
@@ -0,0 +1,118 @@
+#------------------------------------------------------------
+#
+# @file RPM spec file for OpenRTM-aist-Python
+# @author Noriaki Ando <n-ando at aist.go.jp>
+#
+# $Id$
+#
+
+%define pkgname OpenRTM-aist-Python
+%define version __VERSION__
+%define short_version __SHORT_VERSION__
+%define distname       __DISTNAME__
+%define builddir       %{_topdir}/BUILD/%{distname}
+%define pkgver         RELEASE0
+%define _unpackaged_files_terminate_build   0
+
+#------------------------------------------------------------
+# Package information
+Name: OpenRTM-aist-Python
+Version: %{version}
+Release: %{pkgver}.%{distname}
+Summary: Python modules for OpenRTM-aist-1.0.0
+Group: Applications/System
+License: LGPL
+URL: http://openrtm.org
+Source0: %{pkgname}-%{version}.tar.gz
+Vendor: AIST <n-ando at aist.go.jp>
+
+Prefix: %{_prefix}
+Buildroot: %{_tmppath}/%{pkgname}-%{version}-%{release}-root
+
+Requires: python >= 2.5
+Requires: omniORBpy
+Requires: omniORBpy-devel
+Requires: omniORBpy-standard
+
+%description
+OpenRTM-aist is a reference implementation of RTC (Robotic Technology
+Component) specification which is OMG standard. OpenRTM-aist includes
+RT-Middleware runtime environment and RTC framework. The OMG standard
+defines a component model and certain important infrastructure
+services applicable to the domain of robotics software development.
+OpenRTM-aist is being developed and distributed by Task Intelligence
+Research Group, Intelligent Systems Research Institute, National
+Institute of Advanced Industrial Science and Technology (AIST), Japan.
+Please see http://www.is.aist.go.jp/rt/OpenRTM-aist/html/ for more
+detail.
+
+#------------------------------------------------------------
+# doc package
+%package doc
+Summary: Documentation
+Group: Development/Libraries
+%description doc
+Developer documentation.
+
+#------------------------------------------------------------
+# example package
+%package example
+Summary: Example
+Group: Development/Libraries
+Requires: OpenRTM-aist-Python
+%description example
+Example components and sources
+
+#------------------------------------------------------------
+# prep section
+%prep
+%{__rm} -rf %{buildroot}
+%setup
+
+#------------------------------------------------------------
+# build section
+%build
+%{__python} setup.py build_core
+%{__python} setup.py build_example
+
+#------------------------------------------------------------
+# install section
+%install
+%{__python} setup.py install --root=%{buildroot} --record=INSTALLED_FILES
+
+#------------------------------------------------------------
+# clean section
+%clean
+rm -rf %{buildroot}
+
+#------------------------------------------------------------
+# core files section
+%files
+%defattr(-,root,root)
+%{python_sitelib}/OpenRTM-aist.pth
+%{python_sitelib}/OpenRTM_aist_Python-1.1.0-py%{python_version}.egg-info
+%{python_sitelib}/OpenRTM_aist
+%attr(755,root,root) %{_bindir}/*
+
+#------------------------------------------------------------
+# doc package file list
+%files doc
+%defattr(-,root,root,-)
+%{_datadir}/openrtm-%{short_version}/doc/python/
+
+
+#------------------------------------------------------------
+# example package file list
+%files example
+%defattr(755,root,root,-)
+%{_datadir}/openrtm-%{short_version}/example/python/
+
+
+#------------------------------------------------------------
+# changelog section
+%changelog
+* Wed May 01 2013  <n-ando at aist.go.jp> 1.1.0
+- 1.1.0-RELEASE
+
+* Thu Sep 27 2007 Noriaki Ando <n-ando at aist.go.jp> - 0.4.1-1._distname
+- The second public release version of OpenRTM-aist-0.4.1.


Property changes on: trunk/OpenRTM-aist-Python/packages/rpm/openrtm-aist.spec.in
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/OpenRTM-aist-Python/packages/rpm/rpm_build.sh
===================================================================
--- trunk/OpenRTM-aist-Python/packages/rpm/rpm_build.sh	                        (rev 0)
+++ trunk/OpenRTM-aist-Python/packages/rpm/rpm_build.sh	2013-05-02 09:45:08 UTC (rev 574)
@@ -0,0 +1,133 @@
+#!/bin/sh
+#
+# @file rpm_build.sh
+# @author Noriaki Ando <n-ando at aist.go.jp>
+# @brief rpm package build script
+#
+# $Id$
+#
+export LC_ALL=C
+
+check_distribution()
+{
+    dist_name=""
+    dist_key=""
+    # Check the lsb distribution name
+    if test -f /etc/lsb-release ; then
+	. /etc/lsb-release
+	if test "x$DISTRIB_DESCRIPTION" != "x" ; then
+	    dist_name=$DISTRIB_DESCRIPTION-`uname -m`
+	fi
+    fi
+    # Check the Fedora version
+    if test "x$dist_name" = "x" && test -f /etc/fedora-release ; then
+	dist_name=`cat /etc/fedora-release`-`uname -m`
+	dist_key=`sed -e 's/.[^0-9]*\([0-9]\+\).*/fc\1/' /etc/fedora-release`
+    fi
+    #Check the Debian version
+    if test "x$dist_name" = "x" && test -f /etc/debian_version ; then
+	dist_name="Debian"`cat /etc/debian_version`-`uname -m`
+	dist_key=""
+    fi
+    # Check the Vine version
+    if test "x$dist_name" = "x" && test -f /etc/vine-release ; then
+	dist_name=`cat /etc/vine-release`-`uname -m`
+	dist_key=`sed -e 's/.*\([0-9]\)\.\([0-9]\).*/vl\1\2/' /etc/vine-release`
+    fi
+    # Check the TuboLinux version
+    if test "x$dist_name" = "x" && test -f /etc/turbolinux-release ; then
+	dist_name=`cat /etc/tubolinux-release`-`uname -m`
+	dist_key=""
+    fi
+
+    if test "x$dist_name" = "x" ; then
+	dist_name=$os$release
+    fi
+    # Check the RedHat/Fedora version
+    if test "x$dist_name" = "x" && test -f /etc/redhat-release ; then
+	dist_name=`cat /etc/redhat-release`-`uname -m`
+    fi
+
+    # only fedora and vine
+    if test "x$dist_key" = "x" ; then
+	echo "This is not Feodra/Vine/Scientific/RedHat distribution"
+	exit 0
+    fi
+    DIST_KEY=$dist_key
+    DIST_NAME=`echo $dist_name | sed 's/[ |\(|\)]//g'`
+}
+
+get_version_info()
+{
+    VERSION=`../../setup.py --version`
+    SHORT_VERSION=`echo $VERSION | sed 's/\.[0-9]*$//'`
+}
+
+create_rpmbuilddir()
+{
+    mkdir {BUILD,RPMS,SOURCES,SPECS,SRPMS}
+    mkdir RPMS/{i386,i586,i686,x86_64,noarch}
+    export BUILD_DIR=`pwd`
+}
+
+create_source_package()
+{
+    cd ../../
+    ./setup.py build
+    ./setup.py sdist
+    cd -
+}
+
+copy_source_package()
+{
+    cp ../../dist/OpenRTM-aist-Python*.tar.gz ./SOURCES/
+}
+
+create_spec_file()
+{
+    sed "s/__DISTNAME__/$DIST_KEY/g" openrtm-aist.spec.in > openrtm-aist.spec.1
+    sed "s/__VERSION__/$VERSION/g" openrtm-aist.spec.1 > openrtm-aist.spec.2
+    sed "s/__SHORT_VERSION__/$SHORT_VERSION/g" openrtm-aist.spec.2 > openrtm-aist.spec.3
+    cp openrtm-aist.spec.3 SPECS/openrtm-aist.spec
+    rm openrtm-aist.spec.[0-9]
+    echo "%_topdir $BUILD_DIR" > .rpmrc
+}
+
+build_rpm()
+{
+    cd SPECS
+    rpm_def="_topdir $BUILD_DIR"
+    if rpmbuild --define "$rpm_def" -ba openrtm-aist.spec ; then
+	echo "Build successful"
+    else
+	echo "Build failed"
+	exit 1
+    fi
+}
+
+get_opt()
+{
+    if test "x$1" = "xclean" ; then
+	rm -rf *.log *.bak
+	dirs="BUILD RPMS SOURCES SPECS SRPMS BUILDROOT"
+	for d in $dirs; do
+	    rm -rf $d
+	done
+	exit 0
+    fi
+}
+#------------------------------
+# main
+#------------------------------
+get_opt $*
+
+check_distribution
+get_version_info
+
+create_rpmbuilddir
+create_source_package
+copy_source_package
+create_spec_file
+
+build_rpm
+


Property changes on: trunk/OpenRTM-aist-Python/packages/rpm/rpm_build.sh
___________________________________________________________________
Added: svn:executable
   + *



More information about the openrtm-commit mailing list