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: pgpaBz71MvpTa.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]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux