Merge pull request 'feat: add package cups' (#61) from sisungo/ports:cups into main
Reviewed-on: #61
This commit is contained in:
commit
9a4c9b6701
2 files changed
+126
No files matched your search
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "${ACTION}" = "remove" ] && exit 0
|
||||
|
||||
mkdir -p /var/lib/cups
|
||||
|
||||
create_group() {
|
||||
account create-group \
|
||||
--fullname "Printer Services" \
|
||||
--description "Common group for all printer-related services." \
|
||||
--host-gid 631 \
|
||||
_lp
|
||||
}
|
||||
|
||||
create_user() {
|
||||
account create-user -d /var/lib/cups -H \
|
||||
--fullname "CUPS Service" \
|
||||
--description "User for running the system CUPS service." \
|
||||
--host-uid 631 \
|
||||
--no-login \
|
||||
--groups _lp \
|
||||
_cups
|
||||
}
|
||||
|
||||
account info _lp > /dev/null 2>&1 || create_group
|
||||
account info _cups > /dev/null 2>&1 || create_user
|
||||
@@ -0,0 +1,100 @@
|
||||
import os
|
||||
|
||||
from lib.make import *
|
||||
from lib import cpp, arch
|
||||
|
||||
|
||||
version("2.4.19")
|
||||
description("The current standards-based, open source printing system developed by OpenPrinting for Linux® and other Unix®-like operating systems.")
|
||||
maintainer("sisungo <[email protected]>")
|
||||
source_url("https://github.com/OpenPrinting/cups/releases/download/v2.4.19/cups-2.4.19-source.tar.gz")
|
||||
|
||||
builddep("shortcut/c++")
|
||||
builddep("shortcut/autotools")
|
||||
builddep("aws-lc-dev @target")
|
||||
builddep("libdbus-dev @target")
|
||||
builddep("linux-pam-dev @target")
|
||||
builddep("libusb-dev @target")
|
||||
builddep("pkgconf @target")
|
||||
builddep("linux-dev @target")
|
||||
|
||||
|
||||
def build():
|
||||
cpp.configure([
|
||||
"--prefix=/",
|
||||
f"--includedir={get_prefix('cups-dev')}/include",
|
||||
f"--bindir={get_prefix('cups')}/bin",
|
||||
f"--sbindir={get_prefix('cups')}/bin",
|
||||
f"--datadir={get_prefix('cups')}/share",
|
||||
f"--libdir={get_prefix('cups')}/lib",
|
||||
"--sysconfdir=/var/config",
|
||||
"--enable-libusb",
|
||||
"--with-cups-user=_cups",
|
||||
"--with-cups-group=_lp",
|
||||
"--with-system-groups=wheel",
|
||||
])
|
||||
cpp.make()
|
||||
cpp.make_install([f"BUILDROOT={os.getcwd()}/../cpp_install"])
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def fix_libdir():
|
||||
with open("lib/pkgconfig/cups.pc") as fd:
|
||||
content = fd.read()
|
||||
content = content.replace(f"libdir={get_prefix('cups')}/lib", f"libdir={get_prefix('libcups')}/lib")
|
||||
os.remove("lib/pkgconfig/cups.pc")
|
||||
with open("lib/pkgconfig/cups.pc", "wt+") as fd:
|
||||
fd.write(content)
|
||||
|
||||
def pack_libcups(composer):
|
||||
composer.makedir("lib")
|
||||
composer.add("lib/libcups.so.2")
|
||||
composer.add("lib/libcups.so")
|
||||
|
||||
def pack_libcupsimage(composer):
|
||||
composer.makedir("lib")
|
||||
composer.add("lib/libcupsimage.so.2")
|
||||
composer.add("lib/libcupsimage.so")
|
||||
|
||||
def pack_dev(composer):
|
||||
fix_libdir()
|
||||
composer.makedir("lib")
|
||||
composer.add("lib/pkgconfig")
|
||||
composer.add("include")
|
||||
|
||||
def pack_cups(composer):
|
||||
composer.add("bin")
|
||||
composer.makedir("lib")
|
||||
composer.add("lib/cups")
|
||||
composer.makedir("share")
|
||||
composer.add("share/cups")
|
||||
composer.add("var/config", "share/config")
|
||||
|
||||
def pack_docs(composer):
|
||||
composer.makedir("share")
|
||||
composer.add("share/man")
|
||||
|
||||
package("libcups")
|
||||
dep("libssl @same-arch")
|
||||
dep("libcrypto @same-arch")
|
||||
dep("semi-libc @same-arch")
|
||||
on_pack(pack_libcups)
|
||||
|
||||
package("libcupsimage")
|
||||
dep("libcups (same)")
|
||||
on_pack(pack_libcupsimage)
|
||||
|
||||
package("cups-dev")
|
||||
dep("libcups (same)")
|
||||
dep("libcupsimage (same)")
|
||||
dep("aws-lc-dev @same-arch")
|
||||
on_pack(pack_dev)
|
||||
|
||||
package("cups")
|
||||
dep("libcups (same)")
|
||||
dep("libcupsimage (same)")
|
||||
on_pack(pack_cups)
|
||||
|
||||
package("cups-docs")
|
||||
on_pack(pack_docs)
|
||||
Reference in new issue
Block a user