Chinaunix首页 | 论坛 | 博客
  • 博客访问: 307659
  • 博文数量: 35
  • 博客积分: 825
  • 博客等级:
  • 技术积分: 913
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-11 09:44
文章分类

全部博文(35)

文章存档

2013年(10)

2012年(24)

2010年(1)

我的朋友

分类: LINUX

2012-10-08 18:30:01

先给spec文件吧

点击(此处)折叠或打开

  1. %define __prefix /usr/local/python
  2. %define tempath /tmp
  3. Name: python27
  4. Version: 2.7.2
  5. Release: el5
  6. Summary: Python for me.com
  7. License: GPL
  8. URL: python.org
  9. Vendor: me.com
  10. GROUP: Development/Languages
  11. Source0: Python-2.7.2.tar.bz2
  12. BuildRoot: %(mktemp -ud %{tempath}/%{name}-%{version}-%{release}-root)
  13. BuildRequires: gcc make expat-devel valgrind-devel sqlite-devel db4-devel gdbm-devel
  14. Packager: me
  15. %description
  16. Python is a programming language that lets you work more quickly and
  17. integrate your systems more effectively.You can learn to use Python and
  18. see almost immediate gains in productivity and lower maintenance costs.
  19. %prep
  20. %setup -q -n Python-%{version}
  21. %build
  22. ./configure --prefix=%{__prefix} --enable-shared --with-threads --with-computed-gotos --enable-ipv6 --with-valgrind --with-system-expat --with-system-ffi --enable-unicode=ucs4 --with-signal-module
  23. make %{_smp_mflags}
  24. %install
  25. rm -rf $RPM_BUILD_ROOT
  26. mkdir -p $RPM_BUILD_ROOT
  27. make prefix=$RPM_BUILD_ROOT%{__prefix} install
  28. chmod 644 $RPM_BUILD_ROOT%{__prefix}/lib/libpython2.7*
  29. # fix the #! line in installed files
  30. find "$RPM_BUILD_ROOT" -type f -print0 |
  31. xargs -0 grep -l /usr/local/bin/python | while read file
  32. do
  33. FIXFILE="$file"
  34. sed 's|^#!.*python|#!%{__prefix}/bin/python|' \
  35. "$FIXFILE" >/tmp/fix-python-path.$$
  36. cat /tmp/fix-python-path.$$ >"$FIXFILE"
  37. rm -f /tmp/fix-python-path.$$
  38. done
  39. find "$RPM_BUILD_ROOT" -type f -print0 |
  40. xargs -0 grep -l $RPM_BUILD_ROOT%{__prefix}/bin/python2.7 | while read file
  41. do
  42. FIXFILE="$file"
  43. sed 's|^#!.*python2.7|#!%{__prefix}/bin/python2.7|' \
  44. "$FIXFILE" >/tmp/fix-python-path.$$
  45. cat /tmp/fix-python-path.$$ >"$FIXFILE"
  46. rm -f /tmp/fix-python-path.$$
  47. done
  48. %clean
  49. rm -rf $RPM_BUILD_ROOT
  50. %files
  51. %defattr(-,root,root)
  52. %{__prefix}

阅读(5433) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~