summaryrefslogtreecommitdiffstats
path: root/php-pear/pear_info_to_details
blob: 04bd443cd1880df7bc6fc4f2cd402f805b2cd14f (plain) (blame)
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
#!/bin/gawk -f

function trim(line,     trimmed_line) {
  trimmed_line = line
  sub(/^ +/, "", trimmed_line)
  sub(/ +$/, "", trimmed_line)
  return trimmed_line
}
/^Latest/ {
  print "         VERSION=" $2
  print "     SOURCE_HASH=''"
  print "         UPDATED=" strftime("%Y%m%d")
}
/^Package/ {
  print "           SPELL=pear-" tolower($2)
  print "    PEAR_PACKAGE=" $2
  print "        WEB_SITE=http://pear.php.net/package/" $2 "/"
}
/^License/ {
  print "      LICENSE[0]=" $2
}
/^Summary/ {
  line = $0
  sub(/^Summary/, "", line)
  print "           SHORT='PEAR: " trim(line) "'"
}
/^Description/ {
  in_description = 1
  print "cat << EOF"
  line = $0
  sub(/^Description/, "", line)
  print trim(line)
}
/^ / {
  if (in_description == 1)
    print trim($0)
}
END {
  print "EOF"
  print ""
  print "source  $SECTION_DIRECTORY/PEAR_DETAILS"
}