Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPM build fails on Kubuntu 11.04 #4

Closed
randomcoder opened this issue Jan 31, 2012 · 9 comments
Closed

RPM build fails on Kubuntu 11.04 #4

randomcoder opened this issue Jan 31, 2012 · 9 comments

Comments

@randomcoder
Copy link

When attempting to build an RPM release I get the following error output

[error] + umask 022
[error] + cd /home/me/development/project/target/rpm/BUILD
[error] + [ -e /home/me/development/project/target/rpm/buildroot ]
[error] + mv /home/me/development/project/target/rpm/tmp-buildroot/* /home/me/development/project/target/rpm/buildroot
[error] mv: cannot stat `/home/me/development/project/target/rpm/tmp-buildroot/*': No such file or directory

The rpmbuild command used is

Executing rpmbuild with: rpmbuild -bb --buildroot /home/me/development/project/target/rpm/buildroot --define _topdir /home/me/development/project/target/rpm --target noarch-us-Linux project.spec

and the generated spec file is:

Name: Project
Version: 1.0.0
Release: 1
Summary: Provides a capability to run Stuff
License: Ours
Vendor: Us
URL: http://git/gitweb/project.git
Requires: java-1.6.0-openjdk
BuildRoot: /home/me/development/project/target/rpm/buildroot

%description



%install
if [ -e $RPM_BUILD_ROOT ]; then
  mv /home/me/development/project/target/rpm/tmp-buildroot/* $RPM_BUILD_ROOT
else
  mv /home/me/development/project/target/rpm/tmp-buildroot $RPM_BUILD_ROOT
fi

%files
%attr(0644,root,root) /usr/share/lib/project/mylibrary.jar

I have rpm and rpmbuild available on my system.

@jsuereth
Copy link
Member

I've seen this as well. Which version of rpmbuild are you using? I'd
hazard to guess 4.9.x or earlier.

I should have a fix later this week.
On Jan 31, 2012 9:14 AM, "Random Coder" <
[email protected]>
wrote:

When attempting to build an RPM release I get the following error output

[error] + umask 022
[error] + cd /home/me/development/project/target/rpm/BUILD
[error] + [ -e /home/me/development/project/target/rpm/buildroot ]
[error] + mv /home/me/development/project/target/rpm/tmp-buildroot/*
/home/me/development/project/target/rpm/buildroot
[error] mv: cannot stat
`/home/me/development/project/target/rpm/tmp-buildroot/*': No such file or
directory

The rpmbuild command used is

Executing rpmbuild with: rpmbuild -bb --buildroot
/home/me/development/project/target/rpm/buildroot --define _topdir
/home/me/development/project/target/rpm --target noarch-us-Linux
project.spec

and the generated spec file is:

Name: Project
Version: 1.0.0
Release: 1
Summary: Provides a capability to run Stuff
License: Ours
Vendor: Us
URL: http://git/gitweb/project.git
Requires: java-1.6.0-openjdk
BuildRoot: /home/me/development/project/target/rpm/buildroot

%description



%install
if [ -e $RPM_BUILD_ROOT ]; then
 mv /home/me/development/project/target/rpm/tmp-buildroot/* $RPM_BUILD_ROOT
else
 mv /home/me/development/project/target/rpm/tmp-buildroot $RPM_BUILD_ROOT
fi

%files
%attr(0644,root,root) /usr/share/lib/project/mylibrary.jar

I have rpm and rpmbuild available on my system.


Reply to this email directly or view it on GitHub:
#4

@randomcoder
Copy link
Author

You're correct, version 4.8.1

@jsuereth
Copy link
Member

jsuereth commented Feb 2, 2012

Hmm, my most recent patch for ubuntu (rpmbuild 4.9) appears to work again. I'm going to watch this issue, because i think something odd is causing it.

@randomcoder
Copy link
Author

As a workaround, is it not possible to remove the buildroot directory and then simply move the tmp-buildroot in all cases? This would resolve the immediate problem, but I don't know how many people would be putting additional files into the buildroot to modify their RPM.

@Dremora
Copy link
Contributor

Dremora commented Jun 29, 2012

mv fails because tmp-buildroot is empty. In my case it's empty because I've specified only directories in packageMappings, but RpmHelper ensures that the file is not a directory before copying it.

@jsuereth
Copy link
Member

Ah, good catch there. I can fix that.

jsuereth added a commit that referenced this issue Jul 2, 2012
Related to a report in #4 about directory-only packages.
@Dremora
Copy link
Contributor

Dremora commented Jul 3, 2012

Just in case, the directory I've specified in package mapping was not empty. I've assumed that it'll be copied recursively to the package.

linuxPackageMappings <+= target map { target =>
  val src = target / "webapp"
  val dest = "/opt/app"
  packageMapping(src -> dest)
}

This code doesn't work as expected (well, by me) with either Debian or RPM packages.

My way of dealing with it:

linuxPackageMappings <+= target map { target =>
  val src = target / "webapp"
  val dest = "/opt/app"
  LinuxPackageMapping(
    for {
      path <- (src ***).get
      if !path.isDirectory
    } yield path -> path.toString.replaceFirst(src.toString, dest)
  )
}

It would be nice though to have this code on the library side for consistent and expected behavior. Also in a package with lots of files every additional recursion through the file system is a performance hit.

@jsuereth
Copy link
Member

jsuereth commented Jul 3, 2012

Can you open a feature request for that?

The only reason it's not done now is because tools that do so grant
different permissions to directories than files by default. It's been on
my nice to have list, but a formal issue with the feature request will make
it more likely I'll add it.

@muuki88 muuki88 added the bug label Feb 4, 2014
@muuki88
Copy link
Contributor

muuki88 commented May 17, 2014

Closing, since no feedback here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants