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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
################################################################
# Document: FAQ
# Purpose : Frequently asked questions
# Author..: Stuart Winter <mozes@slackware.com>
################################################################
# It's small at the moment but if I get any repeated
# or potentially repeated questions then they'll be added
# here.
################################################################
Questions
---------
1. My build script places files into /home, but these are not
included in the package created by slacktrack. Why?
2. Do I really have to remove the existing package before
building a new version with slacktrack ?
3. I want to build a package of DVD libraries and players
but the players depend on the libraries being installed
first. How can I build such a package with slacktrack?
4. I find that when building packages with slacktrack, a number of
files are appearing in the package that do not belong there. Why?
5. What does slacktrack's --touch-filesystem-first option do?
why would I need it?
6. I can't compile Perl CPAN modules via perl -MCPAN -eshell
Why ?
7. I'm using Slackware v13 (or greater) and I want to create
package files using one of the other compression methods.
How can I do that?
8. After completing a build using slacktrack, I see
"You have mail in /var/mail/root"
but I have no new email.
Answers
-------
Q1. My build script places files into /home, but these are not
included in the package created by slacktrack. Why?
A1. slacktrack (by design and thus default) excludes /home
from being included within the package. The reason for this
that typically no package shipped should ever contain
data within /home.
Q2. Do I really have to remove the existing package before
building a new version with slacktrack ?
A. No (see my zlib example), but in the majority of cases,
I'd advise that you do.
The reason that my example trackbuild scripts remove the
existing package first (or bomb out) is because some
package installations (makefiles) will not install a
new file onto the filesystem if it's identical to the
one in the source archive. This means that slacktrack
will not notice any change in the before and after picture
of the filesystem; thus your resulting package may
be missing some files.
The way to work around this is:
1. removepkg the package prior to building;
2. Use the --touch-filesystem-first option;
But this option is not recommended since it destroys the
time stamp information on your system.
This option should only be used by experts using a disposable
OS installation.
Please see FAQ question 5.
It's worth noting that Slackware's 'removepkg' program
won't always remove all files (especially config files
which are packaged as /etc/file.new and are renamed to
/etc/file by install/doinst.sh).
It shouldn't be too much of an issue though. If it's a
brand new piece of software that you are building from
scratch then installwatch will pick up all new files.
If you're rebuilding a Slackware package using a
.build script from the source tree then it's worth
browsing the package's contents ( # cat /var/log/packages/lftp-*
for example ), then running 'removepkg' and looking at its
output. If there are any remaining config files then either
move them to a safe place or delete them before
building your package with slacktrack.
In general though you shouldn't have any problems.
Q3. I want to build a package of DVD libraries and players
but the players depend on the libraries being installed
first. How can I build such a package with slacktrack?
A. There are two ways.
1. You either write build scripts for each individual
library and create packages for each. Once the packages
have been built, you install them prior to building
the player.
You then unarchive all packages into a temporary
directory and run makepkg over it.
2. Use slacktrack and build them all one after another as
you no doubt have originally attempted.
I have included example build scripts for a DVD library
package within slacktrack's source archive.
Q4. I find that when building packages with slacktrack, a number of
files are appearing in the package that do not belong there. Why?
A. The way that slacktrack works is that it:
[a] takes a snapshot of the files and directories on the file system;
[b] runs the build script
[c] makes another snapshot of the files & dirs on the file system;
[d] compares the two snapshots and determines the differences
[e] the differences between the two snapshots constitute the package
contents
The problem with this approach is that other running programs can
make modifications to files & dirs on the file system during the
build/compilation process. slacktrack will consider these modifications
to be part of the package -- slacktrack does not directly track what the
build process does: it *only* compares the differences between the
file system snapshots.
Major culprits for this are:
cups
crond (running cron jobs)
Window Managers and X
When using slacktrack you are advised to reduce the number of
processes to the minimum, and try to ensure that there are no processes
running which will modify the file system during the build process.
If you cannot do this then you there are a number of work arounds:
[a] Using the -x (--exclude) operator.
With this operator you can specify a list of
paths to exclude from the file system snapshots, thus excluding them
from the resulting package.
[b] Use the -R (--run-after) operator.
With this operator you can specify a command that will be run after
slacktrack has compiled the package contents.
You may wish to run 'mc' (Midnight Commander) or perhaps just a 'bash'
shell; this will enable you to inspect and modify the contents of the
package prior to it being turned into a package file.
Q5. What does slacktrack's --touch-filesystem-first option do?
why would I need it?
This option touches all files this pre-set location on the host's
filesystem:
/opt /bin /boot /dev /etc /install /lib /sbin /usr /var
It *excludes* by default '/lib/udev/devices' since this contains
live device data that doesn't take kindly to being touched.
You may see errors from 'touch' about certain binaries, including
/sbin/vol_id because this is a symlink into /lib/udev/devices.
This will touch every file within those directories, destoying all the
timestamp information.
This is intended to be used on a throwaway development installation
that's reinstalled daily or more often. Builds will often leave
residue strewn about, so don't use this on your "good" machine and
think you're managing it properly. :-)
The reason behind this is that if you run slacktrack and your build
partially fails, then it will leave some data on the filesystem.
You then fix the problem and re-try: this time the build may succeed.
However, if the original data on the filesystem from the first
part-failed build has *not* changed (ie if it was some static data that
was copied with cp -a (preserved time stamp & ownership)) between
the first part-failed build and second successful build, slacktrack
will miss this data from the final package.
This option updates the file stamps contained within standard package
directories, therefore allowing slacktrack to detect changes
(even if the data contains an *old* time stamp from 1982, it will still
detect the difference).
***** This is an expert option: Please don't use this option unless you do
not care about your operating system installation *****
Q6. I can't compile Perl CPAN modules via perl -MCPAN -eshell
Why ?
A. If you get this message:
Unable to get Terminal Size. The TIOCGWINSZ ioctl didn't work.
The COLUMNS and LINES environment variables didn't work.
The resize program didn't work.
the answer is to tell slacktrack to turn off logging.
eg:
# slacktrack -Qnp foo-1.0-i486-2.tgz ./foo.build
Q7. I'm using Slackware v13 (or greater) and I want to create
package files using one of the other compression methods.
How can I do that?
A. It is 'makepkg' from the 'pkgtools' package which handles
the compression, based upon the extension of the package
file name supplied to it.
The compression methods & file names are:
.tgz - Gzip
.tbz - Bzip2
.tlz - LZMA
.txz - XZ
Examples:
# slacktrack -Qp foo-1.0-i486-1.tgz ./foo.build
# slacktrack -Qp foo-1.0-i486-1.tbz ./foo.build
# slacktrack -Qp foo-1.0-i486-1.tlz ./foo.build
# slacktrack -Qp foo-1.0-i486-1.txz ./foo.build
Q8. After completing a build using slacktrack, I see
"You have mail in /var/mail/root"
but I have no new email.
A. This is because you used the '--touch-filesystem-first' or
'--touch-filesystem-faster' option at build time.
This option has touched all of the files on the file system, which
refreshes their date stamp. The mail notification system works only on
the date stamp of the mail spools, hence it triggers the message.
|