PyBitmessage-2021-04-27/arch.sh
Jonathan Warren a20cff425c Merge pull request #425 from rakoo/fix-archpackage
Fix Archlinux package creation
2013-08-25 13:15:06 -07:00

38 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
GIT_APP=PyBitmessage
APP=pybitmessage
PREV_VERSION=0.3.5
VERSION=0.3.5
RELEASE=1
ARCH_TYPE=any
CURRDIR=`pwd`
SOURCE=archpackage/${APP}-${VERSION}.tar.gz
# Update version numbers automatically - so you don't have to
sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' Makefile debian.sh rpm.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
# Create the source code
make clean
rm -f archpackage/*.gz
# having the root directory called name-version seems essential
mv ../${GIT_APP} ../${APP}-${VERSION}
tar -cvzf ${SOURCE} ../${APP}-${VERSION} --exclude-vcs
# rename the root directory without the version number
mv ../${APP}-${VERSION} ../${GIT_APP}
# calculate the MD5 checksum
CHECKSM=$(md5sum ${SOURCE})
sed -i "s/md5sums[^)]*)/md5sums=(${CHECKSM%% *})/g" archpackage/PKGBUILD