aboutsummaryrefslogtreecommitdiff
path: root/patches/bin/bin.SlackBuild
blob: 9ff96d66d128ed9044d5d65e6be514205dc46f10 (plain)
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
#!/bin/bash
#
# got it from ftp://ftp.slackware.com/pub/slackware/slackware-10.2/patches/source/bin/bin.SlackBuild
# small changes by rhatto
#

# Set initial variables:

CWD="`pwd`"

if [ -f ~/.slackbuildrc ]; then
  source ~/.slackbuildrc
elif [ -f /etc/slackbuildrc ]; then
  source /etc/slackbuildrc
fi

PACKAGE="bin"
VERSION=10.2
ARCH=${ARCH:=i486}
BUILD="1rha"
SRC_DIR=${SRC:=$CWD}
TMP=${TMP:=/tmp}
REPOS=${REPOS:=$TMP}

DUTILS=2.7
DOSFS=2.10
WHICH=2.16
EJECT=2.1.4
FILE=4.15

TMP="$TMP/$PACKAGE"
PKG=$TMP/package-bin
rm -rf $PKG
mkdir -p $PKG

SRC_DIR="$SRC_DIR/$PACKAGE"
mkdir -p $SRC_DIR

# REPO="ftp://ftp.slackware.com/pub/slackware/slackware-10.2/patches/source/bin"
REPO="ftp://mirror.pacific.net.au/linux/slackware/slackware-10.2/patches/source/bin"
if [ "$GET" != "no" ]; then ( cd $SRC_DIR && ncftpget $REPO/*gz ) ; fi

if [ "$ARCH" == "x86_64" ]; then
  LIB="lib64"
else
  LIB="lib"
fi

# Explode the package framework:
cd $PKG
explodepkg $SRC_DIR/_bin.tar.gz

echo "+=============+"
echo "| debianutils |"
echo "+=============+"
cd $TMP
tar xzvf $SRC_DIR/debianutils_$DUTILS.tar.gz
cd debianutils-$DUTILS
chown -R root.root .
./configure --prefix=/usr
make || exit 32
## We actually use our own very simple run-parts script instead...
#cat run-parts > $PKG/usr/bin/run-parts
#cat run-parts.8 | gzip -9c > $PKG/usr/man/man8/run-parts.8.gz
cat mktemp > $PKG/usr/bin/mktemp
cat mktemp.1 | gzip -9c > $PKG/usr/man/man1/mktemp.1.gz
cat savelog > $PKG/usr/bin/savelog
cat savelog.8 | gzip -9c > $PKG/usr/man/man8/savelog.8.gz
cat tempfile > $PKG/usr/bin/tempfile
cat tempfile.1 | gzip -9c > $PKG/usr/man/man1/tempfile.1.gz

echo "+=======+"
echo "| eject |"
echo "+=======+"
cd $TMP
rm -rf eject
tar xzvf $SRC_DIR/eject-$EJECT.tar.gz
cd eject
chown -R root:root .
if [ "$ARCH" == "x86_64" ]; then
  zcat $CWD/eject-x86_64.diff.gz | patch -p1 --verbose
fi
CFLAGS= ./configure --prefix=/usr
make || exit 32
cat eject > $PKG/usr/bin/eject
cat eject.1 | gzip -9c > $PKG/usr/man/man1/eject.1.gz
cat volname > $PKG/usr/bin/volname
cat volname.1 | gzip -9c > $PKG/usr/man/man1/volname.1.gz
mkdir -p $PKG/usr/doc/eject-$EJECT
cp -a AUTHORS COPYING NEWS PORTING PROBLEMS README TODO eject-$EJECT.lsm \
  $PKG/usr/doc/eject-$EJECT
chmod 644 $PKG/usr/doc/eject-$EJECT/*

echo "+===========+"
echo "| fbset-2.1 |"
echo "+===========+"
cd $TMP
tar xzvf $SRC_DIR/fbset-2.1.tar.gz
cd fbset-2.1
chown -R root.root .
make || exit 32
mkdir -p $PKG/usr/sbin
cat fbset > $PKG/usr/sbin/fbset
chmod 755 $PKG/usr/sbin/fbset
mkdir -p $PKG/etc
cat etc/fb.modes.ATI > $PKG/etc/fb.modes
mkdir -p $PKG/usr/man/man5
cat fb.modes.5 | gzip -9c > $PKG/usr/man/man5/fb.modes.5.gz
mkdir -p $PKG/usr/man/man8
cat fbset.8 | gzip -9c > $PKG/usr/man/man8/fbset.8.gz

echo "+===========+"
echo "| lha-1.14i |"
echo "+===========+"
cd $TMP
tar xzvf $SRC_DIR/lha-114i.tar.gz
cd lha-114i
zcat $SRC_DIR/lha-114i-sec.patch.gz | patch -p1 --verbose
zcat $SRC_DIR/lha-114i-symlink.patch.gz | patch -p1 --verbose
chown -R root.root .
make || exit 32
cat src/lha > $PKG/usr/bin/lha

echo "+========+"
echo "| ed-0.2 |"
echo "+========+"
cd $TMP
tar xzvf $SRC_DIR/ed-0.2.tar.gz
cd ed-0.2
chown -R root.root .
zcat $SRC_DIR/ed-0.2.mkstemp.diff.gz | patch -p1 -E --backup --verbose
CFLAGS=-O2 \
./configure \
  --prefix=/usr \
  $ARCH-slackware-linux
make || exit 32
cat ed > $PKG/bin/ed
cat ed.1 | gzip -9c > $PKG/usr/man/man1/ed.1.gz
cat ed.info | gzip -9c > $PKG/usr/info/ed.info.gz

echo "+==========+"
echo "| compress |"
echo "+==========+"
cd $TMP
tar xzvf $SRC_DIR/compress.tar.gz
cd compress
chown -R root.root .
zcat $SRC_DIR/compress.diff.gz | patch -p0 -E --backup --verbose
if [ "$ARCH" == "x86_64" ]; then
  echo 450000 > USERMEM # the default from the source file
fi
make || exit 32
cat compress > $PKG/usr/bin/compress
cat compress.1 | gzip -9c > $PKG/usr/man/man1/compress.1.gz
echo '.so man1/compress.1' | gzip -9c > $PKG/usr/man/man1/uncompress.1.gz

echo "+=========+"
echo "| banners |"
echo "+=========+"
cd $TMP
tar xzvf $SRC_DIR/banners.tar.gz
cd banners
chown -R root.root .
make || exit 32
cat bban > $PKG/usr/bin/bban
cat sysvbanner > $PKG/usr/bin/sysvbanner

echo "+===========+"
echo "| file-$FILE |"
echo "+===========+"
cd $TMP
tar xzvf $SRC_DIR/file-$FILE.tar.gz
cd file-$FILE
chown -R root.root .
zcat $SRC_DIR/file.quiet.diff.gz | patch -p1 -E --verbose
zcat $SRC_DIR/file.short.diff.gz | patch -p1 -E --verbose
zcat $SRC_DIR/file.rzip.magic.gz >> magic/Magdir/compress
zcat $SRC_DIR/file.zisofs.magic.gz >> magic/Magdir/compress
./configure \
  --prefix=/usr \
  --libdir=/usr/$LIB \
  --sysconfdir=/etc \
  --datadir=/etc \
  --enable-fsect-man5 \
  --enable-shared=no \
  $ARCH-slackware-linux
make || exit 32
make install DESTDIR=$PKG
# Is file really this much of a processing bottleneck?  Doubtful.
rm -f $PKG/etc/file/magic.mgc $PKG/etc/file/magic.mime.mgc
strip -g $PKG/usr/$LIB/libmagic.a
mkdir -p $PKG/usr/doc/file-$FILE
cp -a \
  LEGAL.NOTICE README \
  $PKG/usr/doc/file-$FILE
chmod 644 $PKG/usr/doc/file-$FILE/*
gzip -9 $PKG/usr/man/man1/file.1 \
        $PKG/usr/man/man3/libmagic.3 \
        $PKG/usr/man/man5/magic.5
# /etc/magic has been traditional for so long that it seems like a
# real good idea to provide a link:
( cd $PKG/etc
  ln -sf file/magic magic
)

echo "+============+"
echo "| dosfstools |"
echo "+============+"
cd $TMP
tar xzvf $SRC_DIR/dosfstools-$DOSFS.tar.gz
cd dosfstools-$DOSFS
if [ "$ARCH" == "x86_64" ]; then zcat $CWD/dosfstools-x86_64.diff.gz | patch -p1 --verbose; fi
chown -R root.root .
mkdir -p $PKG/usr/doc/dosfstools-$DOSFS
cp -a CHANGES README.Atari TODO $PKG/usr/doc/dosfstools-$DOSFS
mkdir -p $PKG/usr/doc/dosfstools-$DOSFS/mkdosfs
( cd mkdosfs ; cp -a ANNOUNCE COPYING ChangeLog README mkdosfs-ygg-0.3b.lsm $PKG/usr/doc/dosfstools-$DOSFS/mkdosfs )
mkdir -p $PKG/usr/doc/dosfstools-$DOSFS/dosfsck
( cd dosfsck ; cp -a CHANGES COPYING README $PKG/usr/doc/dosfstools-$DOSFS/dosfsck )
make || exit 32
cd mkdosfs
cat mkdosfs > $PKG/sbin/mkdosfs
cat mkdosfs.8 | gzip -9c > $PKG/usr/man/man8/mkdosfs.8.gz
cd ../dosfsck
cat dosfsck > $PKG/sbin/dosfsck
cat dosfsck.8 | gzip -9c > $PKG/usr/man/man8/dosfsck.8.gz

echo "+=============+"
echo "| patch-2.5.4 |"
echo "+=============+"
cd $TMP
tar xzvf $SRC_DIR/patch-2.5.4.tar.gz
cd patch-2.5.4
chown -R root.root .
mkdir -p $PKG/usr/doc/patch-2.5.4
cp -a AUTHORS COPYING INSTALL NEWS README $PKG/usr/doc/patch-2.5.4
chmod 644 $PKG/usr/doc/patch-2.5.4/*
./configure \
  --prefix=/usr \
  $ARCH-slackware-linux
make CFLAGS=-O2
cat patch > $PKG/usr/bin/patch
cat patch.man  | gzip -9c > $PKG/usr/man/man1/patch.1.gz

echo "+===========+"
echo "| rpm2targz |"
echo "+===========+"
cd $TMP
cc -o rpmoffset $CWD/rpmoffset.c
cat rpmoffset > $PKG/usr/bin/rpmoffset
rm rpmoffset
cat $CWD/rpm2targz > $PKG/usr/bin/rpm2targz
mkdir -p $PKG/usr/doc/rpm2targz
cp -a $CWD/rpm2targz.README $PKG/usr/doc/rpm2targz/rpm2targz.README
chmod 644 $PKG/usr/doc/rpm2targz/rpm2targz.README

echo "+===========+"
echo "| run-parts |"
echo "+===========+"
zcat $SRC_DIR/run-parts.gz > $PKG/usr/bin/run-parts
chmod 755 $PKG/usr/bin/run-parts
cat $SRC_DIR/run-parts.8.gz > $PKG/usr/man/man8/run-parts.8.gz

echo "+=================+"
echo "| sharutils-4.2.1 |"
echo "+=================+"
cd $TMP
tar xzvf $SRC_DIR/sharutils-4.2.1.tar.gz
cd sharutils-4.2.1
chown -R root.root .
mkdir -p $PKG/usr/doc/sharutils-4.2.1
cp -a ABOUT-NLS AUTHORS BACKLOG COPYING INSTALL NEWS README \
  README.OLD THANKS TODO $PKG/usr/doc/sharutils-4.2.1
chmod 644 $PKG/usr/doc/sharutils-4.2.1/*
# For now, NLS seems to cause build errors on this one...
CFLAGS=-O2 \
./configure \
  --disable-nls \
  --prefix=/usr \
  $ARCH-slackware-linux
make || exit 32
cd src
cat shar > $PKG/usr/bin/shar
cat unshar > $PKG/usr/bin/unshar
cat uuencode > $PKG/usr/bin/uuencode
cat uudecode > $PKG/usr/bin/uudecode
cd ../doc
cat sharutils.info | gzip -9c > $PKG/usr/info/sharutils.info.gz
# Include old manpages, since the source package doesn't have them anymore:
for page in shar.1.gz unshar.1.gz uuencode.1.gz ; do
  cat $SRC_DIR/$page > $PKG/usr/man/man1/$page
done
echo '.so man1/uuencode.1' | gzip -9c > $PKG/usr/man/man1/uudecode.1.gz
cat $SRC_DIR/uuencode.5.gz > $PKG/usr/man/man5/uuencode.5.gz

echo "+===============+"
echo "| splitvt-1.6.5 |"
echo "+===============+"
cd $TMP
rm -rf splitvt-1.6.5
tar xzvf $SRC_DIR/splitvt-1.6.5.tar.gz
cd splitvt-1.6.5
zcat $SRC_DIR/splitvt.devpts.diff.gz | patch -p1 --verbose
chown -R root.root .
./configure
make || exit 32
cat splitvt > $PKG/usr/bin/splitvt
cat splitvt.1 | gzip -9c > $PKG/usr/man/man1/splitvt.1.gz
mkdir -p $PKG/usr/doc/splitvt-1.6.5
cp -a examples ANNOUNCE CHANGES NOTES README TODO \
  $PKG/usr/doc/splitvt-1.6.5
( cd $PKG/usr/doc/splitvt-1.6.5
  find . -type d | xargs chmod 755
  find . -type f | xargs chmod 644 )

echo "+==========+"
echo "| time-1.7 |"
echo "+==========+"
cd $TMP
tar xvzf $SRC_DIR/time-1.7.tar.gz
cd time-1.7
chown -R root.root .
./configure \
  --prefix=/usr \
  $ARCH-slackware-linux
make CFLAGS=-O2
cat time > $PKG/usr/bin/time
cat time.info | gzip -9c > $PKG/usr/info/time.info.gz

echo "+===============+"
echo "| todos/fromdos |"
echo "+===============+"
cd $TMP
tar xzvf $SRC_DIR/todos.tar.gz
cd todos
chown -R root.root .
make || exit 32
cat todos > $PKG/usr/bin/todos
cat fromdos > $PKG/usr/bin/fromdos
cat todos.1.gz > $PKG/usr/man/man1/todos.1.gz
cat fromdos.1.gz > $PKG/usr/man/man1/fromdos.1.gz

echo "+============+"
echo "| tree-1.4b3 |"
echo "+============+"
cd $TMP
tar xzvf $SRC_DIR/tree-1.4b3.tar.gz
cd tree-1.4
if [ "$ARCH" == "x86_64" ]; then zcat $CWD/tree-x86_64.diff.gz | patch -p1 --verbose; fi
chown -R root.root .
make clean
make || exit 32
cat tree > $PKG/usr/bin/tree
chmod 755 $PKG/usr/bin/tree
cat tree.1 | gzip -9c > $PKG/usr/man/man1/tree.1.gz
mkdir -p $PKG/usr/doc/tree-1.4b3
cp -a CHANGES LICENSE README README.sacl $PKG/usr/doc/tree-1.4b3
chmod 644 $PKG/usr/doc/tree-1.4b3/*

echo "+==========+"
echo "| unarj230 |"
echo "+==========+"
cd $TMP
tar xzvf $SRC_DIR/unarj230.tar.gz
cd unarj230
chown -R root.root .
zcat $SRC_DIR/unarj230.diff.gz | patch -p0 -E --verbose --backup
make || exit 32
cat unarj > $PKG/usr/bin/unarj

echo "+============+"
echo "| which-$WHICH |"
echo "+============+"
cd $TMP
tar xzvf $SRC_DIR/which-$WHICH.tar.gz
cd which-$WHICH
chown -R root.root .
./configure --prefix=/usr
make CFLAGS=-O2
cat which > $PKG/bin/which
cat which.1 | gzip -9c > $PKG/usr/man/man1/which.1.gz
cat which.info | gzip -9c > $PKG/usr/info/which.info.gz
mkdir -p $PKG/usr/doc/which-$WHICH
cp -a AUTHORS COPYING EXAMPLES INSTALL NEWS README README.alias $PKG/usr/doc/which-$WHICH

echo "+==========+"
echo "| zoo-2.10 |"
echo "+==========+"
cd $TMP
rm -rf zoo-2.10
tar xzvf $SRC_DIR/zoo-2.10.tar.gz
cd zoo-2.10
chown -R root:root .
zcat $SRC_DIR/zoo_2.10-17.diff.gz | patch -p1 -E --verbose --backup || exit 1
for diff in debian/patches/*.dpatch ; do
  cat $diff | patch -p1 --verbose || exit 1
done
if [ "$ARCH" == "x86_64" ]; then zcat $CWD/zoo-x86_64.diff.gz | patch -p1 --verbose; fi
make linux
cat fiz > $PKG/usr/bin/fiz
cat zoo > $PKG/usr/bin/zoo
for page in fiz.1 zoo.1 ; do
  cat $page | gzip -9c > $PKG/usr/man/man1/$page.gz
done

# Add a very handy tool for scanning new SCSI devices.  Most useful for
# finding new USB and Firewire storage devices which show up as SCSI.
cp -a $CWD/rescan-scsi-bus $PKG/sbin/rescan-scsi-bus
chmod 755 $PKG/sbin/rescan-scsi-bus

# Strip everything for good measure:
( cd $PKG
  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)

chown -R root.bin $PKG/bin $PKG/usr/bin $PKG/sbin $PKG/usr/sbin

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

# Build the package:
cd $PKG
makepkg -l y -c n $REPOS/bin-$VERSION-$ARCH-$BUILD.tgz

# Clean up the extra stuff:
if [ "$CLEANUP" == "yes" ]; then
  rm -rf $TMP
fi