-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·194 lines (172 loc) · 6.89 KB
/
configure
File metadata and controls
executable file
·194 lines (172 loc) · 6.89 KB
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#!/usr/bin/env python
import pacman, os, sys
from optparse import OptionParser
# since we're in chroot, we no longer have to check for up to date libs.
libs = []
packages = ['parted', 'pacman-g2', 'bash', 'kernel', 'busybox', 'dialog', 'e2fsprogs',
'eject', 'frugalware', 'glibc', 'kbd', 'kmod',
'ncurses', 'netkit-base', 'systemd',
'util-linux', 'mdadm', 'xfsprogs', 'ppp', 'rp-pppoe', 'glib2',
'bzip2', 'libarchive', 'zlib', 'frugalwareutils', 'lzma',
'wireless_tools', 'dropbear', 'bastet', 'libboost',
'readline', 'shadow', 'xfsprogs-acl', 'xfsprogs-attr',
'device-mapper', 'lvm2', 'dbus', 'wpa_supplicant', 'libnl', 'openssl', 'pciutils',
'b43-fwcutter', 'libblkid', 'libuuid', 'expat', 'xz' ]
if os.uname()[-1] in ['i686', 'x86_64']:
packages.extend(['reiserfsprogs', 'ipw2200-firmware', 'acx100', 'madwifi', 'linux-firmware',
'libgcc', 'libstdc++', 'icu4c', 'gptfdisk', 'btrfs-progs', 'jfsutils' ])
elif os.uname()[-1] == 'ppc':
packages.extend(['mac-fdisk'])
# when releasing a new setup, please update this.
version = "1.3.1"
# parse our options
parser = OptionParser(version="configure for Frugalware Setup v%s" % (version))
parser.set_defaults(debug=False)
parser.set_defaults(usb=False)
parser.set_defaults(tftp=False)
parser.set_defaults(repo="current")
parser.set_defaults(prefix="/usr/local")
parser.add_option("--with-debug", action="store", dest="debug", help="Build setup with debug options. Can be no (default), gdb or valgrind")
parser.add_option("--enable-usb", action="store_true", dest="usb", help="Build usb installer image")
parser.add_option("--disable-usb", action="store_false", dest="usb", help="Don't build usb installer image (default)")
parser.add_option("--enable-tftp", action="store_true", dest="tftp", help="Build tftp installer image")
parser.add_option("--disable-tftp", action="store_false", dest="tftp", help="Don't build tftp installer image (default)")
parser.add_option("--repo", action="store", dest="repo", help="Select the repo to build for. Can be current (default), testing or stable")
parser.add_option("--prefix", action="store", dest="prefix", help="Select the install prefix (defaults to /usr/local)")
parser.add_option("--enable-gui", action="store_true", dest="gui", help="Build Fwife installer image")
(options, args) = parser.parse_args()
# if we want the gui image, add appropriate package and remove useless ones
if options.gui:
packages.extend(['coreutils', 'tzdata', 'libxau', 'libxcb', 'libxdmcp', 'libx11', 'libfontenc', 'libxfont', 'libxext',
'libxrender', 'libxrandr', 'libxft', 'libxpm', 'libxkbfile', 'libice', 'libsm', 'pixman', 'libpciaccess',
'setxkbmap', 'xkbcomp', 'xkeyboard-config', 'xorg-server-minimal', 'xf86-input-evdev', 'libffi',
'xf86-video-vesa', 'freetype2', 'fontconfig', 'shared-mime-info', 'xloadimage', 'libxml2', 'atk',
'libpng', 'libjpeg', 'libstdc++', 'libgcc', 'libsigc++2', 'openbox-minimal', 'gdk-pixbuf2-minimal',
'cairo-minimal', 'pango-minimal', 'gtk+2-minimal', 'fwife-minimal', 'glibmm', 'cairomm-minimal',
'pangomm-minimal', 'gtkmm-minimal', 'gparted-minimal', 'dejavu-ttf', 'fwifecd-config', 'xf86-video-ati',
'xf86-video-geode', 'xf86-video-intel', 'xf86-video-nouveau', 'xf86-video-openchrome', 'libdrm',
'nouveau-firmware'])
packages.remove('bastet')
packages.remove('dialog')
# if we want debug then we should add gdb and it's dependencies
sys.stdout.write("checking for debug support... ")
sys.stdout.flush()
if options.debug == "gdb":
sys.stdout.write("gdb.\n")
sys.stdout.flush()
packages.append('gdb')
packages.append('python')
elif options.debug == "valgrind":
sys.stdout.write("valgrind.\n")
sys.stdout.flush()
packages.append('valgrind')
else:
sys.stdout.write("no.\n")
sys.stdout.flush()
sys.stdout.write("checking for usb support... ")
if options.usb:
sys.stdout.write("yes.\n")
sys.stdout.flush()
else:
sys.stdout.write("no.\n")
sys.stdout.flush()
sys.stdout.write("checking for tftp support... ")
if options.tftp:
sys.stdout.write("yes.\n")
sys.stdout.flush()
else:
sys.stdout.write("no.\n")
sys.stdout.flush()
sys.stdout.write("checking for gui support... ")
if options.gui:
sys.stdout.write("yes.\n")
sys.stdout.flush()
else:
sys.stdout.write("no.\n")
sys.stdout.flush()
def pkgGetVers(db, names, ret={}):
lp = pacman.db_getpkgcache(db)
while lp:
pkg = pacman.void_to_PM_PKG(pacman.list_getdata(lp))
pkgname = pacman.void_to_char(pacman.pkg_getinfo(pkg, pacman.PKG_NAME))
if pkgname in names and pkgname not in ret:
ret[pkgname] = pkgname = pacman.void_to_char(pacman.pkg_getinfo(pkg, pacman.PKG_VERSION))
lp = pacman.list_next(lp)
return ret
try:
os.unlink('config.mak')
except OSError:
pass
if pacman.initialize("/") == -1:
raise "failed to init the pacman lib"
if options.repo == "stable":
remote = pacman.db_register("frugalware")
else:
remote = pacman.db_register("frugalware-current")
local = pacman.db_register("local")
sys.stdout.write("reading the remote database... ")
sys.stdout.flush()
remotevers = pkgGetVers(remote, libs)
sys.stdout.write("done.\nreading the local database... ")
sys.stdout.flush()
localvers = pkgGetVers(local, libs)
sys.stdout.write("done.\n")
sys.stdout.flush()
for k, v in remotevers.items():
sys.stdout.write("checking for host %s... " % k)
if remotevers[k] != localvers[k]:
sys.stdout.write("failed, please do a 'pacman-g2 -S %s'\n" % k)
sys.exit(1)
else:
sys.stdout.write("done.\n")
remotevers = pkgGetVers(remote, packages, remotevers)
socket = open("config.mak", "w")
# write out our required options
socket.write("VERSION = %s\n" % version)
if options.debug:
socket.write("DEBUG = %s\n" % options.debug)
else:
socket.write("DEBUG = false\n")
if options.usb:
socket.write("USB = true\n")
else:
socket.write("USB = false\n")
if options.tftp:
socket.write("TFTP = true\n")
else:
socket.write("TFTP = false\n")
if options.gui:
socket.write("GUI = true\n")
else:
socket.write("GUI = false\n")
socket.write("PREFIX = %s\n" % options.prefix)
# check whether stable or testing was requested
sys.stdout.write("checking which repo to build for... ")
sys.stdout.flush()
if options.repo == "current":
sys.stdout.write("current\n")
socket.write("STABLE = false\nTESTING = false\n\n")
elif options.repo == "testing":
sys.stdout.write("testing\n")
socket.write("STABLE = false\nTESTING = true\n\n")
elif options.repo == "stable":
sys.stdout.write("stable\n")
socket.write("STABLE = true\nTESTING = false\n\n")
else:
sys.stdout.write("invalid repo specified!\n")
sys.exit(1)
# write the package versions
for k, v in localvers.items():
print "checking for %s... %s" % (k, v)
socket.write("%sVER = %s\n" % (k.upper(), v))
socket.write("\n")
# write the package and source arrays
socket.write("packages = \\\n")
for k, v in localvers.items():
socket.write("\t %s \\\n" % k)
socket.write("\t \n")
socket.write("sources = \\\n")
for k, v in localvers.items():
socket.write("\t %s-$(%sVER)-$(CARCH).fpm \\\n" % (k, k.upper()))
socket.write("\t \n")
socket.close()