#!/bin/bash -ex

rpm -i https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/35/Everything/source/tree/Packages/w/wireless-tools-29-28.fc35.src.rpm
sed -i ${HOME}/rpmbuild/SPECS/wireless-tools.spec -e "s|%patch|%patch -P |g"
rpmbuild -ba ${HOME}/rpmbuild/SPECS/wireless-tools.spec
sudo rpm -Uvh ${HOME}/rpmbuild/RPMS/*/wireless-tools{,-devel}-29*

#RUN set -x \
# && rpm -i https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/36/Everything/source/tree/Packages/l/libnjb-2.2.7-24.fc36.src.rpm \
# && sed -i ${HOME}/rpmbuild/SPECS/libnjb.spec -e "s|libusb-devel|libusb1-devel|" \
# && rpmbuild -ba ${HOME}/rpmbuild/SPECS/libnjb.spec \
# && sudo rpm -Uvh ${HOME}/rpmbuild/RPMS/*/libnjb{,-devel}-2*
