[nylug-talk] Anyone know how to build an RPM that isn't from a tarball?

Bryan J. Smith b.j.smith at ieee.org
Fri Mar 28 19:38:25 EDT 2008


Steven Lembark wrote:  
> Last time I looked at this (mid 90's) it was simple.
> Today it's complicated.
> That "progress"

Professional Consideration:  

I avoid criticizing technology and implementations.  Because if it
turns out I didn't know how to do something, but blamed the
technology or implementation, I've just publicly told a potential
client:  
- I don't know what I'm doing
- I react instead of reading up
- I am ready to blame things instead of myself

Regardless of it "sucking" or not, that's what it does.  ;)

> I have a single piece of content that belongs
> in, say, /etc/foo/release. The RPM will have
> a bunch of Reauired/Prereq entries for things
> that have to come along with that release.
> The install is simply:
>     %install
>    [ -d %{install_dir} ] || mkdir -p %{install_dir};
>    echo %{version} > %{install_file};

Huh?  Why are you doing this operation instead of letting RPM do it?

> Now I'm having problems becuse there is no
> Source0. This is true: there is no source
> file.
> If I side-step this issue by echoing the
> version into %{_topdir}/SOURCES/release-file
> then rpmbuild blows up telling me that the
> release file doesn't look like a tarball!!!

You do _not_ need a "SOURCE" tarball.
You _only_ need a "source tree."  ;)

> Is there any way to make the current versions
> of rpmbuild generate a source-less RPM with
> nothing but a spec file or at least take an
> empty (or simple text line) path and not try
> to unzip or untar it?

Given the fact that RPM itself is a portable SysV CPIO archive,
you're going to get an archive whether you like it or not.  But
you're working the problem wrong here.

Here's a template ...

  %prep

  %install
  rm -rf $RPM_BUILD_ROOT
  mkdir -p $RPM_BUILD_ROOT
  cd $RPM_SOURCE_DIR/%{name}-%{version}-%{release}
  cp -a . $RPM_BUILD_ROOT

  %clean
  rm -rf $RPM_BUILD_ROOT

  %files
  %defattr(755,root,root)
  (file list goes here)

No "prep" commands, just the "source" directory.  Set that to
whatever you want.


-- 
Bryan J. Smith       Professional, Technical Annoyance
b.j.smith at ieee.org  http://www.linkedin.com/in/bjsmith
------------------------------------------------------
       Fission Power:  An Inconvenient Solution


More information about the nylug-talk mailing list