Skip to content
Snippets Groups Projects
Commit c934cf45 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Add build zsh script

parent a411714d
No related branches found
No related tags found
1 merge request!10Add gitlab ci into project
#!/bin/bash
name=zsh
version=5.9
mkdir -p BUILD RPMS SOURCES SPECS SRPMS
prereqs="git epel-release bzip2 xz gzip tar"
rpm -q $prereqs
if [ $? -ne 0 ]; then sudo yum -y install $prereqs; fi
git clone https://src.fedoraproject.org/rpms/${name}.git
cp ${name}/${name}.spec SPECS/
cp ${name}/*.rhs SOURCES/
cp ${name}/dot* SOURCES/
# Perl may not be available, switching to sed
#perl -pi -e 's/^(BuildRequires: glibc-langpack-ja)/#$1/g;' ${name}/${name}.spec
sed -i '/BuildRequires: glibc-langpack-ja/s/^/#/' SPECS/${name}.spec
pkgs="rpm-build $(grep -E '^BuildRequires|^Requires' SPECS/${name}.spec | awk '{print $2}' | tr '\n' ' ')"; echo $pkgs
rpm -q $pkgs
if [ $? -ne 0 ]; then sudo yum install -y $pkgs; fi
if [ ! -f SOURCES/${name}-${version}.tar.xz ] ; then
curl -L -o SOURCES/${name}-${version}.tar.xz https://downloads.sourceforge.net/${name}/${name}-${version}.tar.xz
fi
if [ ! -f SOURCES/${name}-${version}.tar.xz.asc ] ; then
curl -L -o SOURCES/${name}-${version}.tar.xz.asc https://downloads.sourceforge.net/${name}/${name}-${version}.tar.xz.asc
fi
cd SOURCES
sha512sum -c ../${name}/sources
retval=$?
cd -
if [ $retval -ne 0 ]; then
# echo "SOURCES/${name}-${version}.tar.gz did not match checksum in ${name}/source"
exit 1
fi
rpmbuild --define "_topdir `pwd`" -bb SPECS/${name}.spec
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment