How do you use rpmbuild to make an rpm package when there are file not found or permission errors?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am trying to create an RPM file for the wget utility. Both of my attempts (with sudo and without sudo) to use the rpmbuild comman fail to create an .rpm file.
I run a "sudo rpmbuild" command to use a spec file. But I get these errors:
error: File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/bin/wget error:
File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/share/man/man1/wget.1
If I manually create the directory paths and manually copy the files, I run into other problems down the road. I think something is wrong if the rpmbuild command expects key files to be in the locations above.
I read it was recommended to not use sudo. When I do not use sudo, the rpmbuild command (rpmbuild -v -bb --clean SPECS/wget.spec
) shows this:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.NiuIFV
+ umask 022
+ cd /home/ec2-user/mywget/BUILD
+ cd /home/ec2-user/mywget/BUILD
+ rm -rf wget-1.19 rm: cannot remove 'wget-1.19/po/en@boldquot.header': Permission denied rm: cannot remove
'wget-1.19/po/zh_CN.po': Permission denied rm: cannot remove
'wget-1.19/po/id.gmo': Permission denied rm: cannot remove
'wget-1.19/po/gl.gmo': Permission denied ...
I see other "rm cannot remove ... Permission denied" lines. I expected the rpmbuild command to work. I have changed the permissions of the wget-1.19 folder to be 777 (via sudo chmod) with the owner and group being identical to the user running the rpmbuild command. I still had the problem.
What can I do to create an RPM package of the wget utility?
# This is a sample spec file for wget
%define _topdir /home/ec2-user/mywget
%define name wget
%define release 1
%define version 1.19
%define buildroot %_topdir/%name-%version-root
BuildRoot: %buildroot
Summary: GNU wget
License: GPL
Name: %name
Version: %version
Release: %release
Source: %name-%version.tar.gz
Prefix: /usr
Group: Development/Tools
%description
The GNU wget program downloads files from the Internet using the command-line.
%prep
%setup -q
%build
./configure
make
%install
make install prefix=$RPM_BUILD_ROOT/usr
%files
%defattr(-,root,root)
/usr/local/bin/wget
%doc %attr(0444,root,root) /usr/local/share/man/man1/wget.1
The above was modified but heavily based on the spec file example here: https://www.ibm.com/developerworks/library/l-rpm1/index.html
rpm rpmbuild rpm-spec
add a comment |Â
up vote
0
down vote
favorite
I am trying to create an RPM file for the wget utility. Both of my attempts (with sudo and without sudo) to use the rpmbuild comman fail to create an .rpm file.
I run a "sudo rpmbuild" command to use a spec file. But I get these errors:
error: File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/bin/wget error:
File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/share/man/man1/wget.1
If I manually create the directory paths and manually copy the files, I run into other problems down the road. I think something is wrong if the rpmbuild command expects key files to be in the locations above.
I read it was recommended to not use sudo. When I do not use sudo, the rpmbuild command (rpmbuild -v -bb --clean SPECS/wget.spec
) shows this:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.NiuIFV
+ umask 022
+ cd /home/ec2-user/mywget/BUILD
+ cd /home/ec2-user/mywget/BUILD
+ rm -rf wget-1.19 rm: cannot remove 'wget-1.19/po/en@boldquot.header': Permission denied rm: cannot remove
'wget-1.19/po/zh_CN.po': Permission denied rm: cannot remove
'wget-1.19/po/id.gmo': Permission denied rm: cannot remove
'wget-1.19/po/gl.gmo': Permission denied ...
I see other "rm cannot remove ... Permission denied" lines. I expected the rpmbuild command to work. I have changed the permissions of the wget-1.19 folder to be 777 (via sudo chmod) with the owner and group being identical to the user running the rpmbuild command. I still had the problem.
What can I do to create an RPM package of the wget utility?
# This is a sample spec file for wget
%define _topdir /home/ec2-user/mywget
%define name wget
%define release 1
%define version 1.19
%define buildroot %_topdir/%name-%version-root
BuildRoot: %buildroot
Summary: GNU wget
License: GPL
Name: %name
Version: %version
Release: %release
Source: %name-%version.tar.gz
Prefix: /usr
Group: Development/Tools
%description
The GNU wget program downloads files from the Internet using the command-line.
%prep
%setup -q
%build
./configure
make
%install
make install prefix=$RPM_BUILD_ROOT/usr
%files
%defattr(-,root,root)
/usr/local/bin/wget
%doc %attr(0444,root,root) /usr/local/share/man/man1/wget.1
The above was modified but heavily based on the spec file example here: https://www.ibm.com/developerworks/library/l-rpm1/index.html
rpm rpmbuild rpm-spec
hard to say without seeing the contents of yourwget.spec
where did that file come from and how did you modify it?
â thrig
Nov 29 '17 at 2:00
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to create an RPM file for the wget utility. Both of my attempts (with sudo and without sudo) to use the rpmbuild comman fail to create an .rpm file.
I run a "sudo rpmbuild" command to use a spec file. But I get these errors:
error: File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/bin/wget error:
File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/share/man/man1/wget.1
If I manually create the directory paths and manually copy the files, I run into other problems down the road. I think something is wrong if the rpmbuild command expects key files to be in the locations above.
I read it was recommended to not use sudo. When I do not use sudo, the rpmbuild command (rpmbuild -v -bb --clean SPECS/wget.spec
) shows this:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.NiuIFV
+ umask 022
+ cd /home/ec2-user/mywget/BUILD
+ cd /home/ec2-user/mywget/BUILD
+ rm -rf wget-1.19 rm: cannot remove 'wget-1.19/po/en@boldquot.header': Permission denied rm: cannot remove
'wget-1.19/po/zh_CN.po': Permission denied rm: cannot remove
'wget-1.19/po/id.gmo': Permission denied rm: cannot remove
'wget-1.19/po/gl.gmo': Permission denied ...
I see other "rm cannot remove ... Permission denied" lines. I expected the rpmbuild command to work. I have changed the permissions of the wget-1.19 folder to be 777 (via sudo chmod) with the owner and group being identical to the user running the rpmbuild command. I still had the problem.
What can I do to create an RPM package of the wget utility?
# This is a sample spec file for wget
%define _topdir /home/ec2-user/mywget
%define name wget
%define release 1
%define version 1.19
%define buildroot %_topdir/%name-%version-root
BuildRoot: %buildroot
Summary: GNU wget
License: GPL
Name: %name
Version: %version
Release: %release
Source: %name-%version.tar.gz
Prefix: /usr
Group: Development/Tools
%description
The GNU wget program downloads files from the Internet using the command-line.
%prep
%setup -q
%build
./configure
make
%install
make install prefix=$RPM_BUILD_ROOT/usr
%files
%defattr(-,root,root)
/usr/local/bin/wget
%doc %attr(0444,root,root) /usr/local/share/man/man1/wget.1
The above was modified but heavily based on the spec file example here: https://www.ibm.com/developerworks/library/l-rpm1/index.html
rpm rpmbuild rpm-spec
I am trying to create an RPM file for the wget utility. Both of my attempts (with sudo and without sudo) to use the rpmbuild comman fail to create an .rpm file.
I run a "sudo rpmbuild" command to use a spec file. But I get these errors:
error: File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/bin/wget error:
File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/share/man/man1/wget.1
If I manually create the directory paths and manually copy the files, I run into other problems down the road. I think something is wrong if the rpmbuild command expects key files to be in the locations above.
I read it was recommended to not use sudo. When I do not use sudo, the rpmbuild command (rpmbuild -v -bb --clean SPECS/wget.spec
) shows this:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.NiuIFV
+ umask 022
+ cd /home/ec2-user/mywget/BUILD
+ cd /home/ec2-user/mywget/BUILD
+ rm -rf wget-1.19 rm: cannot remove 'wget-1.19/po/en@boldquot.header': Permission denied rm: cannot remove
'wget-1.19/po/zh_CN.po': Permission denied rm: cannot remove
'wget-1.19/po/id.gmo': Permission denied rm: cannot remove
'wget-1.19/po/gl.gmo': Permission denied ...
I see other "rm cannot remove ... Permission denied" lines. I expected the rpmbuild command to work. I have changed the permissions of the wget-1.19 folder to be 777 (via sudo chmod) with the owner and group being identical to the user running the rpmbuild command. I still had the problem.
What can I do to create an RPM package of the wget utility?
# This is a sample spec file for wget
%define _topdir /home/ec2-user/mywget
%define name wget
%define release 1
%define version 1.19
%define buildroot %_topdir/%name-%version-root
BuildRoot: %buildroot
Summary: GNU wget
License: GPL
Name: %name
Version: %version
Release: %release
Source: %name-%version.tar.gz
Prefix: /usr
Group: Development/Tools
%description
The GNU wget program downloads files from the Internet using the command-line.
%prep
%setup -q
%build
./configure
make
%install
make install prefix=$RPM_BUILD_ROOT/usr
%files
%defattr(-,root,root)
/usr/local/bin/wget
%doc %attr(0444,root,root) /usr/local/share/man/man1/wget.1
The above was modified but heavily based on the spec file example here: https://www.ibm.com/developerworks/library/l-rpm1/index.html
rpm rpmbuild rpm-spec
edited Nov 29 '17 at 2:39
asked Nov 29 '17 at 0:52
Jermoe
214
214
hard to say without seeing the contents of yourwget.spec
where did that file come from and how did you modify it?
â thrig
Nov 29 '17 at 2:00
add a comment |Â
hard to say without seeing the contents of yourwget.spec
where did that file come from and how did you modify it?
â thrig
Nov 29 '17 at 2:00
hard to say without seeing the contents of your
wget.spec
where did that file come from and how did you modify it?â thrig
Nov 29 '17 at 2:00
hard to say without seeing the contents of your
wget.spec
where did that file come from and how did you modify it?â thrig
Nov 29 '17 at 2:00
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
This error:
error: File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/bin/wget
means that you specified this file in %files section:
%files
/usr/local/bin/wget
so rpmbuild is expecting this file in $RPM_BUILD_ROOT/usr/local/bin/wget path but it is not there. Therefore this error. Vice versa for the man page.
You can run rpmbuild -bi
which will stop just after %install
phase and you can check the content of /root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/ where the make install
actually put the files.
I guess that either
%install
make install prefix=$RPM_BUILD_ROOT/usr/local
or
%files
%defattr(-,root,root)
/usr/bin/wget
%doc %attr(0444,root,root) /usr/share/man/man1/wget.1
will fix your error. (just one of those!)
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
This error:
error: File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/bin/wget
means that you specified this file in %files section:
%files
/usr/local/bin/wget
so rpmbuild is expecting this file in $RPM_BUILD_ROOT/usr/local/bin/wget path but it is not there. Therefore this error. Vice versa for the man page.
You can run rpmbuild -bi
which will stop just after %install
phase and you can check the content of /root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/ where the make install
actually put the files.
I guess that either
%install
make install prefix=$RPM_BUILD_ROOT/usr/local
or
%files
%defattr(-,root,root)
/usr/bin/wget
%doc %attr(0444,root,root) /usr/share/man/man1/wget.1
will fix your error. (just one of those!)
add a comment |Â
up vote
1
down vote
This error:
error: File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/bin/wget
means that you specified this file in %files section:
%files
/usr/local/bin/wget
so rpmbuild is expecting this file in $RPM_BUILD_ROOT/usr/local/bin/wget path but it is not there. Therefore this error. Vice versa for the man page.
You can run rpmbuild -bi
which will stop just after %install
phase and you can check the content of /root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/ where the make install
actually put the files.
I guess that either
%install
make install prefix=$RPM_BUILD_ROOT/usr/local
or
%files
%defattr(-,root,root)
/usr/bin/wget
%doc %attr(0444,root,root) /usr/share/man/man1/wget.1
will fix your error. (just one of those!)
add a comment |Â
up vote
1
down vote
up vote
1
down vote
This error:
error: File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/bin/wget
means that you specified this file in %files section:
%files
/usr/local/bin/wget
so rpmbuild is expecting this file in $RPM_BUILD_ROOT/usr/local/bin/wget path but it is not there. Therefore this error. Vice versa for the man page.
You can run rpmbuild -bi
which will stop just after %install
phase and you can check the content of /root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/ where the make install
actually put the files.
I guess that either
%install
make install prefix=$RPM_BUILD_ROOT/usr/local
or
%files
%defattr(-,root,root)
/usr/bin/wget
%doc %attr(0444,root,root) /usr/share/man/man1/wget.1
will fix your error. (just one of those!)
This error:
error: File not found:
/root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/bin/wget
means that you specified this file in %files section:
%files
/usr/local/bin/wget
so rpmbuild is expecting this file in $RPM_BUILD_ROOT/usr/local/bin/wget path but it is not there. Therefore this error. Vice versa for the man page.
You can run rpmbuild -bi
which will stop just after %install
phase and you can check the content of /root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/ where the make install
actually put the files.
I guess that either
%install
make install prefix=$RPM_BUILD_ROOT/usr/local
or
%files
%defattr(-,root,root)
/usr/bin/wget
%doc %attr(0444,root,root) /usr/share/man/man1/wget.1
will fix your error. (just one of those!)
answered Nov 29 '17 at 12:53
msuchy
74135
74135
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407624%2fhow-do-you-use-rpmbuild-to-make-an-rpm-package-when-there-are-file-not-found-or%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
hard to say without seeing the contents of your
wget.spec
where did that file come from and how did you modify it?â thrig
Nov 29 '17 at 2:00