构建 ffmpeg deb 包时出现 fakeroot debian/rules clean 错误退出状态 2

构建 ffmpeg deb 包时出现 fakeroot debian/rules clean 错误退出状态 2

我正在尝试构建我的第一个 .deb 包(使用 ffmpeg 源),但出现了一些错误。以下是我的步骤,可以重现此错误:

git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg-git                                                                                                                                                                                        
cd ffmpeg-git
git checkout n2.4.2
cd ..
mv ffmpeg-git ffmpeg-2.4.2
tar -czf ffmpeg-2.4.2.tar.gz ffmpeg-2.4.2
cd ffmpeg-2.4.2
dh_make --copyright gpl -f ../ffmpeg-2.4.2.tar.gz
dpkg-buildpackage -uc -us -B -rfakeroot

dpkg-buildpackage: source package ffmpeg
dpkg-buildpackage: source version 2.4.2-1
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by Patryk <[email protected]>
dpkg-buildpackage: host architecture amd64
 dpkg-source --before-build ffmpeg-2.4.2
 fakeroot debian/rules clean
dh clean  --with autotools-dev
   dh_testdir
   dh_auto_clean
make[1]: Entering directory `/home/XXXXX/programming/tools/vlc/ffmpeg-2.4.2'
Makefile:2: config.mak: No such file or directory
Makefile:58: /common.mak: No such file or directory
Makefile:99: /libavutil/Makefile: No such file or directory
Makefile:99: /library.mak: No such file or directory
Makefile:101: /doc/Makefile: No such file or directory
Makefile:184: /tests/Makefile: No such file or directory
make[1]: *** No rule to make target `/tests/Makefile'.  Stop.
make[1]: Leaving directory `/home/XXXXX/programming/tools/vlc/ffmpeg-2.4.2'
dh_auto_clean: make -j1 distclean returned exit code 2
make: *** [clean] Error 2
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2

编辑

尝试卸载:

debuild
 dpkg-buildpackage -rfakeroot -D -us -uc
dpkg-buildpackage: source package ffmpeg
dpkg-buildpackage: source version 2.4.2-1
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by Patryk <[email protected]>
 dpkg-source --before-build ffmpeg-2.4.2
dpkg-buildpackage: host architecture amd64
 fakeroot debian/rules clean
dh clean  --with autotools-dev
   dh_testdir
   dh_auto_clean
make[1]: Entering directory `/home/XXXXX/programming/tools/vlc/ffmpeg-2.4.2'
Makefile:2: config.mak: No such file or directory
Makefile:58: /common.mak: No such file or directory
Makefile:99: /libavutil/Makefile: No such file or directory
Makefile:99: /library.mak: No such file or directory
Makefile:101: /doc/Makefile: No such file or directory
Makefile:184: /tests/Makefile: No such file or directory
make[1]: *** No rule to make target `/tests/Makefile'.  Stop.
make[1]: Leaving directory `/home/XXXXX/programming/tools/vlc/ffmpeg-2.4.2'
dh_auto_clean: make -j1 distclean returned exit code 2
make: *** [clean] Error 2
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2
debuild: fatal error at line 1364:
dpkg-buildpackage -rfakeroot -D -us -uc -v failed

编辑1

debian/rules

#!/usr/bin/make -f                                                                                                                                                                                                                         
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
  dh $@  --with autotools-dev

编辑2

添加@user26687 更改后出错

INSTALL libavutil/ffversion.h
INSTALL libavutil/libavutil.pc
make[1]: Leaving directory `/home/XXXXX/programming/tools/vlc/ffmpeg-2.4.2'
   dh_installdocs
        install -g 0 -o 0 -d debian/ffmpeg/usr/share/doc/ffmpeg
        cp -a README.md debian/ffmpeg/usr/share/doc/ffmpeg
        chown -R 0:0 debian/ffmpeg/usr/share/doc
        chmod -R go=rX debian/ffmpeg/usr/share/doc
        chmod -R u\+rw debian/ffmpeg/usr/share/doc
        install -g 0 -o 0 -m 644 -p debian/README.Debian debian/ffmpeg/usr/share/doc/ffmpeg/README.Debian
        install -g 0 -o 0 -m 644 -p debian/copyright debian/ffmpeg/usr/share/doc/ffmpeg/copyright
   dh_installchangelogs
        install -o 0 -g 0 -p -m644 debian/changelog debian/ffmpeg/usr/share/doc/ffmpeg/changelog.Debian
   dh_perl
   dh_usrlocal
dh_usrlocal: debian/ffmpeg/usr/local/share/man/man3/libavdevice.3 is not a directory
dh_usrlocal: debian/ffmpeg/usr/local/share/man/man3/libswscale.3 is not a directory
dh_usrlocal: debian/ffmpeg/usr/local/share/man/man3/libswresample.3 is not a directory
dh_usrlocal: debian/ffmpeg/usr/local/share/man/man3/libavcodec.3 is not a directory
dh_usrlocal: debian/ffmpeg/usr/local/share/man/man3/libavutil.3 is not a directory
dh_usrlocal: debian/ffmpeg/usr/local/share/man/man3/libavformat.3 is not a directory
dh_usrlocal: debian/ffmpeg/usr/local/share/man/man3/libavfilter.3 is not a directory
        "rmdir debian/ffmpeg/usr/local/share/man/man3"
rmdir: failed to remove ‘debian/ffmpeg/usr/local/share/man/man3’: Directory not empty
dh_usrlocal: rmdir debian/ffmpeg/usr/local/share/man/man3 returned exit code 1
make: *** [binary] Error 1
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
debuild: fatal error at line 1364:
dpkg-buildpackage -rfakeroot -D -us -uc -b failed

答案1

您可以...吗

添加你的 debian/rules 文件,因为现在我只是猜测:

在这儿

最小的 debian/规则。

由于 dh_auto_clean 执行得太早,使用 Trusty 时包构建无法进行。

变更日志在这里:

将 override_dh_auto_clean 添加到 debian/rules。使用 Trusty,make 在 configure 步骤之前执行;dh_auto_clean -> make (?)

我在 Debian 规则中有:

override_dh_auto_clean:
    dh_testdir
    dh_clean

- - -编辑 - - -

使用 Ubuntu 14.10 进行测试。

使用 debian/rules:

#!/usr/bin/make -f                                                                                                                                                                                                                         
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
  dh $@  --with autotools-dev

我遇到了和你一样的错误。

使用 debian/rules:

#!/usr/bin/make -f                                                                                                                                                                                                                         
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
    dh $@  --with autotools-dev

override_dh_auto_clean:

override_dh_auto_configure:
    ./configure --enable-gpl

大楼正在建设中...

'override_dh_auto_configure:' 在那里,因为我确实得到了 dh_auto_configure 的错误:

Unknown option "--build=x86_64-linux-gnu".
See ./configure --help for available options.
dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libexecdir=${prefix}/lib/ffmpeg --disable-maintainer-mode --disable-dependency-tracking returned exit code 1
debian/rules:7: recipe for target 'build' failed

相关内容