{"id":765,"date":"2018-11-02T16:36:03","date_gmt":"2018-11-02T08:36:03","guid":{"rendered":"http:\/\/cmesoft.com\/?p=765"},"modified":"2018-11-02T16:36:03","modified_gmt":"2018-11-02T08:36:03","slug":"rpm-%e5%ae%8f%e5%ae%9a%e4%b9%89","status":"publish","type":"post","link":"http:\/\/cmesoft.com\/?p=765","title":{"rendered":"rpm \u5b8f\u5b9a\u4e49"},"content":{"rendered":"<p>http:\/\/cholla.mmto.org\/computers\/linux\/rpm\/dotrpmmacros.html<br \/>\n<code lang=\"php\"><\/p>\n<h1>Custom RPM macros configuration file for building RPM packages<\/h1>\n<h1>as a non-root user.<\/h1>\n<p>#<\/p>\n<h1>Author:  Mike A. Harris<\/h1>\n<p>#<\/p>\n<h1>This is a copy of my own personal RPM configuration which I use<\/h1>\n<h1>on my workstation for building and testing packages for Red Hat Linux.<\/h1>\n<h1>There are many different possibilities on how to configure RPM, so<\/h1>\n<h1>feel free to tweak however you desire.  Make sure to create any<\/h1>\n<h1>directories that are referenced prior to using.  RPM will automatically<\/h1>\n<h1>create some of them if missing, but not all of them.  Which ones it<\/h1>\n<h1>auto-creates is only known by the extraterrestrial aliens that have<\/h1>\n<h1>created RPM.<\/h1>\n<p>#<\/p>\n<h1>For ANY help with anything related to RPM development, packaging,<\/h1>\n<h1>or customization, please join the Red Hat RPM mailing list by sending<\/h1>\n<h1>an email message to:  rpm-list-request@redhat.com  with the word<\/h1>\n<h1>\"subscribe\" in the Subject: line.<\/h1>\n<p>#<\/p>\n<h1>Any suggestions\/comments\/ for improvements to this setup appreciated.<\/h1>\n<p>%_signature gpg<br \/>\n%_gpg_name T. E. Pickering<\/p>\n<h1>%_topdir defines the top directory to be used for RPM building purposes<\/h1>\n<h1>By defaultROOT of the buildsystem<\/h1>\n<p>%_topdir    %(echo $HOME)\/rpmbuild<\/p>\n<h1>%_sourcedir is where the source code tarballs, patches, etc. will be<\/h1>\n<h1>placed after you do an \"rpm -ivh somepackage.1.0-1.src.rpm\"<\/h1>\n<p>#%_sourcedir     %{_topdir}\/SOURCES\/cpan<br \/>\n%_sourcedir     %{_topdir}\/SOURCES\/%{name}-%{version}<\/p>\n<h1>%_specdir is where the specfile gets placed when installing a src.rpm. I<\/h1>\n<h1>prefer the specfile to be in the same directory as the source tarballs, etc.<\/h1>\n<p>%_specdir       %{_sourcedir}<\/p>\n<h1>%_tmppath is where temporary scripts are placed during the RPM build<\/h1>\n<h1>process as well as the %_buildroot where %install normally dumps files<\/h1>\n<h1>prior to packaging up the final binary RPM's.<\/h1>\n<p>%_tmppath   %{_topdir}\/tmp<\/p>\n<h1>%_builddir is where source code tarballs are decompressed, and patches then<\/h1>\n<h1>applied when building an RPM package<\/h1>\n<p>%_builddir  %{_topdir}\/BUILD<\/p>\n<h1>%_buildroot is where files get placed during the %install section of spec<\/h1>\n<h1>file processing prior to final packaging into rpms.  This is oddly named<\/h1>\n<h1>and probably should have been called \"%_installroot\" back when it was<\/h1>\n<h1>initially added to RPM.  Alas, it was not.  ;o)<\/h1>\n<p>%_buildroot %{_tmppath}\/%{name}-%{version}-root<\/p>\n<h1>%_rpmdir is where binary RPM packages are put after being built.<\/h1>\n<p>%_rpmdir    %{_topdir}\/RPMS<\/p>\n<h1>%_srcrpmdir is where src.rpm packages are put after being built.<\/h1>\n<p>%_srcrpmdir %{_topdir}\/SRPMS<\/p>\n<h1>%_rpmfilename defines the naming convention of the produced RPM packages,<\/h1>\n<h1>and should not be modified.  It is listed here because I am overriding<\/h1>\n<h1>RPM's default behaviour of dropping binary RPM's each in their own<\/h1>\n<h1>separate subdirectories.  I hate that.  Grrr.<\/h1>\n<p>%_rpmfilename   %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm<\/p>\n<h1>Customized tags for local builds<\/h1>\n<h1>%packager is the info that will appear in the \"Packager:\" field in the<\/h1>\n<h1>RPM header on built packages.  By default I have it read your username<\/h1>\n<h1>and hostname.  This should be customized appropriately.<\/h1>\n<h1>%packager Joe Blow<\/h1>\n<p>%packager   T. E. Pickering<br \/>\n%distribution   The MMTO RPM Shack<\/p>\n<h1>GNU GPG config below<\/h1>\n<p>#%_signature     gpg<br \/>\n#%_gpg_name      Joe Blow<br \/>\n#%_gpg_path      %(echo $HOME)\/.gnupg<\/p>\n<h1>The following will try to create any missing directories required above<\/h1>\n<h1>(Not implemented yet)<\/h1>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/cholla.mmto.org\/computers\/linux\/rpm\/dotrpmmacros&hellip;&nbsp;<a href=\"http:\/\/cmesoft.com\/?p=765\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">rpm \u5b8f\u5b9a\u4e49<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[11],"tags":[],"class_list":["post-765","post","type-post","status-publish","format-standard","hentry","category-11"],"_links":{"self":[{"href":"http:\/\/cmesoft.com\/index.php?rest_route=\/wp\/v2\/posts\/765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/cmesoft.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/cmesoft.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/cmesoft.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/cmesoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=765"}],"version-history":[{"count":1,"href":"http:\/\/cmesoft.com\/index.php?rest_route=\/wp\/v2\/posts\/765\/revisions"}],"predecessor-version":[{"id":766,"href":"http:\/\/cmesoft.com\/index.php?rest_route=\/wp\/v2\/posts\/765\/revisions\/766"}],"wp:attachment":[{"href":"http:\/\/cmesoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/cmesoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=765"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/cmesoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}