File: get-orig-source.sh

package info (click to toggle)
fso-frameworkd 0.10.1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,224 kB
  • ctags: 5,231
  • sloc: python: 23,834; sh: 170; sql: 4; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 815 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
REV=e3d6339c5d69e0791c4633f86363159e56126075
VERS=$(dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
NAME=fso-frameworkd
REPO=git://git.freesmartphone.org/framework.git

# switch to tmp directory
rm -rf get-orig-source
mkdir get-orig-source
cd get-orig-source

# get src from git
git clone ${REPO} ${NAME}-${REV}
cd ${NAME}-${REV}
git archive --format=tar --prefix=${NAME}-${VERS}/ ${REV} > ../${NAME}-${VERS}-tmp.tar
cd ..
rm -rf ${NAME}-${REV}
tar xf ${NAME}-${VERS}-tmp.tar
rm ${NAME}-${VERS}-tmp.tar

# generate the orig.tar.gz
GZIP=--best tar czf ../${NAME}_${VERS}.orig.tar.gz ${NAME}-${VERS}
rm -rf ${NAME}-${VERS}

# remove tmp directory
cd ..
rm -rf get-orig-source

echo "  ${NAME}_${VERS}.orig.tar.gz created; move it to the right destination to build the package"