{"id":406,"date":"2016-02-19T11:10:10","date_gmt":"2016-02-19T17:10:10","guid":{"rendered":"https:\/\/www.soljerome.com\/blog\/?p=406"},"modified":"2016-02-19T11:10:10","modified_gmt":"2016-02-19T17:10:10","slug":"rpmbuild-error-unable-to-create-immutable-header-region","status":"publish","type":"post","link":"https:\/\/www.soljerome.com\/blog\/2016\/02\/19\/rpmbuild-error-unable-to-create-immutable-header-region\/","title":{"rendered":"rpmbuild: error: Unable to create immutable header region"},"content":{"rendered":"<p>I was receiving this error when trying to build an RPM containing a very large number of files. The files contained USPS zip code data for the entire United States. When building the RPM, I would receive the following error:<\/p>\n<pre>error: Unable to create immutable header region<\/pre>\n<p>I tried searching for a solution and came across this bug: <a href=\"http:\/\/rpm.org\/ticket\/862\" target=\"_blank\">http:\/\/rpm.org\/ticket\/862<\/a>. So, basically, this is an arbitrary limit imposed by RPM which doesn&#8217;t appear to have a clean workaround.<\/p>\n<p>My method for bypassing the limit was to use the suggestion at <a href=\"https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=913099#c8\" target=\"_blank\">https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=913099#c8<\/a>. I built an RPM which split the zip code data by the first digit. The resulting spec file looks something like this.<\/p>\n<pre>\r\nName:           usps-zipdata\r\nVersion:        0.1\r\nRelease:        1%{?dist}\r\nSummary:        USPS zip code data\r\n\r\nLicense:        custom license\r\nURL:            https:\/\/example.com\/uspsdata\r\nSource0:        %{name}-%{version}.tar.bz2\r\n\r\nBuildArch:      noarch\r\nBuildRequires:  coreutils, bzip2\r\nRequires:       usps-zipdata-0 = %{version}-%{release}\r\nRequires:       usps-zipdata-1 = %{version}-%{release}\r\nRequires:       usps-zipdata-2 = %{version}-%{release}\r\nRequires:       usps-zipdata-3 = %{version}-%{release}\r\nRequires:       usps-zipdata-4 = %{version}-%{release}\r\nRequires:       usps-zipdata-5 = %{version}-%{release}\r\nRequires:       usps-zipdata-6 = %{version}-%{release}\r\nRequires:       usps-zipdata-7 = %{version}-%{release}\r\nRequires:       usps-zipdata-8 = %{version}-%{release}\r\nRequires:       usps-zipdata-9 = %{version}-%{release}\r\n\r\n%description\r\nStatic USPS zip code data.\r\n\r\n%package 0\r\nSummary:        USPS zip code data 0*\r\n\r\n%description 0\r\nStatic USPS zip code data for zip codes starting with the number zero.\r\n\r\n%package 1\r\nSummary:        USPS zip code data 1*\r\n\r\n%description 1\r\nStatic USPS zip code data for zip codes starting with the number one.\r\n\r\n%package 2\r\nSummary:        USPS zip code data 2*\r\n\r\n%description 2\r\nStatic USPS zip code data for zip codes starting with the number two.\r\n\r\n%package 3\r\nSummary:        USPS zip code data 3*\r\n\r\n%description 3\r\nStatic USPS zip code data for zip codes starting with the number three.\r\n\r\n%package 4\r\nSummary:        USPS zip code data 4*\r\n\r\n%description 4\r\nStatic USPS zip code data for zip codes starting with the number four.\r\n\r\n%package 5\r\nSummary:        USPS zip code data 5*\r\n\r\n%description 5\r\nStatic USPS zip code data for zip codes starting with the number five.\r\n\r\n%package 6\r\nSummary:        USPS zip code data 6*\r\n\r\n%description 6\r\nStatic USPS zip code data for zip codes starting with the number six.\r\n\r\n%package 7\r\nSummary:        USPS zip code data 7*\r\n\r\n%description 7\r\nStatic USPS zip code data for zip codes starting with the number seven.\r\n\r\n%package 8\r\nSummary:        USPS zip code data 8*\r\n\r\n%description 8\r\nStatic USPS zip code data for zip codes starting with the number eight.\r\n\r\n%package 9\r\nSummary:        USPS zip code data 9*\r\n\r\n%description 9\r\nStatic USPS zip code data for zip codes starting with the number nine.\r\n\r\n%prep\r\n%setup -q\r\n\r\n%build\r\n\r\n%install\r\nrm -rf $RPM_BUILD_ROOT\r\ninstall -d $RPM_BUILD_ROOT\/var\/usps\r\ntar xvf zip.tar.bz2\r\nmv zip $RPM_BUILD_ROOT\/var\/usps\/\r\n\r\n%clean\r\nrm -rf $RPM_BUILD_ROOT\r\n\r\n%files\r\n%defattr(-,root,root,-)\r\n%dir \/var\/usps\/zip\r\n%dir \/var\/usps\/zip\/MSS\r\n\/var\/usps\/zip\/MSS\/[a-z]*\r\n\r\n%files 0\r\n\/var\/usps\/zip\/MSS\/0*\r\n\r\n%files 1\r\n\/var\/usps\/zip\/MSS\/1*\r\n\r\n%files 2\r\n\/var\/usps\/zip\/MSS\/2*\r\n\r\n%files 3\r\n\/var\/usps\/zip\/MSS\/3*\r\n\r\n%files 4\r\n\/var\/usps\/zip\/MSS\/4*\r\n\r\n%files 5\r\n\/var\/usps\/zip\/MSS\/5*\r\n\r\n%files 6\r\n\/var\/usps\/zip\/MSS\/6*\r\n\r\n%files 7\r\n\/var\/usps\/zip\/MSS\/7*\r\n\r\n%files 8\r\n\/var\/usps\/zip\/MSS\/8*\r\n\r\n%files 9\r\n\/var\/usps\/zip\/MSS\/9*\r\n\r\n%changelog\r\n* Thu Feb 18 2016 Sol Jerome <sol@example.com> - 0.1-1\r\n- create new RPM for USPS zip code data\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I was receiving this error when trying to build an RPM containing a very large number of files. The files contained USPS zip code data for the entire United States. When building the RPM, I would receive the following error: error: Unable to create immutable header region I tried searching for a solution and came <a href='https:\/\/www.soljerome.com\/blog\/2016\/02\/19\/rpmbuild-error-unable-to-create-immutable-header-region\/' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts\/406"}],"collection":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/comments?post=406"}],"version-history":[{"count":5,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts\/406\/revisions"}],"predecessor-version":[{"id":411,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/posts\/406\/revisions\/411"}],"wp:attachment":[{"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/media?parent=406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/categories?post=406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.soljerome.com\/blog\/wp-json\/wp\/v2\/tags?post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}