rpm-install.sh 809 B

12345678910111213141516171819202122232425262728
  1. #! /bin/sh
  2. #
  3. # This file becomes the install section of the generated spec file.
  4. #
  5. # This is what dist.py normally does.
  6. %{__python} setup.py install --root=${RPM_BUILD_ROOT} --record="INSTALLED_FILES"
  7. # Sort the filelist so that directories appear before files. This avoids
  8. # duplicate filename problems on some systems.
  9. touch DIRS
  10. for i in `cat INSTALLED_FILES`; do
  11. if [ -f ${RPM_BUILD_ROOT}/$i ]; then
  12. echo $i >>FILES
  13. fi
  14. if [ -d ${RPM_BUILD_ROOT}/$i ]; then
  15. echo %dir $i >>DIRS
  16. fi
  17. done
  18. # Make sure we match foo.pyo and foo.pyc along with foo.py (but only once each)
  19. sed -e "/\.py[co]$/d" -e "s/\.py$/.py*/" DIRS FILES >INSTALLED_FILES
  20. mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man1/
  21. cp docs/man/* ${RPM_BUILD_ROOT}/%{_mandir}/man1/
  22. cat << EOF >> INSTALLED_FILES
  23. %doc %{_mandir}/man1/*"
  24. EOF