pkgsrc とは何か?
よもやま話
OBATA Akio (obache@NetBSD.org)
Nov. 16, 2013
Open Source Conference 2013 Fukuoka
で、pkgsrc って何なの?
パッケージ管理システム?
そうなような、そうでないような
rpm とか dpkg みたいなもの?
misc/rpm とか misc/dpkg あるよ
yum とか apt みたいなもの?
pkgtools/pkgin とか pkgtools/nih とか
01 26
だから pkgsrc って何なの?
The NetBSD package Collection
NetBSD の base に含まれない pkg の集合
FreeBSD ports から fork(1997)
/usr/pkg に追加のsrc でpkgsrc
他のソースと同じ: make install
13000+ のパッケージ
四半期に一度のリリース
02 26
基本的なの使い方
ソース一式を取得
cd CATEGORY/PKG && make install
fetch & configure & build & install
バイナリパッケージも作成可能
03 26
パッケージの内容物
Makefile
distinfo
PLIST
DESCR
patches
INSTALL/DEINSTALL
04 26
Makefile
# $NetBSD: Makefile,v 1.44 2013/06/29 11:54:45 obache Exp $
#
DISTNAME= rabbit-2.1.0
CATEGORIES= graphics ruby
MASTER_SITES= http://rabbit-shocker.org/download/
MAINTAINER= obache@NetBSD.org
HOMEPAGE= http://rabbit-shocker.org/
COMMENT= RD-document-based presentation application
LICENSE= gnu-gpl-v2 # or later
RUBY_VERSION_SUPPORTED= 193
DEPENDS+= ${RUBY_PKGPREFIX}-gnome2-gtk>=0.90.3:../../x11/ruby-gnome2-gtk
DEPENDS+= ${RUBY_PKGPREFIX}-gnome2-rsvg-[0-9]*:../../graphics/ruby-gnome2-rsvg
DEPENDS+= ${RUBY_PKGPREFIX}-gnome2-poppler-[0-9]*:../../print/ruby-gnome2-poppler
DEPENDS+= ${RUBY_PKGPREFIX}-hikidoc-[0-9]*:../../textproc/ruby-hikidoc
DEPENDS+= ${RUBY_PKGPREFIX}-nokogiri-[0-9]*:../../textproc/ruby-nokogiri
DEPENDS+= ${RUBY_PKGPREFIX}-rdtool>=0.6.20:../../textproc/ruby-rdtool
DEPENDS+= ${RUBY_PKGPREFIX}-rttool-[0-9]*:../../textproc/ruby-rttool
DEPENDS+= ${RUBY_PKGPREFIX}-coderay>=1.0.0:../../textproc/ruby-coderay
DEPENDS+= ${RUBY_PKGPREFIX}-kramdown-[0-9]*:../../textproc/ruby-kramdown
DEPENDS+= ${RUBY_PKGPREFIX}-gettext-[0-9]*:../../devel/ruby-gettext
DEPENDS+= ${RUBY_PKGPREFIX}-faraday-[0-9]*:../../www/ruby-faraday
USE_RUBY_SETUP= yes
USE_RUBY_SETUP_PKG= yes
CONFIGURE_ARGS+= --siteruby=${PREFIX}/${RUBY_VENDORLIB_BASE} 
--siterubyver=${PREFIX}/${RUBY_VENDORLIB} 
--siterubyverarch=${PREFIX}/${RUBY_VENDORARCHLIB}
.include "../../lang/ruby/modules.mk"
.include "../../mk/bsd.pkg.mk"
05 26
distinfo
$NetBSD: distinfo,v 1.33 2013/06/29 11:54:45 obache Exp $
SHA1 (rabbit-2.1.0.tar.gz) = 0ee3f21fafd944bdcc7ba9ad324ae12b1785f1fd
RMD160 (rabbit-2.1.0.tar.gz) = a2085abad1d4d9230d4a1f76277340af49e3de0d
Size (rabbit-2.1.0.tar.gz) = 5156905 bytes
06 26
PLIST
07 26
Portablility
基本機能の実装は make, sh, awk, sed...
ツールを準備すれば他OSでも使える!
bootstrap sh script=> bmake => ksh =>
sed, awk ...
08 26
Supported Platforms
21 platforms
AIX, BSD/OS, Cygwin, Mac OS X, Debian/
kFreeBSD, DragonFly, FreeBSD, FreeMiNT,
HP-UX, Haiku, IRIX, Interix, Linux, Minix3,
MirBSD, NetBSD, OSF1, OpenBSD, QNX,
SunOS, UnixWare
09 26
What is "Supported Platform"
基本ツールのインストール
その他ツールの状況
特権ユーザ名
システム固有情報
shlib type
hier
10 26
Supported Compilers
Compaq C Compilers (ccc)
Clang C and Objective-C compiler (clang)
Intel C++ Compiler (icc)
SGI IRIS Development Option cc (ido)
GNU Compiler Collection (gcc)
HP-UX C/aC++ compilers (hp)
Silicon Graphics, Inc. MIPSpro (mipspro)
11 26
Supported Compilers
Portable C Compiler (pcc)
Sun Microsystems, Inc. WorkShip/Forte/
Sun ONE Studio (sunpro)
IBM's XL C/C++ compiler suite (xlc)
compiler cache (ccache)
distributed C/C++ (distcc)
Fortran 77 to C compiler (f2c)
12 26
What is "Supported Compiler"
引数の違いを吸収
書き換え -pthread => -mt
順序の入れ替え
バージョンによる切り分け
13 26
Supported binary package formats
native- FreeBSD ports由来だが非互換
FreeBSD ports (wip)
rpm (wip)
deb (wip)
14 26
Additioanl usage
インストール先を変更可能 (ex /opt/pkg)
非特権ユーザ利用 (ex ${HOME}/pkg)
15 26
Version Selectable
複数バージョンからの選択可能
Ruby 1.8/1.9/2.0
Python 2.6/2.7/3.2/3.3
MySQL 5.0/5.2/5.5/5.6
Lua 5.1/5.2
Apache 1.3/2.0/2.2/2.4
16 26
bulk build
全てのパッケージを build する
バイナリパッケージの作成
テストの意味合いもある
ツール
pbulk
distbb
17 26
package management
バイナリパッケージ利用
pkgin
nih
(pkg_install)
18 26
何と戦っているか
#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
#include <linux/sys.h>
#endif
Linux is the standard!
19 26
そして何と戦っているか?
if test x$have_foo == xyes; then
Bash-izm! Bash-izm!
20 26
どう戦っているか?
○○ for Linux
→たとえばNetBSDでおかしいよ?
←何がおかしいの?
→POSIX規格では云々
←ありがとう、直したよ!
commit log: Fixes for NetBSD
21 26
そしてどう戦っているか?
新しいパッケージ追加!
Solaris で build できない!
直す
パッケージアップデート
NetBSD/VAXで!
...
22 26
何に困るか
Commit log
リリースノートない
混沌とした summary
リリース技術の低下?
23 26
世界に戦いを挑む
Log Message:
Import mikutter-0.0.2.12 as net/mikutter.
For all mikker and ill of twitter users best twitter client.
Miku is so moe, so cute, so beautiful, fantastic, excellent,
magnificent, brilliant and my wife. moeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
24 26
pkgsrc Internals
暗黒世界
tools
wrapper
buildlink
25 26
never MATOME
Package once, use anywhere!
What is pkgsrc?
Welcome to new pkgsrc developers!
26 26

pkgsrc とは何か? - よもやま話