2013-04-27 20:15:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# This script creates texlive.spec from generated specs by tl2rpm
|
|
|
|
# and generates local testing repository from built packages.
|
|
|
|
# Written by Jindrich Novy (novyjindrich@gmail.com).
|
|
|
|
#
|
|
|
|
gcc tl2rpm.c -o tl2rpm -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=native -march=native
|
|
|
|
[ "$?" != "0" ] && exit 1
|
|
|
|
rm -f _mkdirs.spec _unpack.spec _sources.spec _remove.spec _packages.spec _font.spec _files.spec _dirs.spec
|
|
|
|
touch _mkdirs.spec
|
|
|
|
./tl2rpm
|
|
|
|
mv _mkdirs.spec _mkdirs.spec.tmp
|
|
|
|
sort _mkdirs.spec.tmp > _mkdirs.spec
|
|
|
|
rm -f _mkdirs.spec.tmp
|
|
|
|
mv _dirs.spec _dirs.spec.tmp
|
|
|
|
sort _dirs.spec.tmp > _dirs.spec
|
|
|
|
rm -f _dirs.spec.tmp
|
|
|
|
mv _sources.spec _sources.spec.tmp
|
|
|
|
sort _sources.spec.tmp > _sources.spec
|
|
|
|
rm -f _sources.spec.tmp
|
|
|
|
while read LINE; do
|
|
|
|
if [ "${LINE%% *}" = "%include" ]; then
|
|
|
|
cat ${LINE:9}
|
|
|
|
else
|
|
|
|
echo "$LINE"
|
|
|
|
fi
|
2013-05-25 18:22:08 +00:00
|
|
|
done < texlive.spec.template > texlive.spec
|
2013-04-27 20:15:15 +00:00
|
|
|
#exit 0
|
2013-05-25 18:22:08 +00:00
|
|
|
RPMBUILDDIR=`rpm --eval "%_topdir"`
|
|
|
|
rm -f $RPMBUILDDIR/RPMS/noarch/texlive*
|
|
|
|
rm -f $RPMBUILDDIR/RPMS/x86_64/texlive*
|
2013-04-27 20:15:15 +00:00
|
|
|
for i in `ls texlive/archive`; do
|
2013-05-25 18:22:08 +00:00
|
|
|
rm -f $RPMBUILDDIR/SOURCES/$i
|
2013-04-27 20:15:15 +00:00
|
|
|
done
|
2013-05-25 18:22:08 +00:00
|
|
|
ACTDIR=`pwd`
|
2013-04-27 20:15:15 +00:00
|
|
|
for i in `ls texlive/archive`; do
|
2013-05-25 18:22:08 +00:00
|
|
|
ln -s $ACTDIR/texlive/archive/$i $RPMBUILDDIR/SOURCES/$i
|
2013-04-27 20:15:15 +00:00
|
|
|
done
|
|
|
|
LANG=C time rpmbuild -bb texlive.spec > buildlog-srpm 2>&1
|
|
|
|
[ "$?" != "0" ] && exit 1
|
|
|
|
mv buildlog-srpm buildlog-srpm.full
|
|
|
|
rm -rf packages
|
|
|
|
mkdir packages
|
|
|
|
mv RPMS/noarch/texlive* packages
|
|
|
|
mv RPMS/x86_64/texlive* packages
|
|
|
|
createrepo packages
|