apt,dpkg を入れる

Debian(Ubuntu)のパッケージをDLしたくなったので、make/installpkgしてみる。

dpkg-1.21.9:
(https://slackbuilds.org/slackbuilds/15.0/development/dpkg/dpkg.SlackBuild を参考に、)
$ tar xpf dpkg_1.21.9.txz
$ cd dpkg-1.21.9
$ find -L . \
\ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
\ -o -perm 511 \) -exec chmod 755 {} \; -o \
\ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
\ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
$ CFLAGS=”-O2 -fPIC” CXXFLAGS=”-O2 -fPIC” \
\ ./configure \
\ –prefix=/usr –libdir=/usr/lib64 –sysconfdir=/etc \
\ –localstatedir=/var –mandir=/usr/man –docdir=/usr/doc/dpkg-1.21.9 \
\ –disable-devel-docs –disable-start-stop-daemon –enable-silent-rules \
\ –build=x86_64-slackware-linux

\Configuration:
\ Features:
\ native language support . . . : yes
\ unicode support . . . . . . . : yes
\ development documentation . . : no
\ code coverage . . . . . . . . : no
\ build shared libraries . . . : no
\ mmap loaders . . . . . . . . : no
\ disk pre-allocation . . . . . : no
\ default dpkg-deb compressor . : xz
\ Paths:
\ devlibdir . . . . . . . . . . : /usr/lib64
\ pkgconfdir . . . . . . . . . : /etc/dpkg
\ admindir . . . . . . . . . . : /var/lib/dpkg
\ backupsdir . . . . . . . . . : /var/backups
\ logdir . . . . . . . . . . . : /var/log
\ perl interpreter . . . . . . : /usr/bin/perl
\ perl libdir . . . . . . . . . : $(prefix)/share/perl5/vendor_perl
(展開されていないように見えて気持ち悪いので、PERL_LIBDIR=/usr/share/perl5/vendor_perl とやってもう1回やった)
\ Programs:
\ update-alternatives . . . . . : yes
\ start-stop-daemon . . . . . . : no
\ dselect . . . . . . . . . . . : yes
\ System Libraries:
\ libsocket . . . . . . . . . . : no
\ libps . . . . . . . . . . . . : no
\ libkvm . . . . . . . . . . . : no
\ libselinux . . . . . . . . . : no
\ libmd . . . . . . . . . . . . : no
\ libz . . . . . . . . . . . . : no
\ liblzma . . . . . . . . . . . : yes
\ libbz2 . . . . . . . . . . . : yes
\ libcurses . . . . . . . . . . : yes

