File: fixdeb

package info (click to toggle)
fpc 2.6.0-9
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 199,972 kB
  • sloc: pascal: 1,943,447; makefile: 977,517; xml: 131,522; ansic: 9,617; asm: 7,655; yacc: 3,745; php: 3,268; lex: 2,537; sh: 2,278; sql: 267; cpp: 145; sed: 132; perl: 126; csh: 34; tcl: 7
file content (31 lines) | stat: -rw-r--r-- 1,052 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
31
#!/bin/bash
#
# Create debian files from *.in files
#

#set -x
if [ $# -lt 3 ]; then
  echo 'Usage : fixdeb <path> <target> <ppcbin> [package priority]'
  echo '        $1 = path to debian files'
  echo '        $2 = fpc target (i386-linux)'
  echo '        $3 = ppcXXX binary name (ppc386)'
  echo '        $4 = package priority in alternative system'
  exit 1
fi

DEB_SUBST_PACKAGEVERSION=`dpkg-parsechangelog | sed -ne's,^Version: \(.*\),\1,p'`
DEB_SUBST_VERSION=`echo $DEB_SUBST_PACKAGEVERSION | sed -ne's,^\([0-9.]*\).*,\1,p'`
DEB_SUBST_DEBVERSION=`echo $DEB_SUBST_PACKAGEVERSION | awk -F '-' '{ print $NF }'`
DEB_SUBST_SVNPATH=`echo $DEB_SUBST_VERSION | awk -F '.' '{ print "release_"$1"_"$2"_"$3 }'`
DEB_SUBST_TARGET="$2"
DEB_SUBST_PPCBIN="$3"
DEB_SUBST_PACKAGESUFFIX=${PACKAGESUFFIX}
DEB_SUBST_PRIORITY=${4:-$(echo ${DEB_SUBST_VERSION} | sed -e 's/\.//g')}

SUBST_CMD=`set | sed -n -e 's/^DEB_SUBST_\([A-Z_]\+\)=\(.*\)/-e s@\${\1}@\2@g/p'`

for i in $1/*.in
do
  j=`basename ${i} .in`
  sed ${SUBST_CMD} ${i} > $1/${j/./${PACKAGESUFFIX}.}
done