Skip to content

Instantly share code, notes, and snippets.

@laapsaap
Created February 22, 2018 11:17
Show Gist options
  • Save laapsaap/ff64a79a1f3c10dc06a7d2c54027dbf9 to your computer and use it in GitHub Desktop.
Save laapsaap/ff64a79a1f3c10dc06a7d2c54027dbf9 to your computer and use it in GitHub Desktop.
###
### RPM.CONFIG
###
if [ -f "RPM.CONFIG" ]; then
echo
echo ":::::"
echo "::::: Found RPM.CONFIG, downloading files"
echo ":::::"
echo
. RPM.CONFIG
MATCH=$(curl -s "$SEARCH_URL" | grep -m 1 -o "$REGEX" | head -n 1)
echo
echo ":::::"
echo "::::: Found SRPM: $MATCH"
echo "::::: Download URL: $DOWNLOAD_URL$MATCH"
echo ":::::"
echo
curl -o "$MATCH" "$DOWNLOAD_URL$MATCH"
rpm2cpio "$MATCH" | cpio -imv --no-absolute-filenames
spec_file=$(ls *.spec)
echo
echo ":::::"
echo "::::: Found SPEC file: $spec_file"
echo ":::::"
echo
else
spec_file=$(ls *.spec)
echo
echo ":::::"
echo "::::: Found SPEC file: $spec_file"
echo ":::::"
echo
fi
if [ -f "RPM.SH" ]; then
echo
echo ":::::"
echo "::::: Found RPM.SH, executing custom code"
echo ":::::"
echo
/bin/bash ./RPM.SH
fi
# fix spec file
sed -i -e '/NoSource: 0/d' $spec_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment