{"id":322,"date":"2011-12-28T11:05:22","date_gmt":"2011-12-28T19:05:22","guid":{"rendered":"http:\/\/www.hongyu.org\/wordpress\/?p=322"},"modified":"2012-05-03T16:47:52","modified_gmt":"2012-05-03T23:47:52","slug":"rpm-builder-quick-steps","status":"publish","type":"post","link":"https:\/\/www.hongyu.org\/wordpress\/?p=322","title":{"rendered":"RPM builder quick steps"},"content":{"rendered":"<p>Step 1, install rpm tools<br \/>\n[sourcecode]yum install rpmdevtools rpmlint[\/sourcecode]<\/p>\n<p>Step 2, set up working directory<br \/>\n[sourcecode]rpmdev-setuptree[\/sourcecode]<\/p>\n<p>Step 3, create and edit the spec file<br \/>\n[sourcecode]<br \/>\ncd rpmbuild\/SPECS<br \/>\nrpmdev-newspec<br \/>\n[\/sourcecode]<\/p>\n<p>Miscellaneous commands:<\/p>\n<p>show environment variables<br \/>\n[sourcecode]rpm &#8211;showrc[\/sourcecode]<br \/>\nshow specific variable<br \/>\n[sourcecode]rpm &#8211;eval %_usr[\/sourcecode]<\/p>\n<p>Procedures to simulate RPM building with Mock<br \/>\n&#8211; Build source rpm<br \/>\n[sourcecode]<br \/>\nrpmbuild -bs SPECS\/myproject.spec<br \/>\n[\/sourcecode]<\/p>\n<p>&#8211; Mock the build, i.e., testing the build in an isolated building environment simulating a specific platform (Redhat or Fedora etc.)<br \/>\n[sourcecode]<br \/>\nmock -r platform_name SRPMS\/myproject.src.rpm<br \/>\n[\/sourcecode]<\/p>\n<p>&#8211; If it&#8217;s a multiple-project task, mock install the first project first, and then mock build the 2nd, i.e.,<br \/>\n[sourcecode]<br \/>\nmock -r platform_name &#8211;install \/mock_path\/myproject.rpm<br \/>\nmock -r platform_name SRPMS\/myproject2.src.rpm<br \/>\n[\/sourcecode]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step 1, install rpm tools [sourcecode]yum install rpmdevtools rpmlint[\/sourcecode] Step 2, set up working directory [sourcecode]rpmdev-setuptree[\/sourcecode] Step 3, create and edit the spec file [sourcecode] cd rpmbuild\/SPECS rpmdev-newspec [\/sourcecode] Miscellaneous commands: show environment variables [sourcecode]rpm &#8211;showrc[\/sourcecode] show specific variable [sourcecode]rpm &#8211;eval %_usr[\/sourcecode] Procedures to simulate RPM building with Mock &#8211; Build source rpm [sourcecode] rpmbuild &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.hongyu.org\/wordpress\/?p=322\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;RPM builder quick steps&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/322"}],"collection":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=322"}],"version-history":[{"count":7,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/322\/revisions"}],"predecessor-version":[{"id":396,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/322\/revisions\/396"}],"wp:attachment":[{"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongyu.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}