File: modifysrc.in

package info (click to toggle)
linbot 0.8-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 140 kB
  • ctags: 5
  • sloc: sh: 602; makefile: 126; perl: 7
file content (164 lines) | stat: -rw-r--r-- 6,190 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/bin/sh
#
# source:
#   /var/cvs/projects/debian/linbot/debian/dpkg.scripts/modifysrc.in,v
#
# revision:
#   @(#) modifysrc.in,v 1.5 1998/09/12 21:58:16 jplejacq Exp
#
# copyright:
#   Copyright (C) 1998 Jean Pierre LeJacq <jplejacq@quoininc.com>
#
#   Distributed under the GNU GENERAL PUBLIC LICENSE.
#
# synopsis:
#   modifysrc -p <DH_DOPACKAGES> -P <DH_TMPDIR>
#
# description:
#   Modification program for package pristine source
#
#   The changes made to the pristine source for this debian package
#   have been parameterized to support relocation of the files.  All
#   installed file and directory locations are specified in
#   debian/dpkg.scripts/substfiles.  This program reads that file and
#   takes each file in debian/src and makes the required
#   modifications.
#
#   I've implemented argument parsing with the debhelper package.  The
#   sourced file, dh_lib, will define the two arguments.


# main:
  set -e


  echo "${0}: parsing arguments..."
    PATH=debian:${PATH}:/usr/lib/debhelper

    . /usr/lib/debhelper/dh_lib


  echo "${0}: configuring for selected package..."
    if   [ "@@pkg@@" = "${DH_DOPACKAGES}" ]
    then
      readonly rules_srcdir="debian/${DH_DOPACKAGES}.src"
    else
      echo "${0}: unknown package..."
      exit 1
    fi


  echo "${0}: unpacking source..."
    if [ ! -d "${rules_srcdir}" ]
    then
      tar -z -x -f ../@@pkg@@-@@ver@@.orig.tar.gz
      mv @@f_pkg_src_unpacked@@ ${rules_srcdir}
    fi


  echo "${0}: modifying source..."
    if [ ! -f "${rules_srcdir}/linbot.py.in" ]
    then
      mv ${rules_srcdir}/linbot.py ${rules_srcdir}/linbot.py.in
    fi

      sed -e "\
        s^/usr/local/bin/python^@@f_host_python@@^;\
      "\
      ${rules_srcdir}/linbot.py.in > ${rules_srcdir}/linbot.py


    if [ ! -f "${rules_srcdir}/myUrlLib.py.in" ]
    then
      mv ${rules_srcdir}/myUrlLib.py ${rules_srcdir}/myUrlLib.py.in
    fi

      sed -e "\
        s^\#!/usr/local/bin/python^^;\
      "\
      ${rules_srcdir}/myUrlLib.py.in > ${rules_srcdir}/myUrlLib.py


    if [ ! -f "${rules_srcdir}/config.py.in" ]
    then
      mv ${rules_srcdir}/config.py ${rules_srcdir}/config.py.in
    fi

      sed -e "\
        s^\#SITE_MAP_IMAGE     = 'map.gif'^SITE_MAP_IMAGE='file:@@d_pkg_lib_images@@/buttons/map.gif'^;\
         s^SITE_MAP_IMAGE     = None^^;\
         s^\#BAD_LINKS_IMAGE    = 'broken.gif'^BAD_LINKS_IMAGE='file:@@d_pkg_lib_images@@/buttons/broken.gif'^;\
         s^BAD_LINKS_IMAGE    = None^^;\
         s^\#IMAGE_IMAGE        = 'images.gif'^IMAGE_IMAGE='file:@@d_pkg_lib_images@@/buttons/images.gif'^;\
         s^IMAGE_IMAGE        = None^^;\
         s^\#OLD_URL_IMAGE      = 'old.gif'^OLD_URL_IMAGE='file:@@d_pkg_lib_images@@/buttons/old.gif'^;\
         s^OLD_URL_IMAGE      = None^^;\
         s^\#NEW_URL_IMAGE      = 'new.gif'^NEW_URL_IMAGE='file:@@d_pkg_lib_images@@/buttons/new.gif'^;\
         s^NEW_URL_IMAGE      = None^^;\
         s^\#NO_TITLES_IMAGE    = 'titles.gif'^NO_TITLES_IMAGE='file:@@d_pkg_lib_images@@/buttons/titles.gif'^;\
         s^NO_TITLES_IMAGE    = None^^;\
         s^\#EXTERNAL_IMAGE     = 'external.gif'^EXTERNAL_IMAGE='file:@@d_pkg_lib_images@@/buttons/external.gif'^;\
         s^EXTERNAL_IMAGE     = None^^;\
         s^\#PROBLEMS_IMAGE     = 'problems.gif'^PROBLEMS_IMAGE='file:@@d_pkg_lib_images@@/buttons/problems.gif'^;\
         s^PROBLEMS_IMAGE     = None^^;\
         s^\#NOT_CHECKED_IMAGE    = 'notchked.gif'^NOT_CHECKED_IMAGE='file:@@d_pkg_lib_images@@/buttons/notchked.gif'^;\
         s^NOT_CHECKED_IMAGE    = None^^;\
         s^LOGO_HREF=\"http://home1.gte.net/marduk/linbot/linbot.gif\"^LOGO_HREF=\"file:@@d_pkg_lib_images@@/logos/linbot.gif\"^;\
         s^LINBOT_IMAGE       = None^LINBOT_IMAGE='file:@@d_pkg_lib_images@@/buttons/linbot.gif'^;\
      "\
      ${rules_srcdir}/config.py.in > ${rules_srcdir}/config.py


    if [ ! -f "${rules_srcdir}/contrib/linbot.1.in" ]
    then
      mv ${rules_srcdir}/contrib/linbot.1 ${rules_srcdir}/contrib/linbot.1.in
    fi

      sed -e "\
        s^examine a hyperdocument for bad links^WWW site link checker^;\
        s^http://www.someplaceonthenet.com^www2.someplaceonthenet.com^;\
      "\
      ${rules_srcdir}/contrib/linbot.1.in > ${rules_srcdir}/contrib/linbot.1



    if [ ! -f "${rules_srcdir}/docs.html.in" ]
    then
      mv ${rules_srcdir}/docs.html ${rules_srcdir}/docs.html.in
    fi

      sed -e "\
           s^<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">^<!doctype html public \"-//IETF//DTD HTML 3.2S Draft//EN\">^;\
           s^ type=\"text/css\"^^;\
           s^body background=\"blackbar.gif\" ^body ^;\
           s^<a name=\"top\"></a>^^;\
           s^<img alt=\"Linbot\" src=\"linbot.gif\" alt=\"Linbot\">^<a name=\"top\"><img src=\"file:@@d_pkg_lib_images@@/logos/linbot.gif\" width=\"339\" height=\"101\" alt=\"linbot\"></a>^;\
           s^-C /usr/local/lib^-C @@d_pkg_lib@@^g;\
           s^-C /usr/local/bin^-C @@d_pkg_bin@@^g;\
           s^/usr/local/lib/linbot^@@d_pkg_lib@@^g;\
           s^<main>^\&lt\;main\&gt\;^g;\
           s^<location>^\&lt\;location\&gt\;^g;\
         47d;
         48s^<p>^<li><p>^;\
         58d;
         59s^<p>^<li><p>^;\
         76d;
         77s^<p>^<li><p>^;\
        153d;
        154s^http^<a href=\"http://info.webcrawler.com/mak/projects/robots/exclusion-admin.html\">http^;\
           s^a href=\"mail.html\">^a href=\"@@url_pkg_dir@@/mail.html\">mailing list</a>.^;\
           s^mailing list</a>.  ^^;\
           s^href=\"index.html\"^href=\"@@url_pkg_dir@@/index.html\" alt=\"index\"^;\
           s^href=\"download.html\"^href=\"@@url_pkg_dir@@/download.html\" alt=\"download\"^;\
           s^href=\"docs.html\"^href=\"@@url_pkg_dir@@/docs.html\" alt=\"documentation\"^;\
           s^href=\"samples.html\"^href=\"@@url_pkg_dir@@/samples.html\" alt=\"samples\"^;\
           s^165\" href=\"mail.html\"^165\" href=\"@@url_pkg_dir@@/mail.html\" alt=\"mail\"^;\
           s^href=\"avail.html\"^href=\"@@url_pkg_dir@@/avail.html\" alt=\"available\"^;\
          5i\\
    <link rev=\"made\" href=\"mailto:marduk@starship.skyport.net\">

      "\
      ${rules_srcdir}/docs.html.in > ${rules_srcdir}/docs.html


  exit 0