4 Star 0 Fork 3

OpenCloudOS Stream/cups

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cups.spec 16.42 KB
一键复制 编辑 原始数据 按行查看 历史
ocs-bot 提交于 2024-08-16 15:42 . Rebuilt for loongarch release
%global cups_serverbin %{_exec_prefix}/lib/cups
Summary: CUPS printing system
Name: cups
Version: 2.4.6
Release: 5%{?dist}
License: ASL 2.0
Url: https://openprinting.github.io/cups/
Source0: https://github.com/OpenPrinting/cups/releases/download/v%{version}/cups-%{version}-source.tar.gz
Source1: cupsprinter.png
Source2: macros.cups
Patch0001: 0001-Fix-delays-printing-to-lpd-when-reserved-ports-are-e.patch
Patch0002: 0001-Use-purge-job-instead-of-purge-jobs-when-canceling-a.patch
Patch0003: backport-CVE-2023-4504.patch
# fix CVE-2024-35235,
# https://github.com/OpenPrinting/cups/commit/a436956f374b0fd7f5da9df482e4f5840fa1c0d2
Patch0004: 0004-Fix-domain-socket-handling.patch
Patch3001: cups-system-auth.patch
Patch3002: cups-multilib.patch
Patch3003: cups-banners.patch
Patch3004: cups-no-export-ssllibs.patch
Patch3005: cups-direct-usb.patch
Patch3006: cups-driverd-timeout.patch
Patch3007: cups-usb-paperout.patch
Patch3008: cups-uri-compat.patch
Patch3009: cups-freebind.patch
Patch3010: cups-ipp-multifile.patch
Patch3011: cups-web-devices-timeout.patch
Patch3012: cups-failover-backend.patch
Patch3013: cups-dymo-deviceid.patch
Patch3014: cups-lspp.patch
BuildRequires: make gcc gcc-c++ automake
BuildRequires: krb5-devel libacl-devel
BuildRequires: openldap-devel pam-devel
BuildRequires: pkgconf-pkg-config pkgconfig(avahi-client) pkgconfig(dbus-1)
BuildRequires: pkgconfig(gnutls) pkgconfig(libsystemd) pkgconfig(libusb-1.0)
BuildRequires: python3-cups
BuildRequires: systemd systemd-rpm-macros
BuildRequires: zlib-devel
BuildRequires: libselinux-devel audit-libs-devel
Recommends: nss-mdns
Recommends: avahi
Requires: acl
Requires: %{name}-client = %{version}-%{release}
Requires: %{name}-filesystem = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Requires: cups-filters dbus systemd
Requires(pre): systemd
Requires(post): systemd
Requires(post): grep, sed
Requires(preun): systemd
Requires(postun): systemd
%package client
Summary: CUPS printing system - client programs
License: GPLv2
Requires: %{name}-libs = %{version}-%{release}
Provides: /usr/bin/lpq /usr/bin/lpr /usr/bin/lp /usr/bin/cancel /usr/bin/lprm /usr/bin/lpstat
Requires: /usr/sbin/alternatives
Provides: lpr
%package devel
Summary: CUPS printing system - development environment
License: LGPLv2
Requires: %{name}-libs = %{version}-%{release}
Requires: gnutls-devel
Requires: krb5-devel
Requires: zlib-devel
%package libs
Summary: CUPS printing system - libraries
License: LGPLv2 and zlib
%package filesystem
Summary: CUPS printing system - directory layout
BuildArch: noarch
%package lpd
Summary: CUPS printing system - lpd emulation
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Provides: lpd
%package ipptool
Summary: CUPS printing system - tool for performing IPP requests
Requires: %{name}-libs = %{version}-%{release}
Requires: avahi
Recommends: nss-mdns
%package printerapp
Summary: CUPS printing system - tools for printer application
Requires: %{name}-libs = %{version}-%{release}
Requires: avahi
Recommends: nss-mdns
%description
This package provides the System V and Berkeley command-line interfaces. It provides
a portable printing layer for UNIX® operating systems. In order to promote a standard
printing solution for UNIX users, Apple Inc. develops CUPS printing system.
%description client
This package provides the System V and Berkeley command-line interfaces.
It provides a portable printing layer for UNIX® operating systems.
%description devel
This package is used for creating additional printer drivers, and other CUPS services.
%description libs
This package provides libraries used by applications to use CUPS natively, without
needing the lp/lpr commands.
%description filesystem
This package provides some directories required by other packages that add CUPS
drivers (i.e. filters, backends etc.).
%description lpd
This package provides standard lpd emulation.
%description ipptool
Sends IPP requests to the specified URI and tests and/or displays the results.
%description printerapp
This package provides IPP everywhere printer application ippeveprinter and tools for
printing PostScript and HP PCL document formats - ippevepcl and ippeveps. It enables
older printers for IPP everywhere standard - so if older printer is installed with a
printer application, its print queue acts as IPP everywhere printer to CUPS daemon.
This solution will substitute printer drivers and raw queues in the future.
%prep
%autosetup -p1
sed -i -e 's|^ErrorLog .*$|ErrorLog syslog|' conf/cups-files.conf.in
sed -i -e 's|^AccessLog .*$|AccessLog syslog|' conf/cups-files.conf.in
sed -i -e 's|^PageLog .*|PageLog syslog|' conf/cups-files.conf.in
perl -pi -e "s,^.SILENT:,," Makedefs.in
%build
aclocal -I config-scripts
autoconf -f -I config-scripts
export DSOFLAGS="$DSOFLAGS $RPM_LD_FLAGS"
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -DLDAP_DEPRECATED=1"
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS -DLDAP_DEPRECATED=1"
export LDFLAGS="$LDFLAGS $RPM_LD_FLAGS -Wall -fstack-clash-protection -D_FORTIFY_SOURCE=2"
%configure --with-docdir=%{_datadir}/%{name}/www \
--enable-debug \
--enable-gssapi \
--enable-lspp \
--enable-page-logging \
--enable-relro \
--enable-sync-on-close \
--enable-webif \
--with-access-log-level=actions \
--with-cupsd-file-perm=0755 \
--with-dbusdir=%{_sysconfdir}/dbus-1 \
--with-dnssd=avahi \
--with-log-file-perm=0600 \
--with-ondemand=systemd \
--with-pkgconfpath=%{_libdir}/pkgconfig \
--with-rundir=%{_rundir}/cups \
--with-tls=gnutls \
--with-xinetd=no \
--without-idle-exit-timeout \
--without-systemd-timeoutstartsec \
--localedir=%{_datadir}/locale
%make_build
%install
make install DESTDIR=%{buildroot}
rm -rf %{buildroot}%{_initddir} \
%{buildroot}%{_sysconfdir}/init.d \
%{buildroot}%{_sysconfdir}/rc?.d
mkdir -p %{buildroot}%{_unitdir}
find %{buildroot}%{_datadir}/cups/model -name "*.ppd" |xargs gzip -n9f
pushd %{buildroot}%{_datadir}/%{name}/ipptool
for file in color.jpg document-a4.pdf document-a4.ps document-letter.pdf document-letter.ps gray.jpg onepage-a4.pdf onepage-a4.ps onepage-letter.pdf onepage-letter.ps testfile.jpg testfile.pcl testfile.pdf testfile.ps testfile.txt
do
mv $file{,.gz}
done
popd
pushd %{buildroot}%{_bindir}
for i in cancel lp lpq lpr lprm lpstat; do
mv $i $i.cups
done
cd %{buildroot}%{_sbindir}
mv lpc lpc.cups
cd %{buildroot}%{_mandir}/man1
for i in cancel lp lpq lpr lprm lpstat; do
mv $i.1 $i-cups.1
done
cd %{buildroot}%{_mandir}/man8
mv lpc.8 lpc-cups.8
popd
mkdir -p %{buildroot}%{_datadir}/pixmaps %{buildroot}%{_sysconfdir}/X11/sysconfig %{buildroot}%{_sysconfdir}/X11/applnk/System
install -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d
install -m 0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/macros.d
touch %{buildroot}%{_sysconfdir}/cups/printers.conf
touch %{buildroot}%{_sysconfdir}/cups/classes.conf
touch %{buildroot}%{_sysconfdir}/cups/client.conf
touch %{buildroot}%{_sysconfdir}/cups/subscriptions.conf
touch %{buildroot}%{_sysconfdir}/cups/lpoptions
cat > %{buildroot}%{_sysconfdir}/cups/client.conf <<EOF
# MD5 Digest authentication is turned off by default
# because MD5 is marked as insecure for authentication.
#
# If you need MD5 Digest authentication and you are aware of
# potential security risk, turn MD5 Digest authentication on
# by changing the directive value to 'None'.
DigestOptions DenyMD5
EOF
mkdir -p %{buildroot}%{_datadir}/ppd
rm -rf %{buildroot}%{_mandir}/cat? %{buildroot}%{_mandir}/*/cat?
rm -f %{buildroot}%{_datadir}/applications/cups.desktop
rm -rf %{buildroot}%{_datadir}/icons
# pdf-banners shipped with cups-filters (#919489)
rm -rf %{buildroot}%{_datadir}/cups/banners
rm -f %{buildroot}%{_datadir}/cups/data/testprint
# modify /usr/lib/tmpfiles.d/cups.conf (bug #656566, bug #893834)
mkdir -p %{buildroot}%{_tmpfilesdir}
cat > %{buildroot}%{_tmpfilesdir}/cups.conf <<EOF
# See tmpfiles.d(5) for details
d %{_rundir}/cups 0755 root lp -
d %{_rundir}/cups/certs 0511 lp sys -
d /var/spool/cups/tmp - - - 30d
EOF
# modify /usr/lib/tmpfiles.d/cups-lp.conf (bug #812641)
cat > %{buildroot}%{_tmpfilesdir}/cups-lp.conf <<EOF
# Legacy parallel port character device nodes, to trigger the
# auto-loading of the kernel module on access.
#
# See tmpfiles.d(5) for details
c /dev/lp0 0660 root lp - 6:0
c /dev/lp1 0660 root lp - 6:1
c /dev/lp2 0660 root lp - 6:2
c /dev/lp3 0660 root lp - 6:3
EOF
find %{buildroot} -type f -o -type l | sed '
s:.*\('%{_datadir}'/\)\([^/_]\+\)\(.*\.po$\):%lang(\2) \1\2\3:
/^%lang(C)/d
/^\([^%].*\)/d
' > %{name}.lang
%post
%systemd_post %{name}.path %{name}.socket %{name}.service
grep '^\s*DigestOptions' %{_sysconfdir}/cups/client.conf &> /dev/null || echo 'DigestOptions DenyMD5' \
>> %{_sysconfdir}/cups/client.conf
%post client
/usr/sbin/alternatives --install %{_bindir}/lpr print %{_bindir}/lpr.cups 40 \
--slave %{_bindir}/lp print-lp %{_bindir}/lp.cups \
--slave %{_bindir}/lpq print-lpq %{_bindir}/lpq.cups \
--slave %{_bindir}/lprm print-lprm %{_bindir}/lprm.cups \
--slave %{_bindir}/lpstat print-lpstat %{_bindir}/lpstat.cups \
--slave %{_bindir}/cancel print-cancel %{_bindir}/cancel.cups \
--slave %{_sbindir}/lpc print-lpc %{_sbindir}/lpc.cups \
--slave %{_mandir}/man1/cancel.1.gz print-cancelman %{_mandir}/man1/cancel-cups.1.gz \
--slave %{_mandir}/man1/lp.1.gz print-lpman %{_mandir}/man1/lp-cups.1.gz \
--slave %{_mandir}/man8/lpc.8.gz print-lpcman %{_mandir}/man8/lpc-cups.8.gz \
--slave %{_mandir}/man1/lpq.1.gz print-lpqman %{_mandir}/man1/lpq-cups.1.gz \
--slave %{_mandir}/man1/lpr.1.gz print-lprman %{_mandir}/man1/lpr-cups.1.gz \
--slave %{_mandir}/man1/lprm.1.gz print-lprmman %{_mandir}/man1/lprm-cups.1.gz \
--slave %{_mandir}/man1/lpstat.1.gz print-lpstatman %{_mandir}/man1/lpstat-cups.1.gz || :
%post lpd
%systemd_post cups-lpd.socket
%preun
%systemd_preun %{name}.path %{name}.socket %{name}.service
%preun client
if [ $1 -eq 0 ] ; then
/usr/sbin/alternatives --remove print %{_bindir}/lpr.cups || :
fi
%preun lpd
%systemd_preun cups-lpd.socket
%postun
%systemd_postun_with_restart %{name}.path %{name}.socket %{name}.service
%postun lpd
%systemd_postun_with_restart cups-lpd.socket
%triggerin -- samba-client
ln -sf %{_libexecdir}/samba/cups_backend_smb %{cups_serverbin}/backend/smb || :
%triggerun -- samba-client
[ $2 = 0 ] || exit 0
rm -f %{cups_serverbin}/backend/smb
%files -f %{name}.lang
%doc README.md CREDITS.md CHANGES.md
%dir %attr(0755,root,lp) %{_sysconfdir}/cups
%attr(0640,root,lp) %{_sysconfdir}/cups/cupsd.conf.default
%verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/cupsd.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/cups-files.conf
%attr(0640,root,lp) %{_sysconfdir}/cups/cups-files.conf.default
%verify(not md5 size mtime) %config(noreplace) %attr(0644,root,lp) %{_sysconfdir}/cups/client.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0600,root,lp) %{_sysconfdir}/cups/classes.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0600,root,lp) %{_sysconfdir}/cups/printers.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0644,root,lp) %{_sysconfdir}/cups/snmp.conf
%attr(0640,root,lp) %{_sysconfdir}/cups/snmp.conf.default
%verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/subscriptions.conf
%verify(not md5 size mtime) %config(noreplace) %attr(0644,root,lp) %{_sysconfdir}/cups/lpoptions
%dir %attr(0755,root,lp) %{_sysconfdir}/cups/ppd
%dir %attr(0700,root,lp) %{_sysconfdir}/cups/ssl
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/cups.conf
%config(noreplace) %{_sysconfdir}/pam.d/cups
%{_tmpfilesdir}/cups.conf
%{_tmpfilesdir}/cups-lp.conf
%attr(0644, root, root)%{_unitdir}/%{name}.service
%attr(0644, root, root)%{_unitdir}/%{name}.socket
%attr(0644, root, root)%{_unitdir}/%{name}.path
%{_bindir}/cupstestppd
%{_bindir}/ppd*
%{_sbindir}/*
%exclude %{_sbindir}/lpc.cups
%dir %{cups_serverbin}/daemon
%{cups_serverbin}/daemon/cups-deviced
%{cups_serverbin}/daemon/cups-driverd
%{cups_serverbin}/daemon/cups-exec
%{cups_serverbin}/backend/*
%{cups_serverbin}/cgi-bin
%{cups_serverbin}/filter/*
%{cups_serverbin}/monitor
%{cups_serverbin}/notifier
%{_datadir}/cups/drv/sample.drv
%{_datadir}/cups/examples
%{_datadir}/cups/mime/mime.types
%{_datadir}/cups/mime/mime.convs
%{_datadir}/cups/ppdc/*.defs
%{_datadir}/cups/ppdc/*.h
%dir %{_datadir}/cups/templates
%{_datadir}/cups/templates/*.tmpl
%dir %{_datadir}/cups/templates/da
%{_datadir}/cups/templates/da/*.tmpl
%dir %{_datadir}/cups/templates/de
%{_datadir}/cups/templates/de/*.tmpl
%dir %{_datadir}/cups/templates/es
%{_datadir}/cups/templates/es/*.tmpl
%dir %{_datadir}/cups/templates/fr
%{_datadir}/cups/templates/fr/*.tmpl
%dir %{_datadir}/cups/templates/ja
%{_datadir}/cups/templates/ja/*.tmpl
%dir %{_datadir}/cups/templates/pt_BR
%{_datadir}/cups/templates/pt_BR/*.tmpl
%dir %{_datadir}/cups/templates/ru
%{_datadir}/cups/templates/ru/*.tmpl
%dir %{_datadir}/%{name}/usb
%{_datadir}/%{name}/usb/org.cups.usb-quirks
%dir %{_datadir}/%{name}/www
%{_datadir}/%{name}/www/images
%{_datadir}/%{name}/www/*.css
%{_datadir}/%{name}/www/index.html
%{_datadir}/%{name}/www/help
%{_datadir}/%{name}/www/robots.txt
%{_datadir}/%{name}/www/da/index.html
%{_datadir}/%{name}/www/de/index.html
%{_datadir}/%{name}/www/es/index.html
%{_datadir}/%{name}/www/fr/index.html
%{_datadir}/%{name}/www/ja/index.html
%{_datadir}/%{name}/www/ru/index.html
%{_datadir}/%{name}/www/pt_BR/index.html
%{_datadir}/%{name}/www/apple-touch-icon.png
%dir %{_datadir}/%{name}/www/da
%dir %{_datadir}/%{name}/www/de
%dir %{_datadir}/%{name}/www/es
%dir %{_datadir}/%{name}/www/fr
%dir %{_datadir}/%{name}/www/ja
%dir %{_datadir}/%{name}/www/pt_BR
%dir %{_datadir}/%{name}/www/ru
%{_datadir}/pixmaps/cupsprinter.png
%dir %attr(1770,root,lp) %{_localstatedir}/spool/cups/tmp
%dir %attr(0710,root,lp) %{_localstatedir}/spool/cups
%dir %attr(0755,root,lp) %{_localstatedir}/log/cups
%dir %attr(0755,root,lp) %{_rundir}/cups
%dir %attr(0511,lp,sys) %{_rundir}/cups/certs
%{_mandir}/man[1578]/*
%exclude %{_mandir}/man1/lp*.1.gz
%exclude %{_mandir}/man1/cancel-cups.1.gz
%exclude %{_mandir}/man8/lpc-cups.8.gz
%exclude %{_mandir}/man1/cups-config.1.gz
%exclude %{_mandir}/man1/ipptool.1.gz
%exclude %{_mandir}/man5/ipptoolfile.5.gz
%exclude %{_mandir}/man8/cups-lpd.8.gz
%exclude %{_mandir}/man1/ippeveprinter.1.gz
%exclude %{_mandir}/man7/ippevepcl.7.gz
%exclude %{_mandir}/man7/ippeveps.7.gz
%files client
%{_bindir}/cancel*
%{_bindir}/lp*
%{_sbindir}/lpc.cups
%{_mandir}/man1/cancel-cups.1.gz
%{_mandir}/man1/lp*.1.gz
%{_mandir}/man8/lpc-cups.8.gz
%files libs
%{license} LICENSE NOTICE
%{_libdir}/libcups.so.2
%{_libdir}/libcupsimage.so.2
%files filesystem
%dir %{cups_serverbin}
%dir %{cups_serverbin}/backend
%dir %{cups_serverbin}/driver
%dir %{cups_serverbin}/filter
%dir %{_datadir}/cups
%dir %{_datadir}/cups/data
%dir %{_datadir}/cups/drv
%dir %{_datadir}/cups/mime
%dir %{_datadir}/cups/model
%dir %{_datadir}/cups/ppdc
%dir %{_datadir}/ppd
%files devel
%{_bindir}/cups-config
%{_includedir}/cups
%{_libdir}/*.so
%{_libdir}/pkgconfig/cups.pc
%{_rpmconfigdir}/macros.d/macros.cups
%{_mandir}/man1/cups-config.1.gz
%files lpd
%{cups_serverbin}/daemon/cups-lpd
%attr(0644, root, root)%{_unitdir}/cups-lpd.socket
%attr(0644, root, root)%{_unitdir}/cups-lpd@.service
%{_mandir}/man8/cups-lpd.8.gz
%files ipptool
%{_bindir}/ippfind
%{_bindir}/ipptool
%dir %{_datadir}/cups/ipptool
%{_datadir}/cups/ipptool/*
%{_mandir}/man1/ipptool.1.gz
%{_mandir}/man5/ipptoolfile.5.gz
%files printerapp
%{_bindir}/ippeveprinter
%dir %{cups_serverbin}/command
%{cups_serverbin}/command/ippevepcl
%{cups_serverbin}/command/ippeveps
%{_mandir}/man1/ippeveprinter.1.gz
%{_mandir}/man7/ippevepcl.7.gz
%{_mandir}/man7/ippeveps.7.gz
%changelog
* Fri Aug 16 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 2.4.6-5
- Rebuilt for loongarch release
* Tue Jun 18 2024 Yi Lin <nilusyi@tencent.com> - 2.4.6-4
- backport patch to fix CVE-2024-435235
* Wed Oct 18 2023 Shuo Wang <abushwang@tencent.com> - 2.4.6-3
- backport patch to fix CVE-2023-4504
* Fri Sep 08 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 2.4.6-2
- Rebuilt for OpenCloudOS Stream 23.09
* Tue Aug 1 2023 Shuo Wang <abushwang@tencent.com> - 2.4.6-1
- update to 2.4.6
* Fri Apr 28 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 2.4.2-3
- Rebuilt for OpenCloudOS Stream 23.05
* Fri Mar 31 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 2.4.2-2
- Rebuilt for OpenCloudOS Stream 23
* Fri Oct 14 2022 Wang Guodong <gordonwwang@tencent.com> - 2.4.2-1
- package init.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/opencloudos-stream/cups.git
git@gitee.com:opencloudos-stream/cups.git
opencloudos-stream
cups
cups
master

搜索帮助