Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

please advice why I get the error "error: License field must be present in package: (main package)"

I need to create rpm file ,

I only have the spec file under SPECS

and the test.sh script under SOURCES

what’s wrong here?

 [root@linux /usr/src/redhat]# ls

 BUILD  RPMS  SOURCES  SPECS  SRPMS

the spec file:

Summary: An example tool. To show a simple rpm build of the tool.
Name: test.sh
Version: 6.2
Release: 2
Source:/root/test.sh
Group: Development/Debuggers
BuildRoot:/var/tmp/test.sh
%description

 #  rpm -ba my_spec.spec
 error: License field must be present in package: (main package)
 # ls ../SOURCES/
   test.sh
share|improve this question
    
By the looks of it I've solved your initial question. However as you've found, you've run into a new problem. I'm afraid writing spec files is a lot more complicated than the example you've provided, but perfectly doable. I've yet to find a decent example of packaging a simple bash script but something like this fedora guide is better than nothing. Just strip out the build commands & requirements. –  PriceChild Apr 12 '11 at 15:24
    
but I have linux red-hat not fedora , second can you please give the correct spec file? –  yael Apr 12 '11 at 15:26
    
Both RHEL and Fedora use the same rpm technology and the tutorial is valid. (That doesn't mean you can install fedora rpms in redhat or vica verca!) This forum thread here (see post 3) is an example of packaging a bash script but I haven't tried or checked it myself. –  PriceChild Apr 13 '11 at 8:26

1 Answer 1

up vote 1 down vote accepted

Wild shot in the dark... have you tried adding something like:

License: OtherLicense

before %description?

share|improve this answer
    
OK I add this but now I get: error: Bad file: /root/rpmbuild/SOURCES/test.sh: No such file or directory RPM build errors: Bad file: /root/rpmbuild/SOURCES/test.sh: No such file or directory –  yael Apr 12 '11 at 15:19
1  
Awesome, looks like that's solved the problem you're asking about originally, going to add a further comment to your question. –  PriceChild Apr 12 '11 at 15:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.