Name:		nodelet_core
Version:	1.10.1
Release:	2
Summary:	This is ROS noetic nodelet_core Package
License:	Public Domain and Apache-2.0 and BSD and MIT and BSL-1.0 and LGPL-2.1-only and MPL-2.0 and GPL-3.0-only and GPL-2.0-or-later and MPL-1.1 and IJG and Zlib and OFL-1.1
URL:		https://github.com/ros-gbp/nodelet_core-release/archive/release/noetic/nodelet_core
Source0:	https://github.com/ros-gbp/nodelet_core-release/archive/release/noetic/nodelet_core/1.10.1-1.tar.gz
Patch0:		0001-Use-prebuilt-TinyXML2.patch
BuildRequires:	gcc-c++
BuildRequires:	cmake
BuildRequires:	lz4-devel
BuildRequires:	bzip2-devel
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	openssl-devel
BuildRequires:	uuid-devel
BuildRequires:	uuid
BuildRequires:	libuuid-devel
BuildRequires:	libtiff-devel
BuildRequires:	libwebp-devel
BuildRequires:	libjpeg-turbo-devel
BuildRequires:	yaml-cpp-devel
BuildRequires:	boost-devel
BuildRequires:	libtool-ltdl-devel
BuildRequires:	fltk-devel
BuildRequires:  libpng-devel
BuildRequires:	python3-gpgme
BuildRequires:	gpgme-devel
BuildRequires:	cpp-gpgme
BuildRequires:	python3-crypto
BuildRequires:	bullet-devel
BuildRequires:	tinyxml2-devel

%description
This is ROS noetic nodelet_core Package.

%prep
%autosetup -p1

%install

cd 3rdparty/ 

cd empy-3.3.4/
python3 setup.py install --user
cd ..

cd six-1.15.0/
python3 setup.py install --user
cd ..

cd setuptools_scm-4.1.2/
python3 setup.py install --user
cd ..

cd python-dateutil-2.8.1/
python3 setup.py install --user
cd ..

cd pyparsing-2.4.7/
python3 setup.py install --user
cd ..

cd docutils-0.16/
python3 setup.py install --user
cd ..

cd catkin_pkg-0.4.22/
python3 setup.py install --user
cd ..

#for std_msgs
cd PyYAML-5.3.1/
python3 setup.py install --user
cd ..

cd distro-1.5.0/
python3 setup.py install --user
cd ..

cd rospkg-1.2.8/
python3 setup.py install --user
cd ..



cd console_bridge/
mkdir build/
cd build/
cmake ..
make 
make install
cd ..
cd ..

cd poco/
mkdir cmake-build/
mkdir cmake-release/
cd cmake-build/
cmake ..
make -j8
make install
cd ..
cd ..

cd urdfdom_headers/
mkdir build
cd build
cmake ..
make install
cd ..
cd ..

cd eigen-3.3.7/
mkdir build
cd build
cmake ..
make install
cd ..
cd ..


# 3rdparty
cd ..

#compile
./src/catkin/bin/catkin_make_isolated --install 

####
# 对install_isoloate内部的变量名称进行替换
#
####
SRC_PATH=$PWD/install_isolated
DST_PATH=/opt/ros/noetic
sed -i "s:${SRC_PATH}:${DST_PATH}:g"  `grep -rIln "${SRC_PATH}" install_isolated/*`

####
# 添加.catkin和.rosinstall文件
#
####
mkdir -p %{buildroot}/opt/ros/noetic/
mkdir -p %{buildroot}/usr/local/
cp -r install_isolated/* %{buildroot}/opt/ros/noetic/
cp  install_isolated/.rosinstall %{buildroot}/opt/ros/noetic/
cp  install_isolated/.catkin %{buildroot}/opt/ros/noetic/
cp -r 3rdparty/install/* %{buildroot}/usr/local/

%files
%defattr(-,root,root)
/opt/ros/noetic/*
/opt/ros/noetic/.rosinstall
/opt/ros/noetic/.catkin
/usr/local/*

%changelog
* Sat Sep 25 2021 sdlzx <hdu_sdlzx@163.com> - 1.10.1-2
- Use prebuilt tinyxml2 instead of the bundled one.

* Thu 12-15-2020 openEuler Buildteam <hanhaomin008@126.com>
- Package init
