#!/bin/bash
# script run inside the container
rpmdev-setuptree
define=""
if [ -z $VERSION ]; then
    echo ""
else 
   define="${define} --define '_version ${VERSION}'"
fi

if [ -z $RELEASE ]; then
    echo ""
else  
    define='$define --define "Release $RELEASE"'
fi

echo $define
sudo cp -arv /media/* rpmbuild/SOURCES/
sudo cp -arv /media/*.spec rpmbuild/SPECS/ 
rpmbuild -ba rpmbuild/SPECS/oscript.spec || exit 1

[[ -d /media ]] || exit 0

sudo mkdir -p /media/RPMS
sudo mkdir -p /media/SRPMS

sudo cp -ar rpmbuild/RPMS/ /media/
sudo cp -ar rpmbuild/SRPMS/ /media/
#!/bin/bash
# script run inside the container
rpmdev-setuptree
define=""
if [ -z $VERSION ]; then
    echo ""
else 
   define="${define} --define '_version ${VERSION}'"
fi

if [ -z $RELEASE ]; then
    echo ""
else  
    define='$define --define "Release $RELEASE"'
fi

echo $define
sudo cp -arv /media/* rpmbuild/SOURCES/
sudo cp -arv /media/*.spec rpmbuild/SPECS/ 
rpmbuild -ba $define rpmbuild/SPECS/oscript.spec || exit 1

[[ -d /media ]] || exit 0

sudo mkdir -p /media/RPMS
sudo mkdir -p /media/SRPMS

sudo cp -ar rpmbuild/RPMS/ /media/
sudo cp -ar rpmbuild/SRPMS/ /media/
--- 
+++ 
@@ -17,7 +17,7 @@
 echo $define
 sudo cp -arv /media/* rpmbuild/SOURCES/
 sudo cp -arv /media/*.spec rpmbuild/SPECS/ 
-rpmbuild -ba rpmbuild/SPECS/oscript.spec || exit 1
+rpmbuild -ba $define rpmbuild/SPECS/oscript.spec || exit 1
 
 [[ -d /media ]] || exit 0
 
Revert "Попытка исправления сборки RPM"

This reverts commit 9fcebfa1e5acec2caf015e95307c79e6aadd652f.
