Notebook

これは日々の作業を通して学んだことや毎日の生活で気づいたことをを記録しておく備忘録である。

HTML ファイル生成日時: 2024/09/11 17:53:24.921 (台灣標準時)

pkgsrc に新しいパッケージを追加する方法

pkgsrc に使いたいソフトウェアが含まれていると、簡単にインストールする ことができて便利である。ここでは、 pkgsrc-wip に新しいソフトウェアを追 加する方法を整理してまとめておく。基本的に、 pkgsrc の公式文書を読めば、 作業の流れがわかるようになっている。

pkgsrc-wip に commit する権限をもらう

対になる秘密鍵と公開鍵を生成する

ssh-keygen コマンドを使って一対の秘密鍵と公開鍵を生成する。
% ssh-keygen -b 2048 -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/daisuke/.ssh/id_rsa): /home/daisuke/.ssh/pkgsrc_wip_rsa
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/daisuke/.ssh/pkgsrc_wip_rsa
Your public key has been saved in /home/daisuke/.ssh/pkgsrc_wip_rsa.pub
The key fingerprint is:
SHA256:l/LegXXXXXXwg2kVsXXXXXXsbHCXXXXXXRcSygM1phA daisuke@koenji
The key's randomart image is:
+---[RSA 2048]----+
|E.+              |
|.+ .  o   o  o o |
|o   .   . .      |
| = ...=. = =     |
|  +..=++S +      |
|  ...==.+B.      |
| .  +..o=+=.     |
|.  . o.. ++=.    |
|.++...   .=+o.   |
+----[SHA256]-----+
% ls -l .ssh/pkgsrc_wip_rsa*
-rw-------  1 daisuke  taiwan  1876 Jan 28 03:30 .ssh/pkgsrc_wip_rsa
-rw-r--r--  1 daisuke  taiwan   396 Jan 28 03:30 .ssh/pkgsrc_wip_rsa.pub
できた公開鍵 (pkgsrc_wip_rsa.pub) を pkgsrc-wip の責任者である Thomas Klausner に送る。メールアドレスは https://pkgsrc.org/wip/users/ に書かれている。 ~/.ssh/config に以下の記述を追加しておく。
Host wip.pkgsrc.org
        PubkeyAuthentication yes
        IdentityFile /home/daisuke/.ssh/pkgsrc_wip_rsa

git のインストール

pkgsrc を使って、 git をインストールする。
# cd /usr/pkgsrc/devel/git
# make install

git を使って pkgsrc-wip をダウンロードする

まず、以下の設定を行う。
# git config --global user.email "MY_ACCOUNT@XXX.YYY.ZZZ"
# git config --global user.name "MY_SURNAME MY_FIRSTNAME"
次に、 pkgsrc-wip をダウンロードする。
# cd /usr/pkgsrc
# git clone MY_ACCOUNT@wip.pkgsrc.org:/pkgsrc-wip.git wip
二度目以降は、以下のようにすれば最新の状態にすることができる。
# cd /usr/pkgsrc/wip
# git pull -r

新しいパッケージの作成

新しいパッケージを作る。ここでは、 astroalign というパッケージを取り上 げる。

/etc/mk.conf の設定

/etc/mk.conf に以下の記述を追加する。
PKG_DEVELOPER=yes

pkg_developer をインストールする

pkg_developer というパッケージをインストールする。
# cd /usr/pkgsrc/meta-pkgs/pkg_developer
# make install

新たなパッケージのためのディレクトリを作成する

新しいパッケージのためのデレクトリを作る。
# cd /usr/pkgsrc/wip/
# mkdir py-astroalign

Makefile の雛形を生成する

url2pkg というコマンドを使って Makefile の雛形を作る。
# cd /usr/pkgsrc/wip/py-astroalign
# url2pkg https://pypi.org/project/astroalign/
vi が起動して、 Makefile の雛形を編集できるようになる。 最初は、以下のような内容になっている。
# $NetBSD$

CATEGORIES=     # TODO: add primary category
MASTER_SITES=   https://pypi.org/project/astroalign/
EXTRACT_SUFX=   # none

MAINTAINER=     INSERT_YOUR_MAIL_ADDRESS_HERE # or use pkgsrc-users@NetBSD.org
HOMEPAGE=       https://pypi.org/project/astroalign/
COMMENT=        TODO: Short description of the package
#LICENSE=       # TODO: (see mk/license.mk)

# url2pkg-marker (please do not remove this line.)
.include "../../mk/bsd.pkg.mk"
以下のような内容にして、 vi を終了してみる。
# $NetBSD$

DISTNAME=       astroalign-2.3.1
PKGNAME=        ${PYPKGPREFIX}-${DISTNAME}
CATEGORIES=     math python
MASTER_SITES=   ${MASTER_SITE_PYPI:=a/astroalign/}

MAINTAINER=     pkgsrc-users@NetBSD.org
HOMEPAGE=       https://astroalign.readthedocs.io/en/latest/
COMMENT=        A Python module for aligning astronomical images
LICENSE=        mit

# url2pkg-marker (please do not remove this line.)
.include "../../lang/python/distutils.mk"
.include "../../mk/bsd.pkg.mk"
すると、ソースコードをダウンロードし、 make が始まる。
# url2pkg https://pypi.org/project/astroalign/
===> Cleaning for py39-astroalign-2.3.1
=> Bootstrap dependency digest>=20010302: found digest-20190127
=> Fetching astroalign-2.3.1.tar.gz
Trying [2a04:4e42::319]:443 ...
ftp: Can't connect to `2a04:4e42::319:443': No route to host
Trying [2a04:4e42:200::319]:443 ...
ftp: Can't connect to `2a04:4e42:200::319:443': No route to host
Trying [2a04:4e42:400::319]:443 ...
ftp: Can't connect to `2a04:4e42:400::319:443': No route to host
Trying [2a04:4e42:600::319]:443 ...
ftp: Can't connect to `2a04:4e42:600::319:443': No route to host
Trying 151.101.1.63:443 ...
Requesting https://files.pythonhosted.org/packages/source/a/astroalign/astroalign-2.3.1.tar.gz
Redirected to https://files.pythonhosted.org/packages/5e/cf/ce13356452bd43694370c4b648e80eec4a3b49c5ca2b080939581613e7a4/astroalign-2.3.1.tar.gz
Trying [2a04:4e42::319]:443 ...
ftp: Can't connect to `2a04:4e42::319:443': No route to host
Trying [2a04:4e42:200::319]:443 ...
ftp: Can't connect to `2a04:4e42:200::319:443': No route to host
Trying [2a04:4e42:400::319]:443 ...
ftp: Can't connect to `2a04:4e42:400::319:443': No route to host
Trying [2a04:4e42:600::319]:443 ...
ftp: Can't connect to `2a04:4e42:600::319:443': No route to host
Trying 151.101.1.63:443 ...
Requesting https://files.pythonhosted.org/packages/5e/cf/ce13356452bd43694370c4b648e80eec4a3b49c5ca2b080939581613e7a4/astroalign-2.3.1.tar.gz
100% |***********************************| 57846        1.70 MiB/s    00:00 ETA
57846 bytes retrieved in 00:00 (1.70 MiB/s)
=> Checksum SHA1 OK for astroalign-2.3.1.tar.gz
=> Checksum RMD160 OK for astroalign-2.3.1.tar.gz
=> Checksum SHA512 OK for astroalign-2.3.1.tar.gz
===> Installing dependencies for py39-astroalign-2.3.1
==========================================================================
The following variables will affect the build process of this package,
py39-astroalign-2.3.1.  Their current value is shown below:

        * PYTHON_VERSION_DEFAULT = 39

Based on these variables, the following variables have been set:

        * PYPACKAGE = python39

You may want to abort the process now with CTRL-C and change the value
of variables in the first group before continuing.  Be sure to run
`/usr/bin/make clean' after the changes.
==========================================================================
=> Tool dependency checkperms>=1.1: found checkperms-1.12
=> Build dependency cwrappers>=20150314: found cwrappers-20180325
=> Full dependency python39>=3.9.0: found python39-3.9.1
===> Checking for vulnerabilities in py39-astroalign-2.3.1
===> Overriding tools for py39-astroalign-2.3.1
===> Extracting for py39-astroalign-2.3.1
Traceback (most recent call last):
  File "/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/astroalign-2.3.1/setup.py", line 30, in 
    from ez_setup import use_setuptools
  File "/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/astroalign-2.3.1/ez_setup.py", line 21, in 
    from distutils import log
ImportError: cannot import name 'log' from 'distutils' (/usr/pkg/lib/url2pkg/distutils/__init__.py)
Traceback (most recent call last):
  File "/usr/pkg/bin/url2pkg", line 1157, in 
    main(sys.argv, Globals())
  File "/usr/pkg/bin/url2pkg", line 1147, in main
    Adjuster(g, url, initial_lines).adjust()
  File "/usr/pkg/bin/url2pkg", line 1116, in adjust
    self.adjust_python_module()
  File "/usr/pkg/bin/url2pkg", line 915, in adjust_python_module
    self.read_dependencies(cmd, env, self.abs_wrksrc, 'py-')
  File "/usr/pkg/bin/url2pkg", line 700, in read_dependencies
    output: bytes = subprocess.check_output(args=cmd, shell=True, env=effective_env, cwd=cwd)
  File "/usr/pkg/lib/python3.9/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/pkg/lib/python3.9/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '/usr/pkg/bin/python3.9 setup.py build' returned non-zero exit status 1.

もう一度 make を実行してみる

もう一度、 make を実行してみる。
# make
=> Bootstrap dependency digest>=20010302: found digest-20190127
===> Checking for vulnerabilities in py39-astroalign-2.3.1
===> Patching for py39-astroalign-2.3.1
===> Creating toolchain wrappers for py39-astroalign-2.3.1
===> Configuring for py39-astroalign-2.3.1
=> Checking for portability problems in extracted files
===> Building for py39-astroalign-2.3.1
(cd /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/astroalign-2.3.1/ && /usr/bin/env USETOOLS=no PTHREAD_CFLAGS=\ -pthread\  PTHREAD_LDFLAGS=\ -pthread PTHREAD_LIBS= PTHREADBASE=/usr DL_CFLAGS=\ -pthread\  DL_LDFLAGS=\ -pthread DL_LIBS= PYTHON=/usr/pkg/bin/python3.9 CC=gcc CFLAGS=-O2\ -D_FORTIFY_SOURCE=2\ -I/usr/include\ -I/usr/pkg/include/python3.9 CPPFLAGS=-I/usr/include\ -I/usr/pkg/include/python3.9 CXX=c++ CXXFLAGS=-O2\ -D_FORTIFY_SOURCE=2\ -I/usr/include\ -I/usr/pkg/include/python3.9 COMPILER_RPATH_FLAG=-Wl,-R F77=gfortran FC=gfortran FFLAGS=-O LANG=C LC_ALL=C LC_COLLATE=C LC_CTYPE=C LC_MESSAGES=C LC_MONETARY=C LC_NUMERIC=C LC_TIME=C LDFLAGS=-L/usr/lib\ -Wl,-R/usr/lib\ -Wl,-R/usr/pkg/lib LINKER_RPATH_FLAG=-R PATH=/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.cwrapper/bin:/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.buildlink/bin:/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.gcc/bin:/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.tools/bin:/usr/pkg/bin:/sbin:/usr/pkg/sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/bin:/usr/X11R7/bin:/usr/local/sbin:/usr/local/bin:/usr/pkg/bin:/usr/X11R7/bin PREFIX=/usr/pkg MAKELEVEL=0 CONFIG_SITE= PKG_SYSCONFDIR=/usr/pkg/etc CXXCPP=cpp HOME=/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.home CWRAPPERS_CONFIG_DIR=/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.cwrapper/config CPP=cpp LOCALBASE=/usr/pkg X11BASE=/usr/X11R7 PKGMANDIR=man PKGINFODIR=info PKGGNUDIR=gnu/ MAKECONF=/dev/null OBJECT_FMT=ELF USETOOLS=no BSD_INSTALL_PROGRAM=/usr/bin/install\ -c\ -s\ -o\ root\ -g\ wheel\ -m\ 755 BSD_INSTALL_SCRIPT=/usr/bin/install\ -c\ -o\ root\ -g\ wheel\ -m\ 755 BSD_INSTALL_LIB=/usr/bin/install\ -c\ -o\ root\ -g\ wheel\ -m\ 755 BSD_INSTALL_DATA=/usr/bin/install\ -c\ -o\ root\ -g\ wheel\ -m\ 644 BSD_INSTALL_MAN=/usr/bin/install\ -c\ -o\ root\ -g\ wheel\ -m\ 644 BSD_INSTALL=/usr/bin/install BSD_INSTALL_PROGRAM_DIR=/usr/bin/install\ -d\ -o\ root\ -g\ wheel\ -m\ 755 BSD_INSTALL_SCRIPT_DIR=/usr/bin/install\ -d\ -o\ root\ -g\ wheel\ -m\ 755 BSD_INSTALL_LIB_DIR=/usr/bin/install\ -d\ -o\ root\ -g\ wheel\ -m\ 755 BSD_INSTALL_DATA_DIR=/usr/bin/install\ -d\ -o\ root\ -g\ wheel\ -m\ 755 BSD_INSTALL_MAN_DIR=/usr/bin/install\ -d\ -o\ root\ -g\ wheel\ -m\ 755 BSD_INSTALL_GAME=/usr/bin/install\ -c\ -s\ -o\ root\ -g\ wheel\ -m\ 2555 BSD_INSTALL_GAME_DATA=/usr/bin/install\ -c\ -o\ root\ -g\ wheel\ -m\ 664 BSD_INSTALL_GAME_DIR=/usr/bin/install\ -d\ -o\ root\ -g\ wheel\ -m\ 775 INSTALL_INFO= MAKEINFO=/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.tools/bin/makeinfo FLEX= BISON= PKG_CONFIG= PKG_CONFIG_LIBDIR=/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.buildlink/lib/pkgconfig:/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.buildlink/share/pkgconfig PKG_CONFIG_LOG=/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.pkg-config.log PKG_CONFIG_PATH= CWRAPPERS_CONFIG_DIR=/data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.cwrapper/config /usr/pkg/bin/python3.9  setup.py  build  -j8)
running build
running build_py
creating build
creating build/lib
copying astroalign.py -> build/lib
copying ez_setup.py -> build/lib

Makefile の修正

setuptools を必要とするようなので、 Makefile に依存性を書き込む。
# $NetBSD$

DISTNAME=       astroalign-2.3.1
PKGNAME=        ${PYPKGPREFIX}-${DISTNAME}
CATEGORIES=     math python
MASTER_SITES=   ${MASTER_SITE_PYPI:=a/astroalign/}

MAINTAINER=     pkgsrc-users@NetBSD.org
HOMEPAGE=       https://astroalign.readthedocs.io/en/latest/
COMMENT=        A Python module for aligning astronomical images
LICENSE=        mit

DEPENDS+=       ${PYPKGPREFIX}-setuptools>=50.3.2:../../devel/py-setuptools
DEPENDS+=       ${PYPKGPREFIX}-setuptools_scm>=4.1.2:../../devel/py-setuptools_scm

# url2pkg-marker (please do not remove this line.)
.include "../../lang/python/distutils.mk"
.include "../../mk/bsd.pkg.mk"

make の実行

make を実行してみる。
# make clean
===> Cleaning for py39-astroalign-2.3.1
# make
=> Bootstrap dependency digest>=20010302: found digest-20190127
=> Checksum SHA1 OK for astroalign-2.3.1.tar.gz
=> Checksum RMD160 OK for astroalign-2.3.1.tar.gz
=> Checksum SHA512 OK for astroalign-2.3.1.tar.gz
===> Installing dependencies for py39-astroalign-2.3.1
==========================================================================
The following variables will affect the build process of this package,
py39-astroalign-2.3.1.  Their current value is shown below:

        * PYTHON_VERSION_DEFAULT = 39

Based on these variables, the following variables have been set:

        * PYPACKAGE = python39

You may want to abort the process now with CTRL-C and change the value
of variables in the first group before continuing.  Be sure to run
`/usr/bin/make clean' after the changes.
==========================================================================
=> Tool dependency checkperms>=1.1: found checkperms-1.12
=> Build dependency cwrappers>=20150314: found cwrappers-20180325
=> Full dependency py39-setuptools>=50.3.2: found py39-setuptools-51.3.3
=> Full dependency py39-setuptools_scm>=4.1.2: found py39-setuptools_scm-5.0.1
=> Full dependency python39>=3.9.0: found python39-3.9.1
===> Checking for vulnerabilities in py39-astroalign-2.3.1
===> Overriding tools for py39-astroalign-2.3.1
===> Extracting for py39-astroalign-2.3.1
===> Patching for py39-astroalign-2.3.1
===> Creating toolchain wrappers for py39-astroalign-2.3.1
===> Configuring for py39-astroalign-2.3.1
=> Checking for portability problems in extracted files
===> Building for py39-astroalign-2.3.1

.....

running build
running build_py
creating build
creating build/lib
copying astroalign.py -> build/lib
copying ez_setup.py -> build/lib
うまくコンパイルできたようである。

pkglint の実行

pkglint を実行して、どの部分の書き方がよくないか、また、何が不足してい るかなどを確認する。
# pkglint 
NOTE: Makefile:3: Variable values should be aligned with tabs, not spaces.
NOTE: Makefile:4: Variable values should be aligned with tabs, not spaces.
NOTE: Makefile:5: Variable values should be aligned with tabs, not spaces.
NOTE: Makefile:6: Variable values should be aligned with tabs, not spaces.
WARN: Makefile:10: COMMENT should not begin with "A".
NOTE: Makefile:8: Variable values should be aligned with tabs, not spaces.
NOTE: Makefile:9: Variable values should be aligned with tabs, not spaces.
NOTE: Makefile:10: Variable values should be aligned with tabs, not spaces.
NOTE: Makefile:11: Variable values should be aligned with tabs, not spaces.
ERROR: Makefile:16: This comment indicates unfinished work (url2pkg).
ERROR: Makefile: Each package must have a DESCR file.
2 errors, 1 warning and 8 notes found.
(Run "pkglint -fs" to show what can be fixed automatically.)
(Run "pkglint -F" to automatically fix some issues.)
いろいろと文句を言われた。まず、 Makefile のなかでは、空白ではなく、タ ブを使うべきらしい。 Makefile の 16 行目が余分らしい。また、 DESCR ファ イルも作成すべきらしい。 これらを修正すると、以下のようになる。まず Makefile は以下の通り。
# $NetBSD$

