我正在将 makemkv 移植到 freebsd 10.2,因此我编写了以下 makefile:
# New ports collection makefile for: makemkv
# Date created: 05 Mar 2012
# Date Updated: 10 April 2016
# Whom: kappei84
#
# $FreeBSD$
#
PORTNAME= makemkv
PORTVERSION= 1.9.9
CATEGORIES= multimedia
DISTNAME= ${PORTNAME}-oss-${PORTVERSION}${EXTRACT_SUFFIX}
MASTER_SITES= http://www.makemkv.com/download/
# Prefix for the pkp-plist
#PLIST_SUB= DATADIR=${PREFIX}
# Missing qt4/qt5 dependency check in case the port is built with --enable-gui
BUILD_DEPENDS= ffmpeg${FFMPEG_SUFX}:${PORTSDIR}/multimedia/ffmpeg${FFMPEG_SUFX}
MAINTAINER=
COMMENT= Make MKV from Blu-ray and DVD
GNU_CONFIGURE= yes
OPTIONS_DEFINE= GUI
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MGUI}
CONFIGURE_ARGS+= --enable-gui
.else
CONFIGURE_ARGS+= --disable-gui
.endif # GUI
# flags for the configure script
CPPFLAGS+= -I${LOCALBASE}/include
LIBS+= -L${LOCALBASE}/lib
MAKEFILE= Makefile
USES= gmake
USE_OPENSSL= yes
USE_LDCONFIG= yes
USE_QT_VER= 4
QT_COMPONENTS= qmake gui svg webkit xml moc uic rcc imageformats
do-install:
.if ${PORT_OPTIONS:MGUI}
${INSTALL_PROGRAM} ${WRKSRC}/out/${PORTNAME} ${PREFIX}/bin
.endif
.for i in libdriveio.so.0 libmakemkv.so.1 libmmbd.so.0
${INSTALL_PROGRAM} ${WRKSRC}/out/${i} ${PREFIX}/lib
.endfor
@ cd ${PREFIX}/lib ; \
${LN} -sf libdriveio.so.0 libdriveio.so ; \
${LN} -sf libmakemkv.so.1 libmakemkv.so ; \
${LN} -sf libmmbd.so.0 libmmbd.so
.include <bsd.port.mk>
该 makefile 引用原始应用程序的 Makefile,它编译并创建生成三个库所需的所有源文件libdriveio.so,libmakemkv.so.1和libmmbd.so.0被复制到/usr/local/lib随着安装后。直到这一步为止,一切都运行良好,正如您从下面的日志中看到的那样:
gmake[2]: Leaving directory '/usr/ports/multimedia/makemkv/work/makemkv-oss-1.9.9'
===> Staging for makemkv-1.9.9
===> Generating temporary packing list
install -s -m 555 /usr/ports/multimedia/makemkv/work/makemkv-oss-1.9.9/out/libdriveio.so.0 /usr/local/lib
install -s -m 555 /usr/ports/multimedia/makemkv/work/makemkv-oss-1.9.9/out/libmakemkv.so.1 /usr/local/lib
install -s -m 555 /usr/ports/multimedia/makemkv/work/makemkv-oss-1.9.9/out/libmmbd.so.0 /usr/local/lib
我没有得到的是在 do-install 之后执行的最后阶段,即注册阶段:
====> Compressing man pages (compress-man)
===> Installing for makemkv-1.9.9
===> Checking if makemkv already installed
===> Registering installation for makemkv-1.9.9
pkg-static: Unable to access file /usr/ports/multimedia/makemkv/work/stage/lib/libdriveio.so: No such file or directory
pkg-static: Unable to access file /usr/ports/multimedia/makemkv/work/stage/lib/libdriveio.so.0: No such file or directory
pkg-static: Unable to access file /usr/ports/multimedia/makemkv/work/stage/lib/libmakemkv.so: No such file or directory
pkg-static: Unable to access file /usr/ports/multimedia/makemkv/work/stage/lib/libmakemkv.so.1: No such file or directory
pkg-static: Unable to access file /usr/ports/multimedia/makemkv/work/stage/lib/libmmbd.so.0: No such file or directory
pkg-static: Unable to access file /usr/ports/multimedia/makemkv/work/stage/lib/libmmbd.so: No such file or directory
*** Error code 74
Stop.
make[1]: stopped in /usr/ports/multimedia/makemkv
*** Error code 1
Stop.
make: stopped in /usr/ports/multimedia/makemkv
正如您所看到的,某些文件(在名为 pkg-plist 的文件中列出)无法在预期路径下找到,并且安装失败。
有什么方法可以避免或更改 pkg-static 应该检查的默认文件夹?由于它是我的第一个端口,是否有必要执行此阶段并拥有 pkg-plist,或者是否也可以删除这样的文件,因为主库已复制到正确的路径中?
答案1
您的 Makefile 似乎试图直接安装到${PREFIX}
。这是不是这些天事情是怎么做的。
您应该安装到${STAGEDIR}${PREFIX}
.这是一个暂存区域,在${WRKDIR}
该区域下镜像目标目录。 by 调用的底层东西make install
将从那里获取文件,这就是注册的工作原理。
完整详细信息请参见此处:
https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/special.html#staging
但如有任何问题,请随时发表评论。