#!/bin/bash

PACKAGE=/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/systemd-234-0.x86_64.rpm
FILE=/usr/lib/systemd/system-generators/systemd-cryptsetup-generator

shortname=${FILE##*/}

echo "Trying to extract $shortname from $PACKAGE"
mkdir unpacked
(cd unpacked; rpm2cpio $PACKAGE | cpio -idv .$FILE)
cp unpacked$FILE $shortname
rm -rf unpacked
