|
发表于 2010-12-18 19:41:41
|
显示全部楼层
rpm 建包原理:http://www.linuxfans.org/bbs/thread-86980-1-1.html
一个mldonkey的spec文档内容,可参考:- %define sourcename mldonkey
- %define _prova 0
- Name: MLDonkey
- Summary: Filesharing client for eDonkey 2000 and other P2P systems
- Version: 3.0.1
- Release: 1
- License: Other License(s), see package, GPL
- Group: Productivity/Networking/Other
- Autoreqprov: on
- URL: http://mldonkey.sourceforge.net/Main_Page
- Source0: http://mesh.dl.sourceforge.net/sourceforge/mldonkey/%{sourcename}-%{version}.tar.bz2
- Source1: %{sourcename}-gtk2gui-2.5-30-1.shared.i386-Linux.tar.bz2
- BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
- BuildRequires: gcc gcc-c++ perl python-numeric wget qt3-devel libcrypto++0-devel
- BuildRequires: ocaml camlp4 zlib-devel glibc-devel lablgtk2-devel libGeoIP-devel
- %if %suse_version > 1020
- BuildRequires: libbz2-devel
- %endif
- %if %suse_version == 1010
- BuildRequires: avahi-compat-mDNSResponder
- %endif
- BuildRequires: gd-devel libpng-devel libjpeg-devel file-devel ncurses-devel
- Requires: perl ocaml camlp4 wget gd file ncurses GeoIP
- Obsoletes: MLDonkey-init
- %description
- mldonkey is a peer-to-peer filesharing client originally developed for
- use with the eDonkey system that also supports Limewire, OpenNap,
- AudioGalaxy and other P2P systems. The actual client and the user
- interface are completely separated and can thus be executed on
- different machines. A web interface is available as well.
- %ifarch i386 i486 i586 i686 x86_64
- %package gui
- Summary: gtk2 GUI for mldonkey
- Group: Productivity/Networking/Other
- Requires: %{name}
- %description gui
- mldonkey gtk2 GUI
- %endif
- %if "%{_prova}" == "1"
- %package init
- Summary: Init to launch mldonkey
- Group: Productivity/Networking/Other
- Requires: %{name}
- PreReq: pwdutils
- %description init
- This package contains init to launch mldonkey as a service
- %package ed2k_submit
- Summary: This tool gives you an easy way to add a ed2k-link
- Group: Productivity/Networking/Other
- Requires: perl-libwww-perl
- %description ed2k_submit
- This tool gives you an easy way to add a ed2k-link
- (like ed2k://|file|filename.exe|21352658|72b0b287cab7d875ccc1d89ebe910b9g|)
- with a single click to your mldonkey download queue.
- You need to edit /etc/sysconfig/mldonkey_submit
- %endif
- %prep
- %setup -q -n %{sourcename}-%{version}
- %configure \
- --enable-gnutella \
- --enable-gnutella2
- # --enable-gui=newgui2
- %build
- gmake
- make utils
- %install
- %makeinstall
- # core
- install -m 755 distrib/mldonkey_command %{buildroot}%{_bindir}/mldonkey_command
- install -m 755 distrib/kill_mldonkey %{buildroot}%{_bindir}/kill_mldonkey
- install -m 755 make_torrent %{buildroot}%{_bindir}/make_torrent
- install -m 755 mld_hash %{buildroot}%{_bindir}/mld_hash
- %if "%{_prova}" == "1"
- # init
- install -d -m 755 %{buildroot}%{_initrddir}
- install -d -m 755 %{buildroot}/var/lib/mldonkey
- install -d -m 755 %{buildroot}/var/cache/mldonkey
- install -d -m 755 %{buildroot}/var/lib/mldonkey/incoming
- install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
- install -m 755 packages/rpm/mldonkey.init %{buildroot}%{_initrddir}/mldonkey
- install -m 644 packages/rpm/mldonkey.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/mldonkey
- # ed2k_submit
- install -d -m 755 %{buildroot}%{_datadir}/services/
- install -m 755 distrib/ed2k_submit/mldonkey_submit %{buildroot}%{_bindir}/mldonkey_submit
- install -m 644 distrib/ed2k_submit/mldonkey %{buildroot}%{_sysconfdir}/sysconfig/mldonkey_submit
- install -m 644 distrib/ed2k_submit/ed2k.protocol %{buildroot}%{_datadir}/services/ed2k.protocol
- %endif
- #gui
- %ifarch i386 i486 i586 i686 x86_64
- pushd $RPM_BUILD_ROOT%{_bindir}/
- %__tar xjvf "%{SOURCE1}"
- popd
- %endif
- %if "%{_prova}" == "1"
- %pre init
- useradd mldonkey
- %postun init
- userdel mldonkey
- %endif
- %clean
- rm -fr %buildroot
- %files
- %defattr(-,root,root)
- %doc ChangeLog Copying.txt
- %{_bindir}/mlnet
- %{_bindir}/mldonkey_command
- %{_bindir}/kill_mldonkey
- %{_bindir}/mlbt
- %{_bindir}/mldc
- %{_bindir}/mldonkey
- %{_bindir}/mlgnut
- %{_bindir}/mlslsk
- %{_bindir}/make_torrent
- %{_bindir}/mld_hash
- %ifarch i386 i486 i586 i686 x86_64
- %files gui
- %defattr(-,root,root)
- %{_bindir}/mlgui
- %endif
- %if "%{_prova}" == "1"
- %files init
- %defattr(-,root,root)
- %doc Copying.txt
- %config(noreplace) %{_sysconfdir}/sysconfig/mldonkey
- %config(noreplace) %{_initrddir}/mldonkey
- %attr(700,mldonkey,mldonkey) %dir /var/lib/mldonkey/incoming
- %attr(700,mldonkey,mldonkey) %dir /var/cache/mldonkey
- %attr(700,mldonkey,mldonkey) %dir /var/lib/mldonkey
- %files ed2k_submit
- %defattr(-,root,root)
- %doc Copying.txt
- %config(noreplace) %{_sysconfdir}/sysconfig/mldonkey_submit
- %{_bindir}/mldonkey_submit
- %{_datadir}/services/ed2k.protocol
- %endif
- %changelog
- * Thu Dec 23 2009 - hillwood <hillwood at linuxfans.org> 3.0.1
- - update to version 3.0.1
复制代码 |
|