LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 755|回复: 1

opensuse如何打包rpm

[复制链接]
发表于 2010-12-18 18:02:31 | 显示全部楼层 |阅读模式
如题
我下载了mldonkey编译好了要如何打包
因为这样好管理些
请问要用什么软件
如何操作?:yun:
发表于 2010-12-18 19:41:41 | 显示全部楼层
rpm 建包原理:http://www.linuxfans.org/bbs/thread-86980-1-1.html
一个mldonkey的spec文档内容,可参考:
  1. %define sourcename mldonkey
  2. %define _prova         0
  3. Name: MLDonkey
  4. Summary: Filesharing client for eDonkey 2000 and other P2P systems
  5. Version: 3.0.1
  6. Release: 1
  7. License: Other License(s), see package, GPL
  8. Group: Productivity/Networking/Other
  9. Autoreqprov:  on
  10. URL: http://mldonkey.sourceforge.net/Main_Page
  11. Source0: http://mesh.dl.sourceforge.net/sourceforge/mldonkey/%{sourcename}-%{version}.tar.bz2
  12. Source1: %{sourcename}-gtk2gui-2.5-30-1.shared.i386-Linux.tar.bz2
  13. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  14. BuildRequires: gcc gcc-c++ perl python-numeric wget qt3-devel libcrypto++0-devel
  15. BuildRequires: ocaml camlp4 zlib-devel glibc-devel lablgtk2-devel libGeoIP-devel
  16. %if %suse_version > 1020
  17. BuildRequires: libbz2-devel
  18. %endif
  19. %if %suse_version == 1010
  20. BuildRequires: avahi-compat-mDNSResponder
  21. %endif
  22. BuildRequires: gd-devel libpng-devel libjpeg-devel file-devel ncurses-devel
  23. Requires: perl ocaml camlp4 wget gd file ncurses GeoIP
  24. Obsoletes: MLDonkey-init
  25. %description
  26. mldonkey is a peer-to-peer filesharing client originally developed for
  27. use with the eDonkey system that also supports Limewire, OpenNap,
  28. AudioGalaxy and other P2P systems. The actual client and the user
  29. interface are completely separated and can thus be executed on
  30. different machines. A web interface is available as well.
  31. %ifarch i386 i486 i586 i686 x86_64
  32. %package gui
  33. Summary:        gtk2 GUI for mldonkey
  34. Group:          Productivity/Networking/Other
  35. Requires:       %{name}
  36. %description gui
  37. mldonkey gtk2 GUI
  38. %endif
  39. %if "%{_prova}" == "1"
  40. %package init
  41. Summary:        Init to launch mldonkey
  42. Group:                Productivity/Networking/Other
  43. Requires:        %{name}
  44. PreReq:         pwdutils
  45. %description init
  46. This package contains init to launch mldonkey as a service
  47. %package ed2k_submit
  48. Summary:         This tool gives you an easy way to add a ed2k-link
  49. Group:                 Productivity/Networking/Other
  50. Requires:         perl-libwww-perl
  51. %description ed2k_submit
  52. This tool gives you an easy way to add a ed2k-link
  53. (like ed2k://|file|filename.exe|21352658|72b0b287cab7d875ccc1d89ebe910b9g|)
  54. with a single click to your mldonkey download queue.
  55. You need to edit /etc/sysconfig/mldonkey_submit
  56. %endif
  57. %prep
  58. %setup -q -n %{sourcename}-%{version}
  59. %configure \
  60.         --enable-gnutella \
  61.         --enable-gnutella2
  62. #        --enable-gui=newgui2
  63. %build
  64. gmake
  65. make utils
  66. %install
  67. %makeinstall
  68. # core
  69. install -m 755  distrib/mldonkey_command %{buildroot}%{_bindir}/mldonkey_command
  70. install -m 755  distrib/kill_mldonkey %{buildroot}%{_bindir}/kill_mldonkey
  71. install -m 755  make_torrent %{buildroot}%{_bindir}/make_torrent
  72. install -m 755  mld_hash %{buildroot}%{_bindir}/mld_hash
  73. %if "%{_prova}" == "1"
  74. # init
  75. install -d -m 755 %{buildroot}%{_initrddir}
  76. install -d -m 755 %{buildroot}/var/lib/mldonkey
  77. install -d -m 755 %{buildroot}/var/cache/mldonkey
  78. install -d -m 755 %{buildroot}/var/lib/mldonkey/incoming
  79. install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
  80. install -m 755 packages/rpm/mldonkey.init %{buildroot}%{_initrddir}/mldonkey
  81. install -m 644 packages/rpm/mldonkey.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/mldonkey
  82. # ed2k_submit
  83. install -d -m 755 %{buildroot}%{_datadir}/services/
  84. install -m 755 distrib/ed2k_submit/mldonkey_submit %{buildroot}%{_bindir}/mldonkey_submit
  85. install -m 644 distrib/ed2k_submit/mldonkey %{buildroot}%{_sysconfdir}/sysconfig/mldonkey_submit
  86. install -m 644 distrib/ed2k_submit/ed2k.protocol  %{buildroot}%{_datadir}/services/ed2k.protocol
  87. %endif
  88. #gui
  89. %ifarch i386 i486 i586 i686 x86_64
  90. pushd $RPM_BUILD_ROOT%{_bindir}/
  91. %__tar xjvf "%{SOURCE1}"
  92. popd
  93. %endif
  94. %if "%{_prova}" == "1"
  95. %pre init
  96. useradd mldonkey
  97. %postun init
  98. userdel mldonkey
  99. %endif
  100. %clean
  101. rm -fr %buildroot
  102. %files
  103. %defattr(-,root,root)
  104. %doc ChangeLog Copying.txt
  105. %{_bindir}/mlnet
  106. %{_bindir}/mldonkey_command
  107. %{_bindir}/kill_mldonkey
  108. %{_bindir}/mlbt
  109. %{_bindir}/mldc
  110. %{_bindir}/mldonkey
  111. %{_bindir}/mlgnut
  112. %{_bindir}/mlslsk
  113. %{_bindir}/make_torrent
  114. %{_bindir}/mld_hash
  115. %ifarch i386 i486 i586 i686 x86_64
  116. %files gui
  117. %defattr(-,root,root)
  118. %{_bindir}/mlgui
  119. %endif
  120. %if "%{_prova}" == "1"
  121. %files init
  122. %defattr(-,root,root)
  123. %doc Copying.txt
  124. %config(noreplace) %{_sysconfdir}/sysconfig/mldonkey
  125. %config(noreplace) %{_initrddir}/mldonkey
  126. %attr(700,mldonkey,mldonkey) %dir /var/lib/mldonkey/incoming
  127. %attr(700,mldonkey,mldonkey) %dir /var/cache/mldonkey
  128. %attr(700,mldonkey,mldonkey) %dir /var/lib/mldonkey
  129. %files ed2k_submit
  130. %defattr(-,root,root)
  131. %doc Copying.txt
  132. %config(noreplace) %{_sysconfdir}/sysconfig/mldonkey_submit
  133. %{_bindir}/mldonkey_submit
  134. %{_datadir}/services/ed2k.protocol
  135. %endif
  136. %changelog
  137. * Thu Dec 23 2009 - hillwood <hillwood at linuxfans.org> 3.0.1
  138. - update to version 3.0.1
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表