DISTNAME=       astroalign-2.3.1
PKGNAME=        ${PYPKGPREFIX}-${DISTNAME}
CATEGORIES=     math python
MASTER_SITES=   ${MASTER_SITE_PYPI:=a/astroalign/}

MAINTAINER=     pkgsrc-users@NetBSD.org
HOMEPAGE=       https://astroalign.readthedocs.io/en/latest/
COMMENT=        A Python module for aligning astronomical images
LICENSE=        mit

DEPENDS+=       ${PYPKGPREFIX}-setuptools>=50.3.2:../../devel/py-setuptools
DEPENDS+=       ${PYPKGPREFIX}-setuptools_scm>=4.1.2:../../devel/py-setuptools_scm

.include "../../lang/python/distutils.mk"
.include "../../mk/bsd.pkg.mk"
DESCR ファイルは次のような内容とした。
Astroalign is a Python module for aligning astronomical images.
もう一度、 pkglint を実行してみる。
# pkglint 
WARN: Makefile:10: COMMENT should not begin with "A".
1 warning found.
COMMENT 行は A で始まってはいけないらしいので、 Makefile を修正する。
# $NetBSD$

DISTNAME=       astroalign-2.3.1
PKGNAME=        ${PYPKGPREFIX}-${DISTNAME}
CATEGORIES=     math python
MASTER_SITES=   ${MASTER_SITE_PYPI:=a/astroalign/}

