Getting File not found error when building

Hey guys,

I am building a library, but OBS keeps saying file not found, can somebody tell me whan I have wrong here:

On my %install section of the spec file I have:

*** not the real file name ***

%install
%{__make} install DESTDIR=%{buildroot}
install -D -m 0755 library.a %{buildroot}/%{_lib}/library.a

And on my %files I have this:

%files
%defattr(-,root,root,-)
%{buildroot}/%{_lib}/library.a

Error I’m getting:

   87s] + install -D -m 0755 library.a /home/abuild/rpmbuild/BUILDROOT/library-version.x86_64/lib64/library.a
   87s] install: cannot stat 'library.a': No such file or directory

Thanks,

On Thu 16 Jan 2014 11:46:01 PM CST, jurgen73 wrote:

Hey guys,

I am building a library, but OBS keeps saying file not found, can
somebody tell me whan I have wrong here:

On my %install section of the spec file I have:

*** not the real file name ***

Code:

%install
%{__make} install DESTDIR=%{buildroot}
install -D -m 0755 library.a %{buildroot}/%{_lib}/library.a

And on my %files I have this:

Code:

%files
%defattr(-,root,root,-)
%{buildroot}/%{_lib}/library.a

Error I’m getting:

Code:

87s] + install -D -m 0755
library.a /home/abuild/rpmbuild/BUILDROOT/library-version.x86_64/lib64/library.a
87s] install: cannot stat ‘library.a’: No such file or directory

Thanks,

Hi
So does library.a exist in the top part of build? It’s not down in say
a src directory? Are you building locally first with osc, if so browse
to your build-root, or run osc lbl less to see where it’s at during
%install.

Plus %{__make} is deprecated, use %makeinstall or %make_install as
DESTDIR is defined in these rpm macros as %{buildroot}


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.6-4-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

All the files exist, not just .a, but also .so .lo, etc. I have also tried %makeinstall as per Adrian, but I still get the same error.

On Wed 22 Jan 2014 12:26:01 AM CST, jurgen73 wrote:

malcolmlewis;2616734 Wrote:
> Hi
> So does library.a exist in the top part of build? It’s not down in say
> a src directory? Are you building locally first with osc, if so browse
> to your build-root, or run osc lbl less to see where it’s at during
> %install.
>
> Plus %{__make} is deprecated, use %makeinstall or %make_install as
> DESTDIR is defined in these rpm macros as %{buildroot}
>
> –
> Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
> openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.6-4-desktop
> If you find this post helpful and are logged into the web interface,
> please show your appreciation and click on the star below… Thanks!

All the files exist, not just .a, but also .so .lo, etc. I have also
tried %makeinstall as per Adrian, but I still get the same error.

Hi
I’m guessing your building locally? If so, go to your buildroot
->home/abuild/BUILD and look down in there for library.a to see where
it is.

Else, is it on OBS?, if so can you provide the link to the
project/package.


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.6-4-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

The closest I’ve gotten is when I get this:

library-version.noarch.rpm: directories not owned by a package:

What do I have to put in %files?

Right now I have /usr/lib/library.a, so, etc.

But when I put %{buildroot}/%{_lib}/library.a, so, etc. I get the not found I said before.

On Wed 22 Jan 2014 12:56:01 AM CST, jurgen73 wrote:

The closest I’ve gotten is when I get this:

Code:

library-version.noarch.rpm: directories not owned by a package:

What do I have to put in %files?

Right now I have /usr/lib/library.a, so, etc.

But when I put %{buildroot}/%{_lib}/library.a, so, etc. I get the not
found I said before.

Hi
You need to use %dir in the %files section, start with the deepest and
then work back, in your case it’s probably;


%dir %{_lib}


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.6-4-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

I found that the files are in src/.libs , so I changed my %files to have

/src/.libs/
and
/.libs

Before the file names, but it still says file not found, even though the path it shows me should be correct:

/home/abuild/rpmbuild/BUILDROOT/library-version.x86_64/src/.libs/file.a or .so, etc
and
/home/abuild/rpmbuild/BUILDROOT/library-version.x86_64/.libs/file.a or .so, etc

I also want to say that higher in the log I can see it does go to that folder as .libs/filename.o so the folder does exist and files are there, also %dir gives me nothing.

On Sat 25 Jan 2014 08:26:02 PM CST, jurgen73 wrote:

malcolmlewis;2618322 Wrote:
> Hi
> You need to use %dir in the %files section, start with the deepest and
> then work back, in your case it’s probably;
> >
Code:

> >
> %dir %{_lib}
>

