<div dir="ltr">I want to pack linux 64bit rpm on macos x.  To do this I make tmproot folder with all binaries in it and need to pack contents of this folder to package.<div><br></div><div>There are problems building rpm4 on mac os x and rpm5 is not compatible with rpm4 specs, so I'm writing right now implementation of simple rpm packer:  directory -> rpm.</div>
<div><br></div><div>I can pack lead, signature (with 4 bytes padding), header, but I have several problems later:</div><div><br></div><div>1) how do I need to calculate sha1 header in signature?  md5 is calculated from header+cpio_payload, but sha1 is more complex.</div>
<div><br></div><div>If I don't put sha1 then vanilla rpm on Centos6 says that:</div><div><br></div><div><div>headerRead failed: Header sanity check: OK</div></div><div><br></div><div>When I compile rpm from source it can install package without sha1 header.</div>
<div><br></div><div><br></div><div>2) I'm packing files with cpio and then call xz on this cpio file, but still rpm claims that: </div><div><br></div><div>unpacking of archive failed: cpio: Bad magic<br></div><div><br>
</div><div>it happens in fsmSetup function. This cpio.xz file is starting from bytes: 253,55,122,88,90,0,0,10,225</div><div><br></div><div>Why can it be bad magic?</div><div><br></div><div><br></div></div>