File: dist

package info (click to toggle)
mysqmail 0.4.9-10.4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 428 kB
  • sloc: ansic: 1,340; sh: 695; makefile: 132
file content (28 lines) | stat: -rwxr-xr-x 649 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

set -e
set -x

VERS=`head -n 1 debian/changelog | cut -d'(' -f2 | cut -d')' -f1 | cut -d'-' -f1`
PKGNAME=`head -n 1 debian/changelog | cut -d' ' -f1`

if [ -e /etc/redhat-release ] ; then
	MKTEMP="mktemp -d -p /tmp"
else
	MKTEMP="mktemp -d -t"
fi
TMPDIR=`${MKTEMP} ${PKGNAME}.XXXXXX`

DIRNAME=${PKGNAME}-${VERS}

MYCWD=`pwd`
mkdir -p ${TMPDIR}/${DIRNAME}
cp -auxf * ${TMPDIR}/${DIRNAME}
sed -i "s/__VERSION__/${VERS}/" ${TMPDIR}/${DIRNAME}/${PKGNAME}.spec
rm -rf ${TMPDIR}/${DIRNAME}/debian
rm -rf ${TMPDIR}/${DIRNAME}/.git
cd ${TMPDIR}
tar -czf ${DIRNAME}.tar.gz ${DIRNAME}
cd ${MYCWD}
mv ${TMPDIR}/${DIRNAME}.tar.gz ..
rm -rf ${TMPDIR}