Files
chromebrew/packages/cups.rb
chromebrew-actions[bot] 2106030610 update-cups — cups: 2.4.14 → 2.4.15 (#13686)
* Cups 2.4.14 => 2.4.15

* update-cups: Package File Update Run on linux/386 container.

* update-cups: Package File Update Run on linux/amd64 container.

* update-cups: Package File Update Run on linux/arm/v7 container.

---------

Co-authored-by: Ed Reel <edreel@gmail.com>
Co-authored-by: chromebrew-actions[bot] <chromebrew-actions[bot]@users.noreply.github.com>
2025-12-03 00:39:57 +00:00

110 lines
3.6 KiB
Ruby

require 'package'
class Cups < Package
description 'CUPS is the standards-based, open source printing system'
homepage 'https://openprinting.github.io/cups'
version '2.4.15'
compatibility 'all'
license 'Apache-2.0'
source_url 'https://github.com/OpenPrinting/cups.git'
git_hashtag "v#{version}"
binary_compression 'tar.zst'
binary_sha256({
aarch64: 'ce664b89e866f81a0723c638b5b25f4c643f958745e2169ae5030cae022c4b25',
armv7l: 'ce664b89e866f81a0723c638b5b25f4c643f958745e2169ae5030cae022c4b25',
i686: 'd14f33eba33fcfbb1a405b51134c3005e760711551106c10c50638ef034dcd81',
x86_64: '44bf3eb850a65da19208d1929ff69703f7a1935c412625e3b143cd33257f7faa'
})
depends_on 'acl' # R
depends_on 'gcc_lib' # R
depends_on 'glibc' # R
depends_on 'libusb' # R
depends_on 'libxcrypt' # R
depends_on 'linux_pam' # R
depends_on 'llvm_dev' => :build if %w[armv7l aarch64].include?(ARCH)
depends_on 'openssl' # R
depends_on 'psmisc' # L
depends_on 'zlib' # R
no_env_options
no_fhs
def self.build
@buildoverride = %w[armv7l aarch64].include?(ARCH) ? 'CC=clang CXX=clang++ LD=mold CUPS_LINKER=mold' : ''
system "#{@buildoverride} ./configure #{CREW_CONFIGURE_OPTIONS} \
--enable-libusb"
system 'make'
File.write 'startcupsd', <<~EOF
#!/bin/bash
CUPSD=#{CREW_PREFIX}/sbin/cupsd
CUPS=$(pidof "$CUPSD" 2> /dev/null)
if [ -z "$CUPS" ]; then
$CUPSD
sleep 3
fi
CUPS=$(pidof "$CUPSD" 2> /dev/null)
if [ -n "$CUPS" ]; then
echo "cupsd process $CUPS is running"
else
echo "cupsd failed to start"
exit 1
fi
EOF
File.write 'stopcupsd', <<~EOF
#!/bin/bash
CUPSD=#{CREW_PREFIX}/sbin/cupsd
CUPS=$(pidof "$CUPSD" 2> /dev/null)
if [ -n "$CUPS" ]; then
killall "$CUPSD"
sleep 3
fi
CUPS=$(pidof "$CUPSD" 2> /dev/null)
if [ -z "$CUPS" ]; then
echo "cupsd process stopped"
else
echo "cupsd process $CUPS is running"
exit 1
fi
EOF
end
def self.install
system 'make',
"DESTDIR=#{CREW_DEST_DIR}",
"DATADIR=#{CREW_DEST_PREFIX}/share/cups",
"DOCDIR=#{CREW_DEST_PREFIX}/share/doc/cups",
"MANDIR=#{CREW_DEST_MAN_PREFIX}",
"ICONDIR=#{CREW_PREFIX}/share/icons",
"MENUDIR=#{CREW_PREFIX}/share/applications",
"INITDIR=#{CREW_PREFIX}/etc/init.d",
"SERVERROOT=#{CREW_DEST_PREFIX}/etc/cups",
"SERVERBIN=#{CREW_DEST_PREFIX}/libexec/cups",
"CACHEDIR=#{CREW_DEST_PREFIX}/var/cache/cups",
"LOCALEDIR=#{CREW_DEST_PREFIX}/share/locale",
'install'
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
FileUtils.install 'startcupsd', "#{CREW_DEST_PREFIX}/bin/startcupsd", mode: 0o755
FileUtils.install 'stopcupsd', "#{CREW_DEST_PREFIX}/bin/stopcupsd", mode: 0o755
if File.exist?("#{CREW_DEST_DIR}/etc/dbus-1/system.d/cups.conf")
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/dbus-1/system.d"
FileUtils.mv "#{CREW_DEST_DIR}/etc/dbus-1/system.d/cups.conf", "#{CREW_DEST_PREFIX}/share/dbus-1/system.d/"
end
return unless File.exist?("#{CREW_DEST_DIR}/etc/pam.d/cups")
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/etc/pam.d"
FileUtils.mv "#{CREW_DEST_DIR}/etc/pam.d/cups", "#{CREW_DEST_PREFIX}/etc/pam.d/"
end
def self.postinstall
ExitMessage.add <<~EOM
To start the cups daemon, run 'startcupsd'
To stop the cups daemon, run 'stopcupsd'
For more information, see https://www.cups.org/doc/admin.html.
EOM
end
end