aboutsummaryrefslogtreecommitdiffstats
path: root/chapter8/bzip2.sh
blob: 08e95e17a34f7b007bb224383c1edcf48d57abb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# shellcheck disable=SC2016

patch -Np1 -i ../bzip2-"${VERSION}"-install_docs-1.patch &&

sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile &&
sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile &&

make -f Makefile-libbz2_so &&
make clean &&
make &&

make PREFIX=/usr -j1 install &&

cp -v bzip2-shared /bin/bzip2 &&
cp -av libbz2.so* /lib &&
ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so &&
rm -v /usr/bin/{bunzip2,bzcat,bzip2} &&
ln -sv bzip2 /bin/bunzip2 &&
ln -sv bzip2 /bin/bzcat &&
rm -fv /usr/lib/libbz2.a