2

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
3
  • 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. – Pricey 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. – Pricey Apr 13 '11 at 8:26
3

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

License: OtherLicense

before %description?

2
  • 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. – Pricey Apr 12 '11 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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