user1285928
user1285928

Reputation: 1476

Installed (but unpackaged) file(s) found

I want to create RPM package using this spec file:

Name: some-agent
Version: 1.0
Release: 1%{?dist}
Summary: Linux Agent installation script

Group: Utilities
License: license

Source0: some-agent-1.0.tar.gz
BuildArch: x86_64
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)


%description

%prep

%build
%install
mkdir -p %{buildroot}/opt/agent
#install -m 0755 -d $RPM_BUILD_ROOT/opt/agent
cp -a * %{buildroot}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%dir 
/opt/agent

%defattr(-,root,root,-)
%doc
%changelog

I run this command:

user@laptop ~]$ 
[user@laptop ~]$ rpmbuild -bb -v ~/rpm/SPECS/kernel.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.f1O2AV
+ umask 022
+ cd /home/rcbandit/rpm/BUILD
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.ozgVAb
+ umask 022
+ cd /home/rcbandit/rpm/BUILD
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.SrwYCr
+ umask 022
+ cd /home/rcbandit/rpm/BUILD
+ mkdir -p /home/rcbandit/rpm/BUILDROOT/some-agent-1.0-1.el6.x86_64/opt/agent
+ cp -a some-agent-1.0.tar.gz /home/rcbandit/rpm/BUILDROOT/some-agent-1.0-1.el6.x86_64
+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
Processing files: some-agent-1.0-1.el6.x86_64
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/rcbandit/rpm/BUILDROOT/some-agent-1.0-1.el6.x86_64
error: Installed (but unpackaged) file(s) found:
   /some-agent-1.0.tar.gz


RPM build errors:
    Installed (but unpackaged) file(s) found:
   /some-agent-1.0.tar.gz
[user@laptop ~]$ ^C
[user@laptop ~]$ 

I have a Java files into the tar.gz packages so I don't need any compilation, just to extract the files into the destination directory.

Can you help me to fix this problem?

Upvotes: 1

Views: 3303

Answers (1)

Aaron D. Marasco
Aaron D. Marasco

Reputation: 6748

You need to extract those files in your (currently empty) %build section, and then copy them in the %install section to the target location under %{buildroot}. There are many primers available on the web.

Upvotes: 1

Related Questions