File: fix_examples

package info (click to toggle)
afterstep 2.2.12-18.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 33,184 kB
  • sloc: ansic: 201,695; sh: 5,894; xml: 3,721; makefile: 2,094; perl: 1,558; cpp: 811
file content (43 lines) | stat: -rw-r--r-- 1,151 bytes parent folder | download | duplicates (2)
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
41
42
43
#!/bin/sh
set -e

[ -d debian ] || cd ..
[ -d debian ] || cd ..
[ -d debian ] || { echo "Can't find debian directory" ; exit 1; }

found=0
while [ "$1" ]; do
   [ "$1" != "libafterimage-dev" ] || found=1
   shift
done
[ "$found" = "1" ] || exit 0

DESTDIR=debian/libafterimage-dev
DEVEXMPL=usr/share/doc/libafterimage-dev/examples
TMPFILE=debian/_tmp_example

for file in $DESTDIR/$DEVEXMPL/*.[ch]; do
  sed -e 's/\(#include *\)"\.\.\/\(afterbase\.h\)"/\1<libAfterImage\/\2>/g' \
      -e  's/\(#include *\)"\.\.\/\(afterimage\.h\)"/\1<libAfterImage\/\2>/g' \
      -e  's/\(#include *\)"\.\.\/\(char2uni\.h\)"/\1<libAfterImage\/\2>/g' \
      <  "$file" > "$TMPFILE"
  touch -r "$file" "$TMPFILE"
  mv -f "$TMPFILE" "$file"
done

# See Bug#1037278
for file in $DESTDIR/$DEVEXMPL/Makefile*; do
  sed -e '/CFLAGS/s,-[fW][^ ]*\s*,,g' \
      -e 's,/usr\(/bin/cp\),\1,g' \
      -e 's,/usr\(/bin/mv\),\1,g' \
      -e 's,/usr\(/bin/rm\),\1,g' \
      -e 's,/usr\(/bin/mkdir\),\1,g' \
      <  "$file" > "$TMPFILE"
  touch -r "$file" "$TMPFILE"
  mv -f "$TMPFILE" "$file"
done

chmod 644 $DESTDIR/$DEVEXMPL/*
rm -f $DESTDIR/$DEVEXMPL/*.man

# vim:ts=2 et