This file is indexed.

config is in apt-build 0.12.42.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  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
165
166
167
168
169
#!/bin/sh

set -e

CONFFILE="/etc/apt/apt-build.conf"
build_dir=
repository_dir=
Olevel=
mtune=
options=
make_options=

# load debconf lib
. /usr/share/debconf/confmodule

# load config file
if [ -e $CONFFILE ] ; then
  
  # TODO: instead of sed here to source config file, improve config parsing in
  # config.c for compatibility with shell variables
  tmpfile=$(mktemp)
  cat $CONFFILE > $tmpfile
  sed -i 's|^\([^=]*\) = |\1=|' $tmpfile
  sed -i 's|build-dir|build_dir|; s|repository-dir|repository_dir|' $tmpfile
  
  . $tmpfile
  rm -f $tmpfile
  
  db_set apt-build/build_dir "$build_dir"
  db_set apt-build/repository_dir "$repository_dir"
  
  case "$Olevel" in
    -O1)
      olevel=Light
      ;;
    -O2)
      olevel=Medium
      ;;
    -O3)
      olevel=Strong
      ;;
    *)
      olevel=
      ;;
  esac
  db_set apt-build/olevel "$olevel"
  
  db_set apt-build/archtype "$mtune"
  db_set apt-build/options "$options"
  #db_set apt-build/make_options "$make_options"
fi

ok=
while [ -z "$ok" ] ; do
  db_input medium apt-build/build_dir || true
  db_go || true
  db_get apt-build/build_dir
  if [ -z "$RET" ] ; then
    db_reset apt-build/build_dir
  else
    ok=0
  fi
done

repository_dir=
while [ -z "$repository_dir" ] ; do
  db_input medium apt-build/repository_dir || true
  db_go || true
  db_get apt-build/repository_dir
  if [ -z "$RET" ] ; then
    db_reset apt-build/repository_dir
  else
    repository_dir="$RET"
  fi
done

db_subst apt-build/add_to_sourceslist repo "$RET"

eval $(apt-config shell etcdir Dir::Etc)
eval $(apt-config shell sourceslist Dir::Etc::sourcelist)
eval $(apt-config shell sourcesparts Dir::Etc::sourceparts)

if [ ! -e $CONFFILE ] ; then
  # set to true for initial configuration (conffile does not exist)
  db_set apt-build/add_to_sourceslist "true"
else
  db_set apt-build/add_to_sourceslist "false"
  
  # run loop to prevent errors if some sources does not exist
  for source in /"$etcdir""$sourceslist" /"$etcdir""$sourcesparts"/*.list ; do
    if [ -e "$source" ] ; then
      if grep -Eq "^[[:space:]]*deb file:$repository_dir apt-build main" "$source" ; then
        db_set apt-build/add_to_sourceslist "true"
        break
      fi
    fi
  done
fi

db_input critical apt-build/add_to_sourceslist || true

db_input critical apt-build/olevel || true

db_input medium apt-build/options || true
db_go || true

multithreaded=
if [ -n "$make_options" ] ; then
  multithreaded="$make_options"
elif [ -r /proc/cpuinfo ] && [ ! -e $CONFFILE ] ; then
  # get number of cores and set as default job argument
  multithreaded="-j$(grep -c processor /proc/cpuinfo)"
  # only allow whole numbers
  case "${multithreaded#-j}" in
    ''|*[!0-9]*|0*)
      multithreaded=
      ;;
  esac
fi

db_set apt-build/make_options "$multithreaded"
db_input high apt-build/make_options || true

db_go || true

# get architecture
for i in 1 2 ; do
  # We need to set RET empty in case of /proc/cpuinfo is missing and to support
  # clean archtype (cpu or architecture type)
  RET=
  case "$(dpkg-architecture -qDEB_HOST_ARCH)" in
    i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
	    if [ -r /proc/cpuinfo ] ; then
        case "$(grep 'vendor_id' /proc/cpuinfo | cut -d ':' -f 2 | head -n 1)" in
		      *AMD*)
			      db_input critical apt-build/arch_amd || true
			      db_get apt-build/arch_amd
			      ;;
			    *Intel*)
			      db_input critical apt-build/arch_intel || true
			      db_get apt-build/arch_intel
			      ;;
		    esac
	    fi
	    ;;
	  sparc*)
		  db_input critical apt-build/arch_sparc || true
		  db_get apt-build/arch_sparc
		  ;;
	  alpha)
		  db_input critical apt-build/arch_alpha || true
		  db_get apt-build/arch_alpha
		  ;;
	  arm*)
		  db_input critical apt-build/arch_arm || true
		  db_get apt-build/arch_arm
		  ;;
	  amd64|*-amd64)
		  db_input critical apt-build/arch_amd64 || true
		  db_get apt-build/arch_amd64
		  ;;
  esac
  
  if [ $i -eq 1 ] ; then
    db_go || true
  else
    db_set apt-build/archtype "$RET"
  fi
done