I wanted to build vim package for debian from source and I’m getting this error when running command dpkg-buildpackage -rfakeroot
dh_clean
dpkg-source -b .
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building vim using existing ./vim_8.2.5106.orig.tar.gz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: warning: newly created empty file 'src/auto/config.h' will not be represented in diff
dpkg-source: info: building vim in vim_8.2.5106-1.debian.tar.xz
dpkg-source: info: building vim in vim_8.2.5106-1.dsc
debian/rules build
dh build
dh_update_autotools_config
dh_autoreconf
dh_auto_configure
./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking
configure: error: unrecognized option: `--runstatedir=/run'
Try `auto/configure --help' for more information
dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking returned exit code 1
make: *** [debian/rules:18: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
If i understand this correctly the problem is in a flag `--runstatedir=/run'
that is unrecognized. How can i solve this issue?
2
Answers
Before continuing have you installed properly all build dependencies ?
Have a look at : https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#control and more especially at the
Build-Depends
section.In parallel you can also launch the command
dpkg-depcheck -d ./configure
to find some missing packages.Vim package is regularly updated and last commit was 2w ago so I would be very astonished that it won’t compile.
Have a look at: https://salsa.debian.org/vim-team/vim
I suppose you’re backporting vim from debian source of a newer distribution to an older distribution.
Then it’s caused by debhelper->
dh_auto_configure
adding this parameter.dh_auto_configure
runs<source_dir>/configure
with this parameter.<source_dir>/configure
is generated byautoconf
, in such case, likely debhelper->autoreconf
, which callsautoreconf
->autoconf
to generate<source_dir>/configure
. In case the version ofautoconf
is not up-to-date enough, the generated<source_dir>/configure
lacks--runstatedir=/run
support, and hence you see this log:To solve it, you can upgrade your
autoconf
package version, but obviously that’s not what you always want to do (you may have to backport a lot of dependencies). So instead, just don’t letdh_auto_configure
pass this argument:You can see this perl code in
/usr/share/perl5/Debian/Debhelper/Buildsystem/autoconf.pm
:So just modify
debian/compat
in extracted debian source of vim, lower its value to10
, and build again, nowdh_auto_configure
should never try passing--runstatedir=/run
when calling<source_dir>/configure
any more.