PyBitmessage-2021-04-27/packages/unmaintained/rpm.sh

54 lines
1.8 KiB
Bash
Raw Permalink Normal View History

2013-07-12 11:36:28 +02:00
#!/bin/bash
APP=pybitmessage
2014-11-02 14:21:51 +01:00
PREV_VERSION=0.4.4
VERSION=0.4.4
2013-07-12 11:36:28 +02:00
RELEASE=1
SOURCEDIR=.
ARCH_TYPE=`uname -m`
CURRDIR=`pwd`
SOURCE=~/rpmbuild/SOURCES/${APP}_${VERSION}.orig.tar.gz
# Update version numbers automatically - so you don't have to
sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' Makefile debian.sh arch.sh puppy.sh ebuild.sh slack.sh
sed -i 's/Version: '${PREV_VERSION}'/Version: '${VERSION}'/g' rpmpackage/${APP}.spec
sed -i 's/Release: '${RELEASE}'/Release: '${RELEASE}'/g' rpmpackage/${APP}.spec
sed -i 's/pkgrel='${RELEASE}'/pkgrel='${RELEASE}'/g' archpackage/PKGBUILD
sed -i 's/pkgver='${PREV_VERSION}'/pkgver='${VERSION}'/g' archpackage/PKGBUILD
sed -i "s/-${PREV_VERSION}-/-${VERSION}-/g" puppypackage/*.specs
sed -i "s/|${PREV_VERSION}|/|${VERSION}|/g" puppypackage/*.specs
sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' puppypackage/pinstall.sh puppypackage/puninstall.sh
sed -i 's/-'${PREV_VERSION}'.so/-'${VERSION}'.so/g' debian/*.links
sudo yum groupinstall "Development Tools"
sudo yum install rpmdevtools
2014-11-02 14:21:51 +01:00
# setup the rpmbuild directory tree
2013-07-12 11:36:28 +02:00
rpmdev-setuptree
2014-11-02 14:21:51 +01:00
# create the source code in the SOURCES directory
2013-07-12 11:36:28 +02:00
make clean
mkdir -p ~/rpmbuild/SOURCES
rm -f ${SOURCE}
2014-11-02 14:21:51 +01:00
# having the root directory called name-version seems essential
2013-07-12 11:36:28 +02:00
mv ../${APP} ../${APP}-${VERSION}
tar -cvzf ${SOURCE} ../${APP}-${VERSION} --exclude-vcs
2014-11-02 14:21:51 +01:00
# rename the root directory without the version number
2013-07-12 11:36:28 +02:00
mv ../${APP}-${VERSION} ../${APP}
2014-11-02 14:21:51 +01:00
# copy the spec file into the SPECS directory
2013-07-12 11:36:28 +02:00
cp -f rpmpackage/${APP}.spec ~/rpmbuild/SPECS
2014-11-02 14:21:51 +01:00
# build
2013-07-12 11:36:28 +02:00
cd ~/rpmbuild/SPECS
rpmbuild -ba ${APP}.spec
cd ${CURRDIR}
# Copy the results into the rpmpackage directory
mkdir -p rpmpackage/${ARCH_TYPE}
cp -r ~/rpmbuild/RPMS/${ARCH_TYPE}/${APP}* rpmpackage/${ARCH_TYPE}
cp -r ~/rpmbuild/SRPMS/${APP}* rpmpackage