docs: @Override
      public Path build(Path dir) throws IOException
      {
          String name = getName();
          lead = new Lead(name);
          addProvide(getString(RPMTAG_NAME), getString(RPMTAG_VERSION), Condition.EQUAL);
          addRequireInt("rpmlib(CompressedFileNames)", "3.0.4-1", Dependency.EQUAL, Dependency.LESS, Dependency.RPMLIB);
          addInt32(RPMTAG_SIZE, getInt32Array(RPMTAG_FILESIZES).stream().collect(Collectors.summingInt((i) -> i)));
          // trailer
          CPIO cpio = new CPIO();
          cpio.namesize = 11;
          fileRecords.add(new FileRecord(cpio, "TRAILER!!!", ByteBuffer.allocate(0)));
          // header
          ByteBuffer hdr = DynamicByteBuffer.create(Integer.MAX_VALUE);
          hdr.order(ByteOrder.BIG_ENDIAN);
          header.save(hdr);
          hdr.flip();
          // payload
          ByteBuffer payload = DynamicByteBuffer.create(Integer.MAX_VALUE);
          payload.order(ByteOrder.BIG_ENDIAN);
          try (final FilterByteBuffer fbb = new FilterByteBuffer(payload, null, GZIPOutputStream::new))
          {
              for (FileRecord fr : fileRecords)
              {
                  fr.save(fbb);
              }
          }
          payload.flip();
          // signature
          MessageDigest md5;
          try
          {
              md5 = MessageDigest.getInstance("MD5");
          }
          catch (NoSuchAlgorithmException ex)
          {
              throw new IOException(ex);
          }
          ByteBuffer dupHdr = hdr.duplicate();
          md5.update(dupHdr);
          ByteBuffer dupPayload = payload.duplicate();
          md5.update(dupPayload);
          byte[] digest = md5.digest();
          setBin(RPMSIGTAG_MD5, digest);
          addInt32(RPMSIGTAG_SIZE, hdr.limit() + payload.limit());
          checkRequiredTags();
          ByteBuffer rpm = DynamicByteBuffer.create(Integer.MAX_VALUE);
          rpm.order(ByteOrder.BIG_ENDIAN);
          lead.save(rpm);
          signature.save(rpm);
          align(rpm, 8);
          rpm.put(hdr);
          rpm.put(payload);
          rpm.flip();
          Path path = dir.resolve("lsb-" + name + ".rpm");
          try (final FileChannel fc = FileChannel.open(path, StandardOpenOption.READ, StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING))
          {
              fc.write(rpm);
          }
          return path;
      }