Re: spec file for rpms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Phil Meyer wrote:
> Both vim and emacs will create a basic spec for you by simply
> editing a  non existant spec file.

I'm a fan of rpmdev-newspec, as Paul mentioned.  This creates a nice
template that you can fill in and have a nice, clean specfile.  (As a
bonus, if/when you decide to share your package with the rest of us,
it will be formatted as Fedora package reviewers are accustomed to
seeing.)

> There are tools to watch 'make install' to discover what happens and
> duplicate it for a %files section for a spec file, but using those
> tools  is a separate art form in itself.

Let rpm do the work for you.  With an empty %files section, rpmbuild
will complain that files were found in the buildroot¹ that were not
listed.  From there, you can add these files (or shell-style globs) to
the %files section.  Most spec files tend to have fairly short
%files sections.  For example, the paperkey package looks like this:

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.gz

If this was your first spec file and you didn't know about the %{}
macros, it could be written using the full paths.

> You will want some references:
>
> http://www.rpm.org/max-rpm/index.html
>
> http://docs.fedoraproject.org/drafts/rpm-guide-en/
> Look for the section called: Creating the spec file

Agreed, these are both worth having handy as references.

> One last piece of advice:
> Always run rpmbuild as your user, and NOT root.  If your .spec file  
> needs root to do something, you are doing it wrong. :)

Is it worth mentioning that building packages as root has been known
to kill kittens and other small mammals?

¹ Despite the name, the buildroot is the location where rpm installs
the package.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sometimes I wonder whether the world is being run by smart people who
are putting us on or by imbeciles who really mean it.
    -- Mark Twain

Attachment: pgperUfmEyKzD.pgp
Description: PGP signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux