Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1027215
  • 博文数量: 361
  • 博客积分: 25
  • 博客等级: 民兵
  • 技术积分: 1759
  • 用 户 组: 普通用户
  • 注册时间: 2012-09-22 23:18
个人简介

学海无涯 个人blog lnmps.com 新站

文章分类

全部博文(361)

文章存档

2017年(1)

2015年(2)

2014年(55)

2013年(303)

分类: LINUX

2013-07-11 15:51:24

原文地址:制作 python2.7.2 rpm安装包 作者:pengphy

先给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}

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