File: dist

package info (click to toggle)
dtc 0.35.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 18,824 kB
  • sloc: php: 50,739; sh: 8,596; makefile: 572; perl: 148; xml: 25
file content (30 lines) | stat: -rwxr-xr-x 804 bytes parent folder | download
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
29
30
#!/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`-core

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}
mv ${TMPDIR}/${DIRNAME}/dtc.spec ${TMPDIR}/${DIRNAME}/dtc-core.spec
sed -i "s/__VERSION__/${VERS}/" ${TMPDIR}/${DIRNAME}/${PKGNAME}.spec
mv ${TMPDIR}/${DIRNAME}/${PKGNAME}.spec ${TMPDIR}/${DIRNAME}/${PKGNAME}-core.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}