cef9eae
%if 0%{?rhel} && 0%{?rhel} <= 6
cef9eae
%{!?__python2: %global __python2 /usr/bin/python2}
cef9eae
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
cef9eae
%endif
cef9eae
cef9eae
%global commit 4cee3f4c28afea1c55f82371cb9cac91edf5de06
5dc58d4
%global shortcommit %(c=%{commit}; echo ${c:0:7})
f680e80
%global realname rospkg
f680e80
f680e80
Name:           python-rospkg
cef9eae
Version:        1.0.28
5dc58d4
Release:        1%{?dist}
f680e80
Summary:        Utilities for ROS package, stack, and distribution information
f680e80
f680e80
License:        BSD
f680e80
URL:            http://ros.org/wiki/rospkg
67b57a0
Source0:        https://github.com/ros-infrastructure/%{realname}/archive/%{commit}/%{realname}-%{version}-%{shortcommit}.tar.gz
cef9eae
cef9eae
# Remove python-argparse from runtime dependency list (rhbz#1088448)
cef9eae
Patch0:         %{realname}-1.0.28-argparse.patch
cef9eae
f680e80
BuildArch:      noarch
f680e80
cef9eae
BuildRequires:  python2-devel
cef9eae
BuildRequires:  python-setuptools
cef9eae
BuildRequires:  python-catkin-sphinx
f680e80
BuildRequires:  python-sphinx
67a35fc
BuildRequires:  PyYAML
cef9eae
67a35fc
Requires:       PyYAML
cef9eae
Requires:       python-argparse
f680e80
f680e80
%description
f680e80
The ROS packaging system simplifies development and distribution of code 
f680e80
libraries. It enable you to easily specify dependencies between code 
f680e80
libraries, easily interact with those libraries from the command-line, and 
f680e80
release your code for others to use.
f680e80
f680e80
%prep
5dc58d4
%setup -qn %{realname}-%{commit}
cef9eae
%if 0%{?fedora} || 0%{?rhel} > 6
cef9eae
%patch0 -p0 -b .argparse
cef9eae
%endif
f680e80
f680e80
%build
cef9eae
%{__python2} setup.py build
f680e80
pushd doc
cef9eae
make html
f680e80
make man
f680e80
popd
cef9eae
rm -f doc/_build/html/.buildinfo
cef9eae
cef9eae
%check
cef9eae
# Tests expect the base folder name to be 'rospkg', so move the source folder
cef9eae
cd ..
cef9eae
mv %{realname}-%{commit} %{realname}
cef9eae
cd %{realname}
cef9eae
# Run the nosetests
cef9eae
pushd test
cef9eae
PYTHONPATH=%{buildroot}%{python2_sitelib} nosetests
cef9eae
popd
cef9eae
# Put the source folder back to its original name
cef9eae
cd ..
cef9eae
mv %{realname} %{realname}-%{commit}
cef9eae
cd %{realname}-%{commit}
f680e80
f680e80
%install
f680e80
rm -rf $RPM_BUILD_ROOT
cef9eae
%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT
f680e80
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{realname}
f680e80
install -p -m 0644 manifest.xml $RPM_BUILD_ROOT%{_datadir}/%{realname}
f680e80
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
f680e80
install -p -m 0644 doc/man/rosversion.1 $RPM_BUILD_ROOT%{_mandir}/man1
f680e80
f680e80
sed -i 's|#!/usr/bin/env python||' $RPM_BUILD_ROOT%{python_sitelib}/%{realname}/*.py
f680e80
f680e80
%files
cef9eae
%doc doc/_build/html
f680e80
%{_bindir}/*
cef9eae
%{python2_sitelib}/%{realname}-%{version}-py?.?.egg-info
cef9eae
%{python2_sitelib}/%{realname}
f680e80
%{_mandir}/man1/*.gz
f680e80
%{_datadir}/%{realname}
f680e80
f680e80
%changelog
cef9eae
* Wed Apr 16 2014 Rich Mattes <richmattes@gmail.com> - 1.0.28-1
cef9eae
- Update to release 1.0.28
cef9eae
- Remove argparse from python dependency list (rhbz#1088448)
cef9eae
- Add requirement on python-argparse
cef9eae
- Add check section
cef9eae
- Add html documentation
cef9eae
67a35fc
* Fri Apr 04 2014 Scott K Logan <logans@cottsay.net> - 1.0.27-1
67a35fc
- Update to release 1.0.27
67a35fc
- Added PyYAML BuildRequires and Requires
67a35fc
67b57a0
* Sat Feb 08 2014 Rich Mattes <richmattes@gmail.com> - 1.0.26-1
67b57a0
- Update to release 1.0.26
67b57a0
5dc58d4
* Mon Aug 19 2013 Rich Mattes <richmattes@gmail.com> - 1.0.21-1
5dc58d4
- Update to release 1.0.21
5dc58d4
- Update to github sourceurl guidelines
5dc58d4
89ecb5e
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.20-2.20130318git0a4448e
89ecb5e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
89ecb5e
78ed549
* Mon Mar 18 2013 Rich Mattes <richmattes@gmail.com> - 1.0.20-1.20130318git0a4448e
78ed549
- Update to release 1.0.20
78ed549
9299bc7
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.18-2
9299bc7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
9299bc7
ea48979
* Wed Jan 02 2013 Rich Mattes <richmattes@gmail.com> - 1.0.18-1
ea48979
- Update to version 1.0.18
ea48979
8f93f39
* Fri Oct 26 2012 Rich Mattes <richmattes@gmail.com> - 1.0.10-1
8f93f39
- Update to version 1.0.10
8f93f39
f680e80
* Sat Sep 22 2012 Rich Mattes <richmattes@gmail.com> - 1.0.6-2
f680e80
- Moved build to build section
f680e80
- Finer-grained filenames in files section
f680e80
f680e80
* Sat Jun 16 2012 Rich Mattes <richmattes@gmail.com> - 1.0.6-1
f680e80
- Update to version 1.0.6
f680e80
f680e80
* Sat Jun 02 2012 Rich Mattes <richmattes@gmail.com> - 1.0.3-1
f680e80
- Update to version 1.0.3
f680e80
f680e80
* Wed Apr 25 2012 Rich Mattes <richmattes@gmail.com> - 1.0.2-1
f680e80
- Initial package