{"id":57,"date":"2007-11-20T15:50:39","date_gmt":"2007-11-20T15:50:39","guid":{"rendered":"http:\/\/blog.danplanet.com\/wordpress\/?p=57"},"modified":"2011-11-29T16:54:01","modified_gmt":"2011-11-29T16:54:01","slug":"mock-rocks","status":"publish","type":"post","link":"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/","title":{"rendered":"Mock Rocks!"},"content":{"rendered":"<p>I&#8217;ve been working through the <a href=\"http:\/\/fedoraproject.org\/wiki\/PackageMaintainers\/Join\">process<\/a> of getting a <a href=\"http:\/\/libvirt.org\/hg\/libcmpiutil\">libcmpiutil<\/a> package built for Fedora 9.\u00a0 I&#8217;ve never packaged something for a distro before, so some of the things are a bit new to me.\u00a0 Luckily, Daniel Veillard did a good chunk of the up-front work of writing the spec files; only minor tweakage was needed.<\/p>\n<p>I&#8217;ve been using Fedora 8 for a development machine, because the Pegasus package is fine for what we need (aside from the <a href=\"http:\/\/libvirt.org\/CIM\/schema.html\">schema<\/a> changes).\u00a0 However, during the review process, an issue came up which was no doubt related to a newer compiler version in the -development head of Fedora (what will become Fedora 9).\u00a0 I, of course, did not see these issues on my Fedora 8 machine, and needed a way to test my fixes before posting for review again.<\/p>\n<p>I considered installing a Fedora 8 VM, enabling the fedora-development repository and upgrading everything.\u00a0 However, our lab was being really slow today, and accessing my KVM-capable machines was just not going to happen.\u00a0 Knowing that Mock is supposed to help this sort of thing, I decided to give it a shot.<\/p>\n<p>After setting up a build user (per the <a href=\"http:\/\/fedoraproject.org\/wiki\/PackageMaintainers\/MockTricks\">MockTricks<\/a> page), I can do this:<\/p>\n<blockquote style=\"font-family: Courier New,Courier,mono;\"><p>% sudo su &#8211; build<br \/>\n% mock -r fedora-devel-x86_64 rebuild libcmpiutil-0.1-4.src.rpm<\/p><\/blockquote>\n<p>Not only do I get a Fedora 9 build environment, but I get my build dependencies checked and a .fc9 SRPM out of the whole deal!\u00a0 It&#8217;s really cool to be able to get an automated build environment without needing to hose a machine with a test installation.\u00a0 You can even test 32-bit builds on a 64-bit machine with minimal effort.\u00a0 Finally, if you need to do something other than build an SRPM in the sandbox, you can get a chroot to any of the environments you need like this:<\/p>\n<blockquote style=\"font-family: Courier New,Courier,mono;\"><p>[build@guaranine ~]$ mock -r fedora-devel-x86_64 shell<br \/>\nINFO: mock.py version 0.8.7 starting&#8230;<br \/>\nState Changed: init plugins<br \/>\nState Changed: start<br \/>\nState Changed: lock buildroot<br \/>\nState Changed: clean<br \/>\nState Changed: init<br \/>\nState Changed: lock buildroot<br \/>\nState Changed: enabled yum cache, cleaning yum metadata<br \/>\nState Changed: enabling root cache<br \/>\nState Changed: unpacking cache<br \/>\nmock-chroot&gt; cat \/etc\/fedora-release<br \/>\nFedora release 8.90 (Rawhide)<br \/>\nmock-chroot&gt;<\/p><\/blockquote>\n<p>The one thing I haven&#8217;t figured out how to do yet is test build a dependent set of RPMs (such as libcmpiutil and libvirt-cim), but I feel there must be a way.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been working through the process of getting a libcmpiutil package built for Fedora 9.\u00a0 I&#8217;ve never packaged something for a distro before, so some of the things are a bit new to me.\u00a0 Luckily, Daniel Veillard did a good &hellip; <a href=\"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,6],"tags":[38,43],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-codemonkeying","category-linux","tag-fedora","tag-linux-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Mock Rocks! - Right Angles<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mock Rocks! - Right Angles\" \/>\n<meta property=\"og:description\" content=\"I&#8217;ve been working through the process of getting a libcmpiutil package built for Fedora 9.\u00a0 I&#8217;ve never packaged something for a distro before, so some of the things are a bit new to me.\u00a0 Luckily, Daniel Veillard did a good &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/\" \/>\n<meta property=\"og:site_name\" content=\"Right Angles\" \/>\n<meta property=\"article:published_time\" content=\"2007-11-20T15:50:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-11-29T16:54:01+00:00\" \/>\n<meta name=\"author\" content=\"Dan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/\"},\"author\":{\"name\":\"Dan\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c\"},\"headline\":\"Mock Rocks!\",\"datePublished\":\"2007-11-20T15:50:39+00:00\",\"dateModified\":\"2011-11-29T16:54:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/\"},\"wordCount\":394,\"publisher\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c\"},\"keywords\":[\"fedora\",\"linux\"],\"articleSection\":[\"Codemonkeying\",\"Linux\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/\",\"url\":\"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/\",\"name\":\"Mock Rocks! - Right Angles\",\"isPartOf\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/#website\"},\"datePublished\":\"2007-11-20T15:50:39+00:00\",\"dateModified\":\"2011-11-29T16:54:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.danplanet.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mock Rocks!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/#website\",\"url\":\"https:\/\/www.danplanet.com\/blog\/\",\"name\":\"Right Angles\",\"description\":\"If they&#039;re not right...they&#039;re wrong\",\"publisher\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.danplanet.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c\",\"name\":\"Dan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9b73782704be64dd8c030087af2d1ae0c1dc488cad69093ff0366dbaad2de673?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9b73782704be64dd8c030087af2d1ae0c1dc488cad69093ff0366dbaad2de673?s=96&d=mm&r=g\",\"caption\":\"Dan\"},\"logo\":{\"@id\":\"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/www.danplanet.com\/blog\/author\/dan\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mock Rocks! - Right Angles","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/","og_locale":"en_US","og_type":"article","og_title":"Mock Rocks! - Right Angles","og_description":"I&#8217;ve been working through the process of getting a libcmpiutil package built for Fedora 9.\u00a0 I&#8217;ve never packaged something for a distro before, so some of the things are a bit new to me.\u00a0 Luckily, Daniel Veillard did a good &hellip; Continue reading &rarr;","og_url":"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/","og_site_name":"Right Angles","article_published_time":"2007-11-20T15:50:39+00:00","article_modified_time":"2011-11-29T16:54:01+00:00","author":"Dan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Dan","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/#article","isPartOf":{"@id":"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/"},"author":{"name":"Dan","@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c"},"headline":"Mock Rocks!","datePublished":"2007-11-20T15:50:39+00:00","dateModified":"2011-11-29T16:54:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/"},"wordCount":394,"publisher":{"@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c"},"keywords":["fedora","linux"],"articleSection":["Codemonkeying","Linux"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/","url":"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/","name":"Mock Rocks! - Right Angles","isPartOf":{"@id":"https:\/\/www.danplanet.com\/blog\/#website"},"datePublished":"2007-11-20T15:50:39+00:00","dateModified":"2011-11-29T16:54:01+00:00","breadcrumb":{"@id":"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.danplanet.com\/blog\/2007\/11\/20\/mock-rocks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.danplanet.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Mock Rocks!"}]},{"@type":"WebSite","@id":"https:\/\/www.danplanet.com\/blog\/#website","url":"https:\/\/www.danplanet.com\/blog\/","name":"Right Angles","description":"If they&#039;re not right...they&#039;re wrong","publisher":{"@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.danplanet.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/0f6920aa6d63cae437bf8b122200287c","name":"Dan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9b73782704be64dd8c030087af2d1ae0c1dc488cad69093ff0366dbaad2de673?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9b73782704be64dd8c030087af2d1ae0c1dc488cad69093ff0366dbaad2de673?s=96&d=mm&r=g","caption":"Dan"},"logo":{"@id":"https:\/\/www.danplanet.com\/blog\/#\/schema\/person\/image\/"},"url":"https:\/\/www.danplanet.com\/blog\/author\/dan\/"}]}},"_links":{"self":[{"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":1,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":149,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/posts\/57\/revisions\/149"}],"wp:attachment":[{"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.danplanet.com\/blog\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}