On 2012-05-10 21:15:14 (+0530), Manu Gupta <manugupt1@opensuse.org> wrote:
On Thu, May 10, 2012 at 8:50 PM, Dominique Leuenberger a.k.a DimStar <DimStar@opensuse.org> wrote: [...] Ok.. I got the prefix as Nelson, suggested but that worked for /usr/bin
Do it as in the mail I've just sent, by passing them to make rather than patching the Makefile.
Other directories like /usr/local/lib and /usr/local/man/man1, they give me an error
cp nut /usr/bin cp: cannot create regular file '/usr/bin/nut': Permission denied
Here you didn't pass %{buildroot}, also see my mail.
make: [install] Error 1 (ignored) cd /usr/bin; strip nut Nut
Okay, that's a nasty one that possibly needs patching. You must not allow the Makefile to do a "strip" on binaries, as that removes all debugging symbols and, hence, we can't create a -debuginfo subpackage. One common trick is to override the command for strip: often, you find something like this in Makefiles: STRIP = strip You can override that when you call make (typically in the %install section with "make install") like this: make STRIP=touch install touch will just update the "last modified" ("mtime") timestamp of the file to "now", completely harmless, and will not run "strip" and, hence, keep the debugging symbols, which is what we want.
strip: 'nut': No such file strip: 'Nut': No such file make: [install] Error 1 (ignored) cp raw.data/* /usr/lib/nut cp: target '/usr/lib/nut' is not a directory
Apparently the Makefile doesn't take care of creating the directories it installs its files in. Based on the email I've just sent prior to this one, use this in the %install section instead: install -d \ "%{buildroot}%{_bindir}" \ "%{buildroot}%{_prefix}/lib/nut" \ "%{buildroot}%{_mandir}/man1" make \ prefix="%{buildroot}%{_prefix}" \ mandir="%{buildroot}%{_mandir}/man1" \ STRIP=touch \ install [...]
Since compilation is sucecessful, I am assuming I have got the dependencies right. However I am unsure on how files and directories are handled. I mean what approach is taken.
You absolutely need to read up on buildroot, it's an essential aspect of building RPMs: http://www.rpm.org/max-rpm/s1-rpm-anywhere-different-build-area.html https://fedoraproject.org/wiki/How_to_create_an_RPM_package (even though they are doing a few things wrong in the latter, ie. do *NOT* do a "rm -rf %{buildroot}" at the beginning of the %build or %install section, it's insecure) [...] PS: no top posting please ;) cheers -- -o) Pascal Bleser /\\ http://opensuse.org -- we haz green _\_v http://fosdem.org -- we haz conf