|
|
@ -1,4 +1,9 @@ |
|
|
|
#!/bin/sh |
|
|
|
#!/bin/sh |
|
|
|
|
|
|
|
mkdir -p ~/RPM/SOURCES |
|
|
|
|
|
|
|
mkdir -p ~/RPM/SPECS |
|
|
|
|
|
|
|
mkdir -p ~/RPM/BUILD |
|
|
|
|
|
|
|
mkdir -p ~/RPM/RPMS |
|
|
|
|
|
|
|
mkdir -p ~/RPM/SRPMS |
|
|
|
rm -rf ~/RPM/BUILD/* |
|
|
|
rm -rf ~/RPM/BUILD/* |
|
|
|
rm -rf ~/RPM/RPMS/* |
|
|
|
rm -rf ~/RPM/RPMS/* |
|
|
|
rm -rf ~/RPM/SOURCES/* |
|
|
|
rm -rf ~/RPM/SOURCES/* |
|
|
@ -9,8 +14,12 @@ do |
|
|
|
v=$(cat $i | grep Version | cut -c 9- | sed 's/ *//g') |
|
|
|
v=$(cat $i | grep Version | cut -c 9- | sed 's/ *//g') |
|
|
|
n=$(basename -s .spec $i) |
|
|
|
n=$(basename -s .spec $i) |
|
|
|
d=$n-$v |
|
|
|
d=$n-$v |
|
|
|
|
|
|
|
if [ -d $n ]; then |
|
|
|
|
|
|
|
cp -fr $n $d |
|
|
|
tar -cvf $d.tar $d |
|
|
|
tar -cvf $d.tar $d |
|
|
|
mv -f $d.tar ~/RPM/SOURCES/ |
|
|
|
mv -f $d.tar ~/RPM/SOURCES/ |
|
|
|
|
|
|
|
rm -rf $d |
|
|
|
|
|
|
|
fi |
|
|
|
cp -f $i ~/RPM/SPECS/ |
|
|
|
cp -f $i ~/RPM/SPECS/ |
|
|
|
rpm -ba ~/RPM/SPECS/$i |
|
|
|
rpm -ba ~/RPM/SPECS/$i |
|
|
|
done |
|
|
|
done |
|
|
|