朝晩はずいぶん冷え込むようになり、
というわけで
PlamoBuildスクリプトの詳細
まず、
1 #!/bin/sh
2 ##############################################################
3 pkgbase="fluxbox"
4 vers="1.3.7"
5 url="https://downloads.sourceforge.net/fluxbox/fluxbox-1.3.7.tar.xz"
6 arch=`uname -m`
7 build=B1
8 src="fluxbox-1.3.7"
9 OPT_CONFIG="--disable-static --enable-shared"
10 DOCS="AUTHORS COPYING ChangeLog INSTALL NEWS README TODO"
11 patchfiles=""
12 compress=txz
13 ##############################################################
14
15 source /usr/share/plamobuild_functions.sh
16
17 # このスクリプトで使う1文字変数の意味
18 #
19 # $W : このスクリプトを動かすカレントディレクトリ
20 # $S : ソースコードのあるディレクトリ(デフォルト: $W/${src})
21 # $B : ビルド用ディレクトリ(デフォルト: /tmp/build)
22 # $P : ビルドしたファイルをインストールするディレクトリ(デフォルト: $W/work)
23
24 if [ $# -eq 0 ] ; then
25 opt_download=0 ; opt_config=1 ; opt_build=1 ; opt_package=1
26 else
27 opt_download=0 ; opt_config=0 ; opt_build=0 ; opt_package=0
28 for i in $@ ; do
29 case $i in
30 download) opt_download=1 ;;
31 config) opt_config=1 ;;
32 build) opt_build=1 ;;
33 package) opt_package=1 ;;
34 esac
35 done
36 fi
37 if [ $opt_download -eq 1 ] ; then
38 download_sources
39 fi
40
41 if [ $opt_config -eq 1 ] ; then
42 ######################################################################
43 # out of tree build. patch apply in src dir
44 ######################################################################
45 if [ -d $B ] ; then rm -rf $B ; fi ; mkdir -p $B
46 cd $S
47 for patch in $patchfiles ; do
48 if [ ! -f .${patch} ]; then
49 patch -p1 < $W/$patch
50 touch .${patch}
51 fi
52 done
53 # if [ -f autogen.sh ] ; then
54 # sh ./autogen.sh
55 # fi
56 cd $B
57 export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig
58 export LDFLAGS='-Wl,--as-needed'
59 $S/configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --mandir='${prefix}'/share/man ${OPT_CONFIG}
60 if [ $? != 0 ]; then
61 echo "configure error. $0 script stop"
62 exit 255
63 fi
64 fi
65
66 if [ $opt_build -eq 1 ] ; then
67 cd $B
68 export LDFLAGS='-Wl,--as-needed'
69 make -j3
70 if [ $? != 0 ]; then
71 echo "build error. $0 script stop"
72 exit 255
73 fi
74 fi
75
76 if [ $opt_package -eq 1 ] ; then
77 check_root
78 if [ -d $P ] ; then rm -rf $P ; fi ; mkdir -p $P
79 cd $B
80
81 export LDFLAGS='-Wl,--as-needed'
82 make install DESTDIR=$P
83
84 ################################
85 # install tweaks
86 # strip binaries, delete locale except ja, compress man,
87 # install docs and patches, compress them and chown root.root
88 ################################
89 install_tweak
90
91 #############################
92 # convert symlink to null file and
93 # add "ln -sf" command into install/doinst.sh
94 ################################
95 convert_links
96
97 cd $P
98 /sbin/makepkg ../$pkg.$compress <<EOF
99 y
100 1
101 EOF
102
103 fi
ご覧の通り、
それぞれの作業を行うかどうかは$opt_
15行目で読みこんでいる/usr/
また、
PlamoBuildスクリプトの再実行
さて、
設定処理
前回、
9 OPT_CONFIG=""
ここで指定していた"--disable-static --enable-shared"という指定は、
OPT_
$ ./PlamoBuild.fluxbox-1.3.7 config checking for gcc... gcc checking whether the C compiler works... yes ... fluxbox version 1.3.7 configured successfully. Using: '/usr' for installation. '/usr/share/fluxbox/menu' for location menu file. '/usr/share/fluxbox/windowmenu' for location window menu file. '/usr/share/fluxbox/styles/bloe' by default style. '/usr/share/fluxbox/keys' for location keys file. '/usr/share/fluxbox/init' for location init file. '/usr/share/fluxbox/nls' for nls files. 'g++' for C++ compiler. Building with: '-I/usr/include/fribidi -g -O2 ' for C++ compiler flags. ' -lfontconfig -lfreetype -lfreetype -lfribidi -lImlib2 -lXrandr -lXext -lXft -lXinerama -lXpm -lX11 -lXrender -lX11' for linker flags. Now build fluxbox with 'make'
configを引数に指定してPlamoBuildスクリプトを実行すると、
$ ls /tmp/build/ Makefile config.h config.log config.status* nls/ src/ stamp-h1 util/ version.h
ビルド作業
次にbuildを指定して実行すると、
$ ./PlamoBuild.fluxbox-1.3.7 build cmp: ./src/defaults.cc: そのようなファイルやディレクトリはありません make all-recursive make[1]: ディレクトリ '/tmp/build' に入ります ... g++ -g -O2 -Wl,--as-needed -o fluxbox-update_configs src/fluxbox_update_configs-defaults.o \ src/fluxbox_update_configs-Resources.o util/fluxbox_update_configs-fluxbox-update_configs.o \ libFbTk.a -lfribidi -lX11 -lrt -lm make[2]: ディレクトリ '/tmp/build' から出ます make[1]: ディレクトリ '/tmp/build' から出ます
最初にcmpが
$ ls /tmp/build/ Makefile config.status* fluxbox* libFbTk.a stamp-h1 config.h fbrun* fluxbox-remote* nls/ util/ config.log fbsetroot* fluxbox-update_configs* src/ version.h
デフォルトで設定している"make -j3"は
一方、
パッケージ化
最後にpackageを指定してパッケージ化の作業を行います。"package"を指定すると、
22行目にコメントしてあるように、
$ ./PlamoBuild.fluxbox-1.3.7 package Do you want to package as root? [y/N] make install-recursive make[1]: ディレクトリ '/tmp/build' に入ります ... pruning symlink in /home/kojima/Srcs/F/Fluxbox/work/usr/share/man/mann basename:fluxbox version:1.3.7 arch:x86_64 build:B1 ext:txz
しかしながら前回も指摘したように、
$ tar tvf fluxbox-1.3.7-x86_64-B1.txz drwxr-xr-x kojima/users 0 2018-11-23 16:09:24 usr/ drwxr-xr-x kojima/users 0 2018-11-23 16:09:26 usr/share/ drwxr-xr-x kojima/users 0 2018-11-23 16:09:25 usr/share/fluxbox/ ...
間違えてこの状態のパッケージをインストールしてしまうと、
$ ./PlamoBuild.fluxbox-1.3.7 package Do you want to package as root? [y/N] y パスワード: ******* make install-recursive ...
"Do you want to package as root?"の質問に "y"と答えると、
$ tar tvf fluxbox-1.3.7-x86_64-B1.txz drwxr-xr-x root/root 0 2018-11-23 16:14:22 usr/ drwxr-xr-x root/root 0 2018-11-23 16:14:24 usr/share/ ...
紹介したように、
作成したパッケージは、
$ sudo installpkg fluxbox-1.3.7-x86_64-B1.txz fluxbox-1.3.7-x86_64-B1 のインストール中
テストのために、
$ mv .xinitrc .xinitrc.org $ echo "startfluxbox" > .xinitrc
こうしておいてからstartxでXを起動すると、

