Open Jingwiw opened 3 months ago
从tarsier
的openEuler:24.03:Epol
拉取system-config-printer
调整spec
中的%file
,并将版本更新到了1.15.18
,获取了github
仓库中的最新源码
Name: system-config-printer
Summary: a graphical tool for CUPS administration
Version: 1.5.18
Release: 24
License: GPLv2+
URL: https://github.com/OpenPrinting/system-config-printer
Source0: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz
尝试构建
osc build mainline_riscv64 riscv64 --vm-type=nspawn
出现以下报错:
[ 76s] checking pkg-config is at least version 0.9.0... yes
[ 76s] checking for CUPS SERVERBIN dir... configure: error: No CUPS pkgconfig file present and no CUPS SERVERBIN dir defined in configure options.
[ 76s] error: Bad exit status from /var/tmp/rpm-tmp.7rHJIu (%build)
检查system-config-printer 1.15.18
源码,发现原因是没有cups
相关的pkgconfig
文件:
AS_IF([test "x$PKG_CONFIG" != x], [
AS_IF([$PKG_CONFIG --exists cups], [
cupsserverbindir=$($PKG_CONFIG --variable=cups_serverbin cups)
AC_MSG_RESULT([$cupsserverbindir])
], [
AC_MSG_ERROR([No CUPS pkgconfig file present and no CUPS SERVERBIN dir defined in configure options.])
])
], [
openEuler 24:03
和fedora rawhide
分支中的cups
软件包都为版本2.4.7
,所以我检查了各自的cups
软件包spec
文件,发现cups-devel
依赖缺少pkgconf-pkg-config
, %build
乃至最后的打包列表都有关于pkgconfig
文件路径的差异:
fedora rawhide cup-devel
%package devel
Summary: CUPS printing system - development environment
License: LGPLv2
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
Requires: gnutls-devel
Requires: krb5-devel
Requires: pkgconf-pkg-config
Requires: zlib-devel
fedora
的 %configure
中有--with-pkgconfpath
%files devel
%{_bindir}/cups-config
%{_includedir}/cups
%{_libdir}/*.so
%{_libdir}/pkgconfig/cups.pc
%{_mandir}/man1/cups-config.1.gz
%{_rpmconfigdir}/macros.d/macros.cups
openEuler 24.03 cup-devel
%package devel
Summary: CUPS printing system - development environment
License: Apache-2.0
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
Requires: gnutls-devel krb5-devel zlib-devel
%build
export DSOFLAGS="$DSOFLAGS -L../cgi-bin -L../filter -L../ppdc -L../scheduler -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/generic-hardened-ld -Wl,-z,relro,-z,now -fPIE -pie"
export CFLAGS="$RPM_OPT_FLAGS -fstack-protector-all -DLDAP_DEPRECATED=1"
# --enable-debug to avoid stripping binaries
%configure --with-docdir=%{_datadir}/%{name}/www --enable-debug \
--enable-lspp \
--with-exe-file-perm=0755 \
--with-cupsd-file-perm=0755 \
--with-log-file-perm=0600 \
--enable-relro \
--with-dbusdir=%{_sysconfdir}/dbus-1 \
--enable-avahi \
--enable-threads \
--enable-gnutls \
--enable-webif \
--with-xinetd=no \
--with-access-log-level=actions \
--enable-page-logging \
--with-rundir=%{_rundir}/cups \
--enable-sync-on-close \
localedir=%{_datadir}/locale
%files devel
%{_bindir}/cups-config
%{_includedir}/cups
%{_libdir}/*.so
%{_rpmconfigdir}/macros.d/macros.cups
%{_prefix}/lib/pkgconfig/cups.pc
尝试在system-config-printer
spec
的requires
中添加 pkgconf-pkg-config
,再次构建,仍出现和原来相同的no cups pkgconfig file
错误
检查openEuler
pkgconf
包
Name: pkgconf
Version: 1.9.5
Release: 1
Summary: Package compiler and linker metadata toolkit
检查fedora
pkgconf
包
Name: pkgconf
Version: 2.1.0
Release: 1%{?dist}
Summary: Package compiler and linker metadata toolkit
发现pkgconf
包也可能需要更新
system-config-printer
依赖的 cups-devel
缺少pkgconf-pkg-config
依赖
cups
包 spec
文件中%configure
中未设置--with-pkgconfpath
cups
打包列表中%dir
设置也存在差异
pkgconf
软件包可能需要更新
已经确定问题所在了,autoconf宏检测不到定位cups server bin
的pkg config
文件,通过--with-cups-serverbin-dir
手动指定cups server bin
只有在旧版本的cups
中可行,而openEuler 24:03
的cups
软件包已经升级到了最新版本。所以不解决cups
软件包的pkg config
文件生成的问题就无法修复system-config-printer
。生成cups
软件包的pkg config
文件又需要修改它的spec
以便在%configure
后添加参数,同时创建包含cups.pc
的pkg config
文件夹。
autoconf
生成的相关configure.ac
文件
AC_ARG_WITH([cups_serverbin_dir],
AS_HELP_STRING([--with-cups-serverbin-dir], [set CUPS SERVERBIN dir, default=value from pkg-config]), [
cupsserverbindir="$withval"
AC_MSG_RESULT([$withval])
], [
AS_IF([test "x$PKG_CONFIG" != x], [
AS_IF([$PKG_CONFIG --exists cups], [
cupsserverbindir=$($PKG_CONFIG --variable=cups_serverbin cups)
AC_MSG_RESULT([$cupsserverbindir])
], [
AC_MSG_ERROR([No CUPS pkgconfig file present and no CUPS SERVERBIN dir defined in configure options.])
])
], [
AC_MSG_ERROR([No pkg-config present and no CUPS SERVERBIN dir defined in configure options.])
])
])
手动指定cups server bin
的结果
[ 538s] configure: error: invalid variable name: `–-with-cups-serverbin-dir'
以下是system-config-printer
开发者在相关issue
下的回复
手动创建符合规范的cups.pc
文件后,system-config-printer
构建成功,这下百分百可以确定是cups软件包生成cups.pc
文件的原因
system-config-printer
构建结果:
软件包信息
软件包名称: system-config-printer
openEuler 仓库地址: src-openeuler/system-config-printer
构建仓库地址: https://build.tarsier-infra.isrc.ac.cn/package/show/openEuler:24.03:Epol/system-config-printer
说明
问题背景: 依据fedora的spec 修复 system-config-printer,略微调整最后的打包列表就行,并且升级到最新版本 https://src.fedoraproject.org/rpms/system-config-printer/blob/rawhide/f/system-config-printer.spec
所需技能:
其它: