tingxx 发表于 2004-11-24 19:12:35

请教这个spec有什么问题??

Name:kdocker
Summary:KDocker will help you dock any application in the system tray
Version:1.0rc2
Release:1mgc
Group:Applications/System
License:GPL
Source:%{name}-%{version}.tar.bz2
BuildRoot:%{_tmppath}/%{name}-%{version}-%{release}-root
URL:http:://kdocker.sourceforge.net
Prefix:%{_sysconfdir}
Requires: qt
Packager:tingxx<[email protected]>
%description
Docker will help you dock any application in the system tray. This means you
can dock openoffice, xmms, firefox, thunderbolt, eclipse, anything! Just point
and click. Works for both KDE and GNOME (In fact it should work for most modern
window managers that support NET WM Specification. I believe it works for XFCE,
for instance).
%prep
%setup -n %{name}
qmake
%build
make
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=%{_prefix} install

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
%post
%files
%defattr(-,root,root)
%{_bindir}
%{_datadir}


%changelog



打包的是一个基于qmake的程序,最后的结果总是
Processing files: kdocker-1.0rc2-1mgc
error: File not found: /var/tmp/kdocker-1.0rc2-1mgc-root/usr/bin
error: File not found: /var/tmp/kdocker-1.0rc2-1mgc-root/usr/share
Processing files: kdocker-debuginfo-1.0rc2-1mgc


RPM build errors:
    File not found: /var/tmp/kdocker-1.0rc2-1mgc-root/usr/bin
    File not found: /var/tmp/kdocker-1.0rc2-1mgc-root/usr/share

ygw_ycf 发表于 2004-11-24 21:58:12

删除
%{_bindir}
%{_datadir}
or
前面安装阶段加入
建立/usr/bin /usr/share 命令 (如,mkdir -p %{-buildroot}/usr/bin /usr/share具体我也不清楚--我比你还菜)

以上仅为我的猜测,我是以置顶贴“rpm建包原理”理解(%files #本节定义哪些文件、目录将被打进 rpm 包里。如果你认为哪些文件不必打进 rpm 包里(一般是 debug、src 和 devel 文件、目录),你就不要列在这里,或者使用 %exclude 关键字指明哪些文件不打进 rpm 包里。你甚至可以在 spec 文件的其他字段安装或者删除一些特定的文件,这就是比较复杂的技术了。但是如何才能知道到底软件向系统内安装了哪些目录和文件呢?这个问题有点复杂。参见[注4]。注意:此处系统的当前路径指的就是虚拟的根目录。所以虚拟的根目录路径(例如 /var/tmp/cce-0.51-1mgc-root/)不要写在这里。应该直接用类似 %{_bindir} 的宏(表示 /usr/bin ) 来指定包含的目录,也可以单独指定一个或一组文件。),既然file段指定的东东没有,要么删除,要么加入。可以试一试!

tingxx 发表于 2004-11-24 22:06:43

这个问题我倒是没有想到,试一试去

KanKer 发表于 2004-11-24 23:16:35

首先,你要看该软件的安装说明,若是configure;make;make install即可安装。你那样写只要在make前加上%configure即可。
若软件不支持make install,则你必须自行在%install段里写安装语句。如:
要把aaa安装到/usr/bin下:
mkdir -p $RPM_BUILD_ROOT/usr/bin
install -m 755 aaa$RPM_BUILD_ROOT/usr/bin

其他仿此。

ygw_ycf 发表于 2004-11-24 23:32:14

对rpm建包的理解有加深了一步,谢谢老大!

tingxx 发表于 2004-11-25 12:52:25

谢谢KanKer

KDE 发表于 2004-11-25 22:14:51

Re: 请教这个spec有什么问题??

Name:kdocker
Summary:KDocker will help you dock any application in the system tray
Version:1.0rc2
Release:1mgc
Group:Applications/System
License:GPL
Source:%{name}-%{version}.tar.bz2
BuildRoot:%{_tmppath}/%{name}-%{version}-%{release}-root
URL:http:://kdocker.sourceforge.net <--怎么有两个冒号?
Prefix:%{_sysconfdir}<--你的软件难道要安装到 /usr/etc 下面?
Requires: qt <--只需要 qt?至少还需要 XFree86 吧?
Packager:tingxx<[email protected]>
%description
Docker will help you dock any application in the system tray. This means you
can dock openoffice, xmms, firefox, thunderbolt, eclipse, anything! Just point
and click. Works for both KDE and GNOME (In fact it should work for most modern
window managers that support NET WM Specification. I believe it works for XFCE,
for instance).
%prep
%setup -n %{name}
qmake <--这里通常都是 %configure + 参数,很少有软件不需要配置,你先看看软件的 install 文件里的说明
%build
make <--按你的意思,这里应该用 qmake
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=%{_prefix} install <-- 对不起,是我的疏忽误导了你,应该是 make DESTDIR=$RPM_BUILD_ROOT install

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
%post
%files
%defattr(-,root,root)
%{_bindir}
%{_datadir}
<--你确信软件向系统内的 /usr/bin 和 /usr/share 安装文件?你在前面可是指定把所有东西都安装到 /usr/etc 下面了。


%changelog
<--这里为什么不写日志?


打包的是一个基于qmake的程序,最后的结果总是
Processing files: kdocker-1.0rc2-1mgc
error: File not found: /var/tmp/kdocker-1.0rc2-1mgc-root/usr/bin
error: File not found: /var/tmp/kdocker-1.0rc2-1mgc-root/usr/share
Processing files: kdocker-debuginfo-1.0rc2-1mgc


RPM build errors:
    File not found: /var/tmp/kdocker-1.0rc2-1mgc-root/usr/bin
    File not found: /var/tmp/kdocker-1.0rc2-1mgc-root/usr/share

tingxx 发表于 2004-11-27 08:53:06

对不起,我竟然犯了这么多错误。谢谢kde的教导 :oops:
页: [1]
查看完整版本: 请教这个spec有什么问题??