インストール済パッケージの管理情報
Plamo Linuxではインストールした各パッケージの情報を/var/
今回インストールしたfluxboxでは、
$ cat -n /var/log/packages/fluxbox 1 PACKAGE NAME: fluxbox-1.3.7-x86_64-B1 2 COMPRESSED PACKAGE SIZE: 776 K 3 UNCOMPRESSED PACKAGE SIZE: 3300 K 4 PACKAGE LOCATION: fluxbox-1.3.7-x86_64-B1.txz 5 PACKAGE DESCRIPTION: 6 FILE LIST: 7 usr/ .... 333 usr/bin/fluxbox 334 usr/bin/fbsetroot 335 usr/bin/fluxbox-remote 336 usr/bin/fluxbox-update_configs 337 usr/bin/fbrun
installpkgコマンドでインストールしたパッケージの情報は全てこのディレクトリに保存されているので、
$ grep mutool /var/log/packages /var/log/packages/mupdf:usr/bin/mutool /var/log/packages/mupdf:usr/share/man/man1/mutool.1.gz
この例では、
$ cat -n /var/log/packages/mupdf 1 PACKAGE NAME: mupdf-1.11-x86_64-B1 2 COMPRESSED PACKAGE SIZE: 20845 K 3 UNCOMPRESSED PACKAGE SIZE: 43950 K 4 PACKAGE LOCATION: /var/adm/mount/plamo/09_printings/mupdf-1.11-x86_64-B1.txz 5 PACKAGE DESCRIPTION: 6 mupdf: 軽量PDF/XPS/E-bookビューワー MuPDF ...
最近では、
そのため、
Plamo Linuxは、