> >
>
> –
> Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
> openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.6-4-desktop
> If you find this post helpful and are logged into the web interface,
> please show your appreciation and click on the star below… Thanks!

I found that the files are in src/.libs , so I changed my %files to have

/src/.libs/
and
…/libs

Before the file names, but it still says file not found, even though the
path it shows me should be correct:

/home/abuild/rpmbuild/BUILDROOT/library-version.x86_64/src/.libs/file.a
or .so, etc
and
/home/abuild/rpmbuild/BUILDROOT/library-version.x86_64/.libs/file.a or
…so, etc

I also want to say that higher in the log I can see it does go to that
folder as .libs/filename.o so the folder does exist and files are there,
also %dir gives me nothing.

Hi
So you should be able to run;


%install
install -Dm0644 src/.libs/file.a %{buildroot}%{_lib}/file.a

And no, your %files should be;


%files
%defattr(-,root,root)
%{_lib}/file.a


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.6-4-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

I tried that but I still get

install: cannot stat 'src/.libs/library.*': No such file or directory

Any other ideas?

Never mind, the file(s) is says it cannot find are not in src/.libs but in src, so I guess it’s going to work this time.

Now I’m back to my previous error:

error: Installed (but unpackaged) file(s) found:

/usr/lib/library/*.*

What can I do with this error?

On Sat 01 Feb 2014 04:26:01 PM CST, jurgen73 wrote:

Now I’m back to my previous error:

Code:

error: Installed (but unpackaged) file(s) found:

/usr/lib/library/.


What can I do with this error?

Hi
Can you push the package up onto OBS so I can see what’s happening?


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.6-4-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

It’s there now, I didn’t want to put it there because I don’t have permission from the developers, but since this is just a test, you can find it at https://build.opensuse.org/package/show/home:jfha73/libaacs, please check it out and tell me what I have wrong or missing so I can ask for permission from the developers and leave it there for the public.

On Sun 02 Feb 2014 03:46:01 PM CST, jurgen73 wrote:

It’s there now, I didn’t want to put it there because I don’t have
permission from the developers, but since this is just a test, you can
find it at https://build.opensuse.org/package/show/home:jfha73/libaacs,
please check it out and tell me what I have wrong or missing so I can
ask for permission from the developers and leave it there for the
public.

Hi
Here is the error;


/%{_include}/libaacs/aacs-version.h
/%{_include}/libaacs/aacs.h
/%{_include}/libaacs/filesystem.h

For a start get rid on the leading /, the macro is %{_includedir} not
include.

You can see the error in the buildlog;


   83s] + install -D -m 0755 src/libaacs/aacs-version.h '/home/abuild/rpmbuild/BUILDROOT/libaacs-0.7.0-3.1.x86_64/%{_include}/libaacs/aacs-version.h'
   83s] + install -D -m 0755 src/libaacs/aacs.h '/home/abuild/rpmbuild/BUILDROOT/libaacs-0.7.0-3.1.x86_64/%{_include}/libaacs/aacs.h'
   83s] + install -D -m 0755 src/file/filesystem.h '/home/abuild/rpmbuild/BUILDROOT/libaacs-0.7.0-3.1.x86_64/%{_include}/libaacs/filesystem.h'

OBS will show all the files not packaged even if it’s only one of the
files… it’s a quirk you need to watch for.

Also you don’t need la files, these can be deleted;


find %{buildroot}%{_lib} -name '*.la' -type f -delete -print

Do you really need the static libs? If not the add --enable-static=no
to you configure command and just use make rather than %{__make} this
is deprecated.

You will also get an error at some point about the files not being in
a development package…


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.6-4-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

I replaced include for includedir but I’m still getting the same error, any other suggestion?

Also, I know ${__make} is deprecated but I didn’t know what to replace it with.

Finally to the suggestion about static libraries and .la files, that’s not up to me but to the developers (Videolan/Doom9) so I won’t touch that.

Have you corrected the spec, as Malcolm said?

show “the same error” again.

That’s exactly what I did.

Hey Malcolm,

Do you think this error has to do with the fact that I’m using ./configure --PREFIX=/usr in %prep and these files are being created in %{buildroot}

Just a thought.

By the way, thanks for your help.

On Sun 02 Feb 2014 05:06:01 PM CST, jurgen73 wrote:

Hey Malcolm,

Do you think this error has to do with the fact that I’m using
…/configure --PREFIX=/usr in %prep and these files are being created in
%{buildroot}

Just a thought.

By the way, thanks for your help.

Hi
Check your project, created request id 220613

There are more errors for you to sort through, will be back home later
on…


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.6-4-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!