MAINTAINER=     pkgsrc-users@NetBSD.org
HOMEPAGE=       https://astroalign.readthedocs.io/en/latest/
COMMENT=        Python module for aligning astronomical images
LICENSE=        mit

DEPENDS+=       ${PYPKGPREFIX}-setuptools>=50.3.2:../../devel/py-setuptools
DEPENDS+=       ${PYPKGPREFIX}-setuptools_scm>=4.1.2:../../devel/py-setuptools_scm

.include "../../lang/python/distutils.mk"
.include "../../mk/bsd.pkg.mk"
今度は、問題ないようである。
# pkglint 
Looks fine.

make install の実行

make install を実行する。
# make clean
===> Cleaning for py39-astroalign-2.3.1
koenji# make install
=> Bootstrap dependency digest>=20010302: found digest-20190127
=> Checksum SHA1 OK for astroalign-2.3.1.tar.gz
=> Checksum RMD160 OK for astroalign-2.3.1.tar.gz
=> Checksum SHA512 OK for astroalign-2.3.1.tar.gz
===> Installing dependencies for py39-astroalign-2.3.1
==========================================================================
The following variables will affect the build process of this package,
py39-astroalign-2.3.1.  Their current value is shown below:

        * PYTHON_VERSION_DEFAULT = 39

Based on these variables, the following variables have been set:

        * PYPACKAGE = python39

You may want to abort the process now with CTRL-C and change the value
of variables in the first group before continuing.  Be sure to run
`/usr/bin/make clean' after the changes.
==========================================================================
=> Tool dependency checkperms>=1.1: found checkperms-1.12
=> Build dependency cwrappers>=20150314: found cwrappers-20180325
=> Full dependency py39-setuptools>=50.3.2: found py39-setuptools-51.3.3
=> Full dependency py39-setuptools_scm>=4.1.2: found py39-setuptools_scm-5.0.1
=> Full dependency python39>=3.9.0: found python39-3.9.1
===> Checking for vulnerabilities in py39-astroalign-2.3.1
===> Overriding tools for py39-astroalign-2.3.1
===> Extracting for py39-astroalign-2.3.1
===> Patching for py39-astroalign-2.3.1
===> Creating toolchain wrappers for py39-astroalign-2.3.1
===> Configuring for py39-astroalign-2.3.1
=> Checking for portability problems in extracted files
===> Building for py39-astroalign-2.3.1

.....

=> Automatic manual page handling
=> Generating post-install file lists
=> Checking file-check results for py39-astroalign-2.3.1
ERROR: ************************************************************
ERROR: The following files are in /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg but not in the PLIST:
ERROR:         /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg/lib/python3.9/site-packages/__pycache__/astroalign.cpython-39.opt-1.pyc
ERROR:         /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg/lib/python3.9/site-packages/__pycache__/astroalign.cpython-39.pyc
ERROR:         /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg/lib/python3.9/site-packages/__pycache__/ez_setup.cpython-39.opt-1.pyc
ERROR:         /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg/lib/python3.9/site-packages/__pycache__/ez_setup.cpython-39.pyc
ERROR:         /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg/lib/python3.9/site-packages/astroalign-2.3.1-py3.9.egg-info/PKG-INFO
ERROR:         /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg/lib/python3.9/site-packages/astroalign-2.3.1-py3.9.egg-info/SOURCES.txt
ERROR:         /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg/lib/python3.9/site-packages/astroalign-2.3.1-py3.9.egg-info/dependency_links.txt
ERROR:         /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg/lib/python3.9/site-packages/astroalign-2.3.1-py3.9.egg-info/requires.txt
ERROR:         /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg/lib/python3.9/site-packages/astroalign-2.3.1-py3.9.egg-info/top_level.txt
ERROR:         /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg/lib/python3.9/site-packages/astroalign.py
ERROR:         /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.destdir/usr/pkg/lib/python3.9/site-packages/ez_setup.py
*** Error code 1

Stop.
make[1]: stopped in /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/wip/py-astroalign
PLIST ファイルの内容が不完全なためにエラーが発生している。 PLIST ファ イルを生成する。以下のようにすればよい。
# make print-PLIST
@comment $NetBSD$
${PYSITELIB}/${EGG_FILE}/PKG-INFO
${PYSITELIB}/${EGG_FILE}/SOURCES.txt
${PYSITELIB}/${EGG_FILE}/dependency_links.txt
${PYSITELIB}/${EGG_FILE}/requires.txt
${PYSITELIB}/${EGG_FILE}/top_level.txt
${PYSITELIB}/astroalign.py
${PYSITELIB}/astroalign.pyc
${PYSITELIB}/astroalign.pyo
${PYSITELIB}/ez_setup.py
${PYSITELIB}/ez_setup.pyc
${PYSITELIB}/ez_setup.pyo
# make print-PLIST > PLIST
再び、 make install を実行してみる。
# make clean
===> Cleaning for py39-astroalign-2.3.1
koenji# make install
=> Bootstrap dependency digest>=20010302: found digest-20190127
=> Checksum SHA1 OK for astroalign-2.3.1.tar.gz
=> Checksum RMD160 OK for astroalign-2.3.1.tar.gz
=> Checksum SHA512 OK for astroalign-2.3.1.tar.gz
===> Installing dependencies for py39-astroalign-2.3.1
==========================================================================
The following variables will affect the build process of this package,
py39-astroalign-2.3.1.  Their current value is shown below:

        * PYTHON_VERSION_DEFAULT = 39

Based on these variables, the following variables have been set:

        * PYPACKAGE = python39

You may want to abort the process now with CTRL-C and change the value
of variables in the first group before continuing.  Be sure to run
`/usr/bin/make clean' after the changes.
==========================================================================
=> Tool dependency checkperms>=1.1: found checkperms-1.12
=> Build dependency cwrappers>=20150314: found cwrappers-20180325
=> Full dependency py39-setuptools>=50.3.2: found py39-setuptools-51.3.3
=> Full dependency py39-setuptools_scm>=4.1.2: found py39-setuptools_scm-5.0.1
=> Full dependency python39>=3.9.0: found python39-3.9.1
===> Checking for vulnerabilities in py39-astroalign-2.3.1
===> Overriding tools for py39-astroalign-2.3.1
===> Extracting for py39-astroalign-2.3.1
===> Patching for py39-astroalign-2.3.1
===> Creating toolchain wrappers for py39-astroalign-2.3.1
===> Configuring for py39-astroalign-2.3.1
=> Checking for portability problems in extracted files
===> Building for py39-astroalign-2.3.1

.....

running install_scripts
=> Automatic manual page handling
=> Generating post-install file lists
=> Checking file-check results for py39-astroalign-2.3.1
=> Checking for non-existent script interpreters in py39-astroalign-2.3.1
=> Checking file permissions in py39-astroalign-2.3.1
=> Checking for missing run-time search paths in py39-astroalign-2.3.1
=> Checking for work-directory references in py39-astroalign-2.3.1
=> Creating binary package /data0/netbsd/pkgsrc/current/pkgsrc/wip/py-astroalign/work/.packages/py39-astroalign-2.3.1.tgz
===> Building binary package for py39-astroalign-2.3.1
=> Creating binary package /tmp/packages/All/py39-astroalign-2.3.1.tgz
===> Installing binary package of py39-astroalign-2.3.1
今度は、うまくいった。

distinfo ファイルの再生成

今回は必要ないが、パッチファイルを作ったり、バージョンを上げたりしたと きには、 distinfo ファイルを再生成する必要が出てくる。そのときには、 make makesum コマンドを実行すればよい。
# make makesum
=> Bootstrap dependency digest>=20010302: found digest-20190127
=> distinfo: distfiles part unchanged.

パッチの作成

今回は必要ないが、場合によってはソースコードを修正する必要がある。その ような場合には、 pkgvi コマンドを使ってソースコードを修正する。その後、 mkpatches コマンドを実行すると、パッチファイルが自動生成される。

make clean しておく

make clean を実行しておく。
# make clean
===> Cleaning for py39-astroalign-2.3.1

パッケージの pkgsrc-wip への commit

パッケージができたので、 pkgsrc-wip へ commit する。

git add

git add コマンドを使う。
# cd /usr/pkgsrc/wip
# git add py-astroalign

Makefile の修正

/usr/pkgsrc/wip/Makefile を編集する。
# vi Makefile
今回の場合、 Makefile に以下の行を追加する。
SUBDIR+=        py-astroalign
git add を実行する。
# git add Makefile

git status

git status を実行して状況を確認する。
# git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged ..." to unstage)
        new file:   py-astroalign/DESCR
        new file:   py-astroalign/Makefile
        new file:   py-astroalign/PLIST
        new file:   py-astroalign/distinfo

Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git restore ..." to discard changes in working directory)
        modified:   Makefile

git commit

git commit を実行する。
# git commit
[master 2b95696a98] py-astroalign: new package py-astroalign for aligning two astronomical images
 4 files changed, 36 insertions(+)
 create mode 100644 py-astroalign/DESCR
 create mode 100644 py-astroalign/Makefile
 create mode 100644 py-astroalign/PLIST
 create mode 100644 py-astroalign/distinfo
vi が起動するので、一行のパッケージについての説明を書き込む。
py-astroalign: new package py-astroalign for aligning two astronomical images   
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
#       new file:   py-astroalign/DESCR
#       new file:   py-astroalign/Makefile
#       new file:   py-astroalign/PLIST
#       new file:   py-astroalign/distinfo
#
# Changes not staged for commit:
#       modified:   Makefile
#
# Untracked files:
#       SAOImageDS9/
#       openorb/
#

git push

最後に、 git push して新たなパッケージを pkgsrc-wip へ追加する。
# git push
Enter passphrase for key '/home/daisuke/.ssh/pkgsrc_wip_rsa': 
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 16 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.20 KiB | 1.20 MiB/s, done.
Total 7 (delta 1), reused 0 (delta 0), pack-reused 0
To wip.pkgsrc.org:/pkgsrc-wip.git
   50cfa45cbe..2b95696a98  master -> master

参考文献



Frequently accessed files

  1. Computer___Python/20220518_0.html
  2. Computer___Network/20230726_00.html
  3. Computer___Network/20230516_00.html
  4. Computer___FreeBSD/20220621_0.html
  5. Misc___Taiwan/20240207_00.html
  6. Computer___Python/20220715_0.html
  7. Food___Taiwan/20220429_0.html
  8. Computer___Network/20230508_00.html
  9. Computer___NetBSD/20220817_3.html
  10. Computer___Python/20220410_0.html
  11. Computer___Debian/20210223_1.html
  12. Computer___Python/20210124_0.html
  13. Computer___NetBSD/20220818_1.html
  14. Computer___NetBSD/20220428_0.html
  15. Computer___Python/20221013_0.html
  16. Science___Math/20220420_0.html
  17. Computer___NetBSD/20230119_00.html
  18. Computer___Network/20240416_00.html
  19. Computer___Network/20240130_00.html
  20. Science___Astronomy/20220503_0.html
  21. Computer___TeX/20230503_00.html
  22. Computer___NetBSD/20220808_0.html
  23. Computer___NetBSD/20230515_00.html
  24. Computer___NetBSD/20240101_02.html
  25. Computer___NetBSD/20210204_0.html
  26. Travel___Taiwan/20220809_2.html
  27. Computer___Python/20220816_1.html
  28. Science___Astronomy/20220420_1.html
  29. Food___Taiwan/20230526_00.html
  30. Computer___Python/20240101_00.html


HTML file generated by Kinoshita Daisuke.