1

I am building a RPM on RHEL.

After following https://fedoraproject.org/wiki/How_to_create_an_RPM_package, I put my front.tar.gz in /rpmbuild/SOURCES, and make the spec file like this:

Name: front
Version:        1.1.0
Release:        1%{?dist}
Summary:        The web2py webserver

Group:          Applications/Internet
License:        GNU
URL:            https://xxx
Source0:        https://xxx
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXXX)

#BuildRequires:
Requires:       python2.6, python2.7, apache


%description

%prep
%autosetup -n %{name}


%build
%configure

%install
rm -rf %{buildroot}
install -d -m 755 %{buildroot}/var/www/
cp -r . &{buildroot}/var/www/front/


%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc


%changelog

Then, I do

rpmbuild -ba front.spec

in the /SPECS,

I can see many file are copied to the /BUILDROOT/front.1.10-1.e17.x86_64/ but after that, the building process seems finished with no RPM file generated in the /RPMS directory.

There was no error or warning. Seems like the bin stage is never executed.

Does anyone know what could be the problem?

  • Can you post the whole output from rpmbuild -ba? – jayhendren Jul 28 '15 at 16:20
  • As an aside, you never declared any files in your %files section. Without any files declared, your package will be empty. – jayhendren Jul 28 '15 at 16:20
  • Also, why are you creating a package that requires a package called python2.6 and a package called python2.7? I doubt those packages are available on most RHEL systems (the Python package on all RHEL systems I know of is simply called python), and those packages look like they would conflict anyway. – jayhendren Jul 28 '15 at 16:22
  • hey Jay, thanks a lot for the hint! After putting /* in the %files section, everything works :D How silly this question was... anyway, thanks for the help! – leonard Jul 29 '15 at 11:10
1

It turned out to be a lack of /* in the %files section

%files 
%defattr(-,root,root,-)
/*
  • you can be tighter on this, you can do %{_prefix} instead of /*. Then you'll be warned if there's any stray files that you weren't expecting. – Rich Homolka Jun 10 '16 at 0:48

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.