LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error while creating RPM package (https://www.linuxquestions.org/questions/linux-newbie-8/error-while-creating-rpm-package-749214/)

kavinsiva 08-21-2009 01:46 AM

Error while creating RPM package
 
Hi,

I am new to creating RPMs i wrote a spec file while invoking the comment rebuild -ba printer.spec i am getting followinf error

error: File not found: /home/sivakumar/rpmbuild/BUILDROOT/ZebraPrinter-1.0-1.i386/home/sivakumar/rpmbuild/BUILDROOT/ZebraPrinter-1.0-1.i386/ZPCprinter-1.0
error: File not found: /home/sivakumar/rpmbuild/BUILDROOT/ZebraPrinter-1.0-1.i386/home/sivakumar/rpmbuild/BUILDROOT/ZebraPrinter-1.0-1.i386/ZPCprinter-1.0/ZPCprinters


RPM build errors:
File not found: /home/sivakumar/rpmbuild/BUILDROOT/ZebraPrinter-1.0-1.i386/home/sivakumar/rpmbuild/BUILDROOT/ZebraPrinter-1.0-1.i386/ZPCprinter-1.0
File not found: /home/sivakumar/rpmbuild/BUILDROOT/ZebraPrinter-1.0-1.i386/home/sivakumar/rpmbuild/BUILDROOT/ZebraPrinter-1.0-1.i386/ZPCprinter-1.0/ZPCprinters

my spec file
<spec>
Summary:Zebra Printer GUI
Name: ZebraPrinter
Version:1.0
Release: 1
License:Gpl
Source: ZPCprinter.tar.gz
%description
This UI wil lHelp to use Zebra Printer

%prep
%setup

%install
install -m 0755 -d /home/sivakumar/rpmbuild/ZPCprinter-1.0
install -m 0755 -d /home/sivakumar/rpmbuild/ZPCprinter-1.0/ZPCprinters

%files

%dir /home/sivakumar/rpmbuild/BUILDROOT/ZebraPrinter-1.0-1.i386/ZPCprinter-1.0
%dir /home/sivakumar/rpmbuild/BUILDROOT/ZebraPrinter-1.0-1.i386/ZPCprinter-1.0/ZPCprinters
</spec>

unSpawn 08-21-2009 04:58 AM

Quote:

Originally Posted by kavinsiva (Post 3651980)
I am new to creating RPMs

That's cool. It isn't hard to do but you best start by reading first.

From your .spec file I see:
- the license is called "GPL", not "Gpl" (minor nit),
- the %_buildroot was not defined (unless it's in your ~/.rpmmacros),
- no parts of the default "./configure; make; make install" mantra are used (how do you install things?),
- you don't use any "make install" (or "make DESTDIR=$RPM_BUILD_ROOT install") or use manual 'install' commands to install files (right now its just two directorynames),
- you should use BUILDROOT like "install -d $RPM_BUILD_ROOT/etc/ZPCprinter-1.0" (not also prepend actual path),
- the $RPM_BUILD_ROOT was not cleaned up,
- the %files section is incomplete (no %defattr, no %doc, no %attr),
- the %changelog section is missing.

It would be really beneficial for you if you would read the package building docs that come with your distribution or else the docs at rpm(5).org or the Fedora Wiki.

knudfl 08-21-2009 06:43 AM

Example, short "home made" spec files, that work :

Please see the attached files, post # 3 here

http://www.linuxquestions.org/questi...hlight=xfardic
.....
.....
Links, I found useful by creating the first spec file
http://www.rpm.org/max-rpm/s1-rpm-bu...spec-file.html
http://docs.fedoraproject.org/drafts...specfiles.html
http://docs.fedoraproject.org/drafts...n/ch09s05.html
http://docs.fedoraproject.org/drafts...html#id2972829
.....

unSpawn 08-21-2009 06:54 AM

Nice work. Same three last points apply though wrt $RPM_BUILD_ROOT cleanup, %defattr and %attr and %changelog?


All times are GMT -5. The time now is 05:25 AM.