$ make
$ mkdir ../package-dpkg
$ make install DESTDIR=../package-dpkg (エラーが無ければ以降sudoで実行)
libtool: error: ‘../package-dpkg/usr/lib64’ must be an absolute directory name
$ make install DESTDIR=~/package-dpkg (エラーが無ければ以降sudoで実行)
$ rm -rf ../package-dpkg
$ sudo mkdir ../package-dpkg
$ sudo chown -R root:root ../dpkg-1.21.9
$ sudo make install DESTDIR=~/package-dpkg
$ cd ../package-dpkg
$ find . | xargs file | grep -e “executable” -e “shared object” | grep ELF | cut -f 1 -d : | xargs sudo strip –strip-unneeded
$ sudo find usr/man -type f -exec gzip -9 {} \;
$ for i in $( find usr/man -type l ) ; do sudo ln -s $( readlink $i ).gz $i.gz ; sudo rm $i ; done
$ sudo rm -f usr/lib*/*.la
$ sudo mkdir install
$ sudo sh -c ‘cat ../slack-desc > install/slack-desc’
$ sudo makepkg ../dpkg-1.21.9-x86_64-1.txz
$ sudo installpkg ../dpkg-1.21.9-x86_64-1.txz

apt-2.5.4:
(debianを参考にしようと思ったが、ディレクトリ構成その他違いがあるとマズイので、今回は適当)
$ tar xpf apt_2.5.4.txz
$ cd apt-2.5.4
(configureしようとしたら、aptの方はcmakeだった)
$ sudo installpkg /mnt2/slackware64/d/cmake-3.21.4-x86_64-1.txz
$ grep -E ‘bin|lib’ /var/log/packages/cmake-3.21.4-x86_64-1 | sed s@^@/@ | xargs ldd | grep found
\ libQt5Widgets.so.5 => not found
\ libQt5Gui.so.5 => not found
\ libQt5Core.so.5 => not found
(/usr/bin/cmake-guiが依存している。GUIは使わないので無問題)
(README.mdと参考情報を参考に、)
$ mkdir build
$ cmake -S . -B build (多分、-Sは省略してOK。cmake . -B build )
\– The C compiler identification is GNU 11.2.0
\– The CXX compiler identification is GNU 11.2.0
\– Detecting C compiler ABI info
\– Detecting C compiler ABI info – done
\– Check for working C compiler: /usr/bin/cc – skipped
\– Detecting C compile features
\– Detecting C compile features – done
\– Detecting CXX compiler ABI info
\– Detecting CXX compiler ABI info – done
\– Check for working CXX compiler: /usr/bin/c++ – skipped
\– Detecting CXX compile features
\– Detecting CXX compile features – done
\– Looking for pthread.h
\– Looking for pthread.h – found
\– Performing Test CMAKE_HAVE_LIBC_PTHREAD
\– Performing Test CMAKE_HAVE_LIBC_PTHREAD – Failed
\– Looking for pthread_create in pthreads
\– Looking for pthread_create in pthreads – not found
\– Looking for pthread_create in pthread
\– Looking for pthread_create in pthread – found
\– Found Threads: TRUE
\– Looking for native LFS support
\– Looking for native LFS support – found
\– Found LFS: TRUE
\– Looking for iconv_open
\– Looking for iconv_open – found
\– Found Iconv: /usr/include
\– Found Perl: /usr/bin/perl (found version “5.34.0”)
\CMake Error at CMakeLists.txt:50 (message):
\ Could not find triehash executable
(先にtriehashをmake/installpkgしてもう1回cmakeした。Slackのpkgには無さそうだ)
$ cmake -S . -B build
\– Found Intl: built in to C library
\– Performing Test have-compiler-flag:-Wall
\– Performing Test have-compiler-flag:-Wall – Success
\– Performing Test have-compiler-flag:-Wextra
\– Performing Test have-compiler-flag:-Wextra – Success
\– Performing Test have-compiler-flag:-Wcast-align
\– Performing Test have-compiler-flag:-Wcast-align – Success
\– Performing Test have-compiler-flag:-Wlogical-op
\– Performing Test have-compiler-flag:-Wlogical-op – Success
\– Performing Test have-compiler-flag:-Wredundant-decls
\– Performing Test have-compiler-flag:-Wredundant-decls – Success
\– Performing Test have-compiler-flag:-Wmissing-declarations
\– Performing Test have-compiler-flag:-Wmissing-declarations – Success
\– Performing Test have-compiler-flag:-Wunsafe-loop-optimizations
\– Performing Test have-compiler-flag:-Wunsafe-loop-optimizations – Success
\– Performing Test have-compiler-flag:-Wctor-dtor-privacy
\– Performing Test have-compiler-flag:-Wctor-dtor-privacy – Success
\– Performing Test have-compiler-flag:-Wdisabled-optimization
\– Performing Test have-compiler-flag:-Wdisabled-optimization – Success
\– Performing Test have-compiler-flag:-Winit-self
\– Performing Test have-compiler-flag:-Winit-self – Success
\– Performing Test have-compiler-flag:-Wmissing-include-dirs
\– Performing Test have-compiler-flag:-Wmissing-include-dirs – Success
\– Performing Test have-compiler-flag:-Wnoexcept
\– Performing Test have-compiler-flag:-Wnoexcept – Success
\– Performing Test have-compiler-flag:-Wsign-promo
\– Performing Test have-compiler-flag:-Wsign-promo – Success
\– Performing Test have-compiler-flag:-Wundef
\– Performing Test have-compiler-flag:-Wundef – Success
\– Performing Test have-compiler-flag:-Wdouble-promotion
\– Performing Test have-compiler-flag:-Wdouble-promotion – Success
\– Performing Test have-compiler-flag:-Wsuggest-override
\– Performing Test have-compiler-flag:-Wsuggest-override – Success
\– Performing Test have-compiler-flag:-Werror=suggest-override
\– Performing Test have-compiler-flag:-Werror=suggest-override – Success
\– Performing Test have-compiler-flag:-Werror=return-type
\– Performing Test have-compiler-flag:-Werror=return-type – Success
\CMake Error at /usr/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
\ Could not find Berkeley DB >= 4.1 (missing: BERKELEY_INCLUDE_DIRS
\ BERKELEY_LIBRARIES)
$ sudo installpkg /mnt2/slackware64/l/db48-4.8.30-x86_64-6.txz
$ cmake -S . -B build
\– Found Berkeley: /usr/include
\– Found GnuTLS: /usr/lib64/libgnutls.so
\CMake Error at /usr/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
\ Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
$ sudo installpkg /mnt2/slackware64/l/zlib-1.2.11-x86_64-4.txz
$ cmake -S . -B build
\– Found ZLIB: /usr/lib64/libz.so (found version “1.2.11”)
\– Found BZip2: /usr/lib64/libbz2.so (found version “1.0.8”)
\– Looking for BZ2_bzCompressInit
\– Looking for BZ2_bzCompressInit – found
\– Found PkgConfig: /usr/bin/pkg-config (found version “0.29.2”)
\– Checking for module ‘liblzma’
\– Found liblzma, version 5.2.5
\– Found LZMA: /usr/include
\– Checking for module ‘liblz4’
\– Found liblz4, version 1.9.3
\– Found LZ4: /usr/include
\– Checking for module ‘libzstd’
\– No package ‘libzstd’ found
\– Could NOT find ZSTD (missing: ZSTD_INCLUDE_DIRS ZSTD_LIBRARIES)
\– Checking for module ‘libudev’
\– Found libudev, version 243
\– Found Udev: /usr/include
\– Checking for module ‘libsystemd’
\– No package ‘libsystemd’ found
\– Could NOT find Systemd (missing: SYSTEMD_INCLUDE_DIRS SYSTEMD_LIBRARIES)
\– Checking for module ‘libseccomp’
\– No package ‘libseccomp’ found
\– Could NOT find SECCOMP (missing: SECCOMP_INCLUDE_DIRS SECCOMP_LIBRARIES)
\– Checking for module ‘libgcrypt’
\– Found libgcrypt, version 1.9.4
\– Found GCRYPT: /usr/include
\– Checking for module ‘libxxhash’
\– No package ‘libxxhash’ found
\CMake Error at /usr/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
\ Could NOT find XXHASH (missing: XXHASH_INCLUDE_DIRS XXHASH_LIBRARIES)
(先にxxhashをmake/installpkgしてもう1回cmakeする。Slackのpkgには無さそうだ)

triehash-0.3:
(ソースはdebian-poolから採ってくる。Slackbuildは無さそうだ)
$ tar xpf triehash_0.3.orig.tar.gz
(展開したらperl-scriptだったが、一応pkg化しておくか)
$ sudo mkdir -p package-triehash/usr/{bin,doc}
$ sudo mkdir -p package-triehash/usr/doc/triehash-0.3
$ sudo cp triehash-0.3/triehash.pl package-triehash/usr/bin
$ sudo cp triehash-0.3/{README.md,LICENSE.md} package-triehash/usr/doc/triehash-0.3
$ cd package-triehash
$ (cd usr/bin/; sudo ln -s triehash.pl triehash)
$ sudo makepkg ../triehash-0.3-noarch-1.txz
$ sudo installpkg ../triehash-0.3-noarch-1.txz

xxHash-0.8.1:
$

参考情報:
以前Cackoでもやったapt,dpkgのmake/install。ちゃんとメモしておくんだった。
まるで覚えていない。aptはSlackbuildsにもないがSlackに入れるなら両方必要な気がする。
https://seesaawiki.jp/cacko/d/%bb%a8%b5%ad%cf%bf
CMakeの使い方(その1) – Qiita
https://qiita.com/shohirose/items/45fb49c6b429e8b204ac

installまたは展開時のメッセージ:
\# cmake (cross-platform, open-source make system)
\# CMake is used to control the software process using simple platform
\# and compiler independent configuration files. CMake generates
\# native makefiles and workspaces that can be used in the
\# compiler environment of your choice.
\# Homepage: http://www.cmake.org
\
\# db48 (Berkeley database library version 4.8.x)
\# The Berkeley Database (Berkeley DB) library provides embedded database
\# support for both traditional and client/server applications.
\# This package should be installed if compatibility is needed with
\# databases created with the Berkeley DB version 4.8.x.
\
\# zlib (compression library)
\# zlib is a general purpose thread safe data compression library. The
\# data format used by the zlib library is described by RFCs 1950 to
\# 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt (zlib format)
\# rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
\# Homepage: http://www.zlib.net

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です