mirror of
https://github.com/znc/znc.git
synced 2026-07-01 15:31:52 +02:00
bb9905e99e
Initially by psychon, then kylef modified it and helped to find it when it was lost So let it just lay here in order not to be lost again
53 lines
1.1 KiB
Bash
Executable File
53 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
TMPDIR=`mktemp -d`
|
|
VERSION=$1
|
|
|
|
trap 'rm -rf $TMPDIR' EXIT
|
|
|
|
if [ ! -f include/znc/main.h ] ; then
|
|
echo "Can't find source!"
|
|
exit -1
|
|
fi
|
|
|
|
if [ "x$VERSION" = "x" ] ; then
|
|
AWK_ARG='/#define VERSION_MAJOR/ { maj = $3 }
|
|
/#define VERSION_MINOR/ { min = $3 }
|
|
END { printf "%.1f", (maj + min / 10) }'
|
|
VERSION=$(awk "$AWK_ARG" include/znc/main.h)
|
|
fi
|
|
if [ "x$VERSION" = "x" ] ; then
|
|
echo "Couldn't get version number"
|
|
exit -1
|
|
fi
|
|
|
|
ZNC=znc-$VERSION
|
|
TAR=$ZNC.tar
|
|
TARGZ=$TAR.gz
|
|
|
|
echo "Exporting . to $TMPDIR/$ZNC..."
|
|
git checkout-index --all --prefix=$TMPDIR/$ZNC/
|
|
(
|
|
cd $TMPDIR/$ZNC
|
|
echo "Generating configure"
|
|
AUTOMAKE_FLAGS="--add-missing --copy" ./autogen.sh
|
|
rm -r autom4te.cache/
|
|
mkdir -p modules/.depend
|
|
make -C modules -f modperl/Makefile.gen srcdir=. SWIG=/usr/bin/swig
|
|
make -C modules -f modpython/Makefile.gen srcdir=. SWIG=/usr/bin/swig
|
|
rm -fr modules/.depend
|
|
rm make-tarball.sh
|
|
)
|
|
(
|
|
cd $TMPDIR
|
|
echo "Creating tarball"
|
|
tar -cf $TAR $ZNC
|
|
gzip -9 $TAR
|
|
)
|
|
echo "Done"
|
|
mv $TMPDIR/$TARGZ .
|
|
echo "Signing $TARGZ..."
|
|
gpg --detach-sig $TARGZ
|
|
echo "Created $TARGZ and $TARGZ.sig"
|