[go: up one dir, main page]

File: msdos.sh

package info (click to toggle)
a2ps 1%3A4.14-1.3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 13,324 kB
  • sloc: ansic: 26,966; sh: 11,844; lex: 2,286; perl: 1,156; yacc: 757; makefile: 609; lisp: 398; ada: 263; objc: 189; f90: 109; ml: 85; sql: 74; pascal: 57; modula3: 33; haskell: 32; sed: 30; java: 29; python: 24
file content (40 lines) | stat: -rwxr-xr-x 1,093 bytes parent folder | download | duplicates (14)
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
32
33
34
35
36
37
38
39
40
#! /bin/sh

#
# Take a configure'd package.tar.gz, and make it better for msdos.
#
test $# = 1 || exit 1

thisdir=`pwd`
tarball=$thisdir/$1
package=`echo $1 | sed 's/\.tar\.gz//g;s#.*/##g'`
msdos=`echo $package | sed -e 's/[-.]//g'`

cd /tmp
rm -rf $package
gunzip -cd $tarball | tar xvf - || exit 1
cd /tmp/$package || exit 1


#################### We are in the package.  Patch what we need to patch
# 1. config.h.in is two dots long
perl -pi -e 's/config\.h/config.h:config.hin/g' configure.in || exit 1
mv config.h.in config.hin

# 2. po/Makefile.in.in has 2 dots
sed -e 's/Makefile\.in\.in/Makefile.in2/g' \
    -e 's|$(subdir)/$@.in|$(subdir)/$@.in:$(subdir)/$@.in2|g' \
    po/Makefile.in.in > po/Makefile.in2
perl -pi -e 's#po/Makefile\.in#po/Makefile.in:po/Makefile.in2#' configure.in


################################################ Reconfigure the package
automake || exit 1
autoconf || exit 1

# Rebuild the package
cd /tmp
mv $package $msdos
tar cvf $thisdir/$msdos.tar $msdos || exit 1
gzip $thisdir/$msdos.tar || exit 1
mv $thisdir/$msdos.tar.gz $thisdir/$msdos.tgz || exit 1