我环顾四周,但同样的错误信息的答案都没有在我的简单包中运行...我在Redhat ES 6上使用rpmbuild构建rpm,无论我在我的spec文件中做了什么,我都得到了相同的结果结果。预先感谢您的帮助。
这是我的spec文件:
Name: package
Version: 3.2.5
Release: redhat
Summary: Company package gateway pos server
Group: Engineering
License: Company LLC - owned
URL: http://www.company.com
Source: %{name}.tar.gz
%description
The Company package gateway server provides a key component in the Company system architecture which passes information between the clients and the API.
%prep
%setup -n %{name}
%build
%define debug_package %{nil}
%install
mkdir -p $RPM_BUILD_ROOT/srv/package/gateways/config
mkdir -p $RPM_BUILD_ROOT/srv/package/gateways/logs
install -m 700 gateway $RPM_BUILD_ROOT/srv/package/
install -m 700 gatewayclient.conf $RPM_BUILD_ROOT/srv/package/
install -m 700 gateway.conf $RPM_BUILD_ROOT/srv/package/
install -m 700 rules.conf $RPM_BUILD_ROOT/srv/package/
install -m 700 gatewaytest.conf $RPM_BUILD_ROOT/srv/package/
install -m 700 gateways/bci.exe $RPM_BUILD_ROOT/srv/package/gateways/
install -m 700 gateways/config/bci_iso8583.conf $RPM_BUILD_ROOT/srv/package/gateways/config/
%post
%clean
rm -rf %{buildroot}
rm -rf $RPM_BUILD_ROOT
rm -rf %{_tmppath/%{name}
rm -rf %{_topdir}/BUILD%{name}
%files -f %{name}.lang
%defattr(-,root,root,-)
/srv/
/srv/package/
/srv/package/gateways/
/srv/package/gateways/logs/
/srv/package/gateways/config/
/srv/package/gateway
/srv/package/gatewayclient.conf
/srv/package/gateway.conf
/srv/package/gatewaytest.conf
/srv/package/rules.conf
/srv/package/gateways/bci.exe
/srv/package/gateways/config/bci_iso8583.conf
%changelog
* Thurs May 09 2013 Owner
- 1.0 r1 First release
错误信息在这里:
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/rpmbuild/rpmbuild/BUILDROOT/package-3.2.5-redhat.x86_64
error: Installed (but unpackaged) file(s) found:
/srv/package/gateways/bci.exe
/srv/package/gateways/config/bci_iso8583.conf
/srv/package/gateway
/srv/package/gateway.conf
/srv/package/gatewayclient.conf
/srv/package/gatewaytest.conf
/srv/package/rules.conf
RPM build errors:
Installed (but unpackaged) file(s) found:
/srv/package/gateways/bci.exe
/srv/package/gateways/config/bci_iso8583.conf
/srv/package/gateway
/srv/package/gateway.conf
/srv/package/gatewayclient.conf
/srv/package/gatewaytest.conf
/srv/package/rules.conf
版本 - Reran提供以下建议并获得以下结果:
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/rpmbuild/rpmbuild/BUILDROOT/package-3.2.5-redhat.x86_64
error: Installed (but unpackaged) file(s) found:
/srv/package/gateways/bci.exe
/srv/package/gateways/config/bci_iso8583.conf
/srv/package/gateway
/srv/package/gateway.conf
/srv/package/gatewayclient.conf
/srv/package/gatewaytest.conf
/srv/package/rules.conf
RPM build errors:
Installed (but unpackaged) file(s) found:
/srv/package/gateways/bci.exe
/srv/package/gateways/config/bci_iso8583.conf
/srv/package/gateway
/srv/package/gateway.conf
/srv/package/gatewayclient.conf
/srv/package/gatewaytest.conf
/srv/package/rules.conf
答案 0 :(得分:6)
尝试更改%files
部分:
%defattr(-,root,root,-)
# Don't own /srv/, but own directories:
%dir /srv/package/
%dir /srv/package/gateways/
%dir /srv/package/gateways/logs/
%dir /srv/package/gateways/config/
# Everything in those directories:
# (lazy way instead of specifying each file)
/srv/package
如上所述,您不希望自己拥有“/srv/
”。如果这不起作用,我无法解释为什么有些内容与您列出的相同,但是“gatewaygw*
”需要通过脚本从目标根包含或删除。
答案 1 :(得分:0)
您将-f %{name}.lang
参数传递给%files
,但您似乎没有调用%find_lang
或发送/ usr / share / locale中的任何文件。如果您不调用%find_lang
,则RPM不会创建包含翻译文件列表的%{name}.lang
文件。 -f
的{{1}}参数只是使RPM在构建时将该文件的内容添加到%files
;如果该文件不存在则完全没有必要。不幸的是,如果该文件不存在,它似乎也会破坏RPM。
因此,只需从%files
中删除-f
参数即可。
答案 2 :(得分:0)
我最新的SPEC文件:
Name: package
Version: 3.2.5
Release: redhat
Summary: company package gateway pos server
Group: Engineering
License: company LLC - owned
URL: http://www.company.com
Source: %{name}.tar.gz
%description
The company package gateway server provides a key component in the company system architecture which passes information between the clients and the API.
%prep
%setup -n %{name}
%build
%define debug_package %{nil}
%install
mkdir -p $RPM_BUILD_ROOT/srv/package/gateways/config
mkdir -p $RPM_BUILD_ROOT/srv/package/gateways/logs
install -m 700 package $RPM_BUILD_ROOT/srv/package/
install -m 700 packageclient.conf $RPM_BUILD_ROOT/srv/package/
install -m 700 package.conf $RPM_BUILD_ROOT/srv/package/
install -m 700 rules.conf $RPM_BUILD_ROOT/srv/package/
install -m 700 packagetest.conf $RPM_BUILD_ROOT/srv/package/
install -m 700 gateways/bci.exe $RPM_BUILD_ROOT/srv/package/gateways/
install -m 700 gateways/config/bci_iso8583.conf $RPM_BUILD_ROOT/srv/package/gateways/config/
%post
%clean
rm -rf %{buildroot}
rm -rf $RPM_BUILD_ROOT
rm -rf %{_tmppath/%{name}
rm -rf %{_topdir}/BUILD%{name}
%files
%defattr(-,root,root,-)
%dir /srv/package/
%dir /srv/package/gateways/
%dir /srv/package/gateways/logs/
%dir /srv/package/gateways/config/
bci.exe
bci_iso8583.conf
package
package.conf
packageclient.conf
packagetest.conf
rules.conf
%changelog
* Thurs May 09 2013 Todd McGuinness
- 1.0 r1 First release