mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 10:07:15 +08:00
continue merge of testing and systemd platform
This commit is contained in:
parent
9f294331d6
commit
f0e147ae1f
196
cups/PKGBUILD
196
cups/PKGBUILD
@ -2,150 +2,174 @@
|
||||
#
|
||||
# maintainer abveritas@chakraproject.org
|
||||
|
||||
pkgbase=cups
|
||||
pkgbase="cups"
|
||||
pkgname=('libcups' 'cups')
|
||||
pkgver=1.5.3
|
||||
pkgver=1.6.1
|
||||
pkgrel=1
|
||||
arch=('i686' 'x86_64')
|
||||
license=('GPL')
|
||||
url="http://www.cups.org/"
|
||||
makedepends=('libtiff>=3.9.2-2' 'libpng>=1.4.0' 'acl' 'openslp' 'pam' 'xdg-utils' 'krb5' 'gnutls>=2.8.3' 'poppler>=0.12.3' 'xinetd' 'gzip' 'autoconf' 'php' 'libusb' 'dbus-core' 'avahi' 'hicolor-icon-theme' 'systemd')
|
||||
source=("ftp://ftp.easysw.com/pub/cups/${pkgver}/${pkgbase}-${pkgver}-source.tar.bz2"
|
||||
#cups-avahi-1-config.patch
|
||||
#cups-avahi-2-backend.patch
|
||||
#cups-avahi-3-timeouts.patch
|
||||
#cups-avahi-4-poll.patch
|
||||
#cups-avahi-5-services.patch
|
||||
makedepends=('libtiff' 'libpng' 'acl' 'pam' 'xdg-utils' 'krb5' 'gnutls>=2.8.3' 'cups-filters' 'bc'
|
||||
'xinetd' 'gzip' 'autoconf' 'libusb' 'dbus-core' 'avahi' 'hicolor-icon-theme' 'systemd')
|
||||
source=(ftp://ftp.easysw.com/pub/cups/${pkgver}/cups-${pkgver}-source.tar.bz2
|
||||
cups-no-export-ssllibs.patch
|
||||
cups-no-gcrypt.patch
|
||||
cups-no-gzip-man.patch
|
||||
cups-systemd-socket.patch
|
||||
cups cups.logrotate cups.pam
|
||||
cups-systemd-socket.patch)
|
||||
md5sums=('e1ad15257aa6f162414ea3beae0c5df8'
|
||||
#'fe3906f7733f8f63e05daf025d05abf3'
|
||||
#'80e2d7d6ffcf125f917dca795e161efd'
|
||||
#'eef9b879d9bdfb04c2042f57d07969b4'
|
||||
#'9f82b56a2119bfc2ee46a345f6229a2c'
|
||||
#'ca64df54a3a2dc53c28e6291e8d53d8f'
|
||||
cupsd-conf-remove-obsolete-browse-directives.patch
|
||||
avahi-missing-in-conditionals.patch
|
||||
recognize-remote-cups-queue-via-dnssd-uri.patch
|
||||
usb-backend-reset-after-job-only-for-specific-devices.patch)
|
||||
#options=('!emptydirs')
|
||||
md5sums=('87ade07e3d1efd03c9c3add949cf9c00'
|
||||
'9b8467a1e51d360096b70e2c3c081e6c'
|
||||
'3733c23e77eb503bd94cc368e02830dc'
|
||||
'd8fce4246d42186d9b190c1f07f5b911'
|
||||
'90c30380d4c8cd48a908cfdadae1ea24'
|
||||
'7d2347b6d444e223f6b7dc6e706b9ffe'
|
||||
'9657daa21760bb0b5fa3d8b51d5e01a1'
|
||||
'f861b18f4446c43918c8643dcbbd7f6d'
|
||||
'96f82c38f3f540b53f3e5144900acf17'
|
||||
'4d89eef028c012fbb89652bd719f342a')
|
||||
'6bef262b5081051e88cd2ae94fed1867'
|
||||
'9c91b1319f4b20dc323986cb4abbe806'
|
||||
'dcef8dd5614461166cada8a706eebb49'
|
||||
'0779ef8ba1d724ebb3b9bf360deba52b')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgbase}-${pkgver}"
|
||||
cd ${srcdir}/${pkgbase}-${pkgver}
|
||||
|
||||
# Avahi support in the dnssd backend. patches from upstream/FC RawHide
|
||||
#patch -Np1 -i ${srcdir}/cups-avahi-1-config.patch
|
||||
#patch -Np1 -i ${srcdir}/cups-avahi-2-backend.patch
|
||||
#patch -Np1 -i ${srcdir}/cups-avahi-3-timeouts.patch
|
||||
#patch -Np1 -i ${srcdir}/cups-avahi-4-poll.patch
|
||||
#patch -Np1 -i ${srcdir}/cups-avahi-5-services.patch
|
||||
|
||||
# add systemd socket support - Fedora patch
|
||||
# add systemd socket support - Fedora patch, also used in Gentoo
|
||||
# modified now to the changes done by Gentoo in their svn ebuild
|
||||
# http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-print/cups/files/cups-1.5.0-systemd-socket.patch?revision=1.1
|
||||
patch -p1 -i ${srcdir}/cups-systemd-socket.patch
|
||||
|
||||
|
||||
# Do not export SSL libs in cups-config
|
||||
patch -p1 -i "${srcdir}/cups-no-export-ssllibs.patch"
|
||||
|
||||
patch -p1 -i "${srcdir}/cups-no-gcrypt.patch"
|
||||
# don't zip man pages in make install, let makepkg do that / Fedora
|
||||
patch -p1 -i ${srcdir}/cups-no-gzip-man.patch
|
||||
|
||||
# upstream bugtracker patches
|
||||
# http://www.cups.org/str.php?L4157 - fix broken default server config
|
||||
patch -p1 -i ${srcdir}/cupsd-conf-remove-obsolete-browse-directives.patch
|
||||
# http://www.cups.org/str.php?L4156 - In many DNS-SD/Bonjour conditionals Avahi is not considered
|
||||
patch -p1 -i ${srcdir}/avahi-missing-in-conditionals.patch
|
||||
# http://www.cups.org/str.php?L4158 - DNS-SD-based print queues pointing to CUPS server are not considered remote printers with driver on server
|
||||
patch -p1 -i ${srcdir}/recognize-remote-cups-queue-via-dnssd-uri.patch
|
||||
# http://cups.org/str.php?L4155 / https://bugs.archlinux.org/task/30965
|
||||
patch -p0 -i ${srcdir}/usb-backend-reset-after-job-only-for-specific-devices.patch
|
||||
|
||||
# Rebuild configure script for --enable-avahi.
|
||||
# Rebuild configure script for not zipping man-pages.
|
||||
aclocal -I config-scripts
|
||||
autoconf -I config-scripts
|
||||
|
||||
./configure --prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var \
|
||||
--with-systemdsystemunitdir=/usr/lib/systemd/system \
|
||||
--libdir=/usr/lib \
|
||||
--with-logdir=/var/log/cups \
|
||||
--with-docdir=/usr/share/cups/doc \
|
||||
--with-cups-user=daemon \
|
||||
--with-cups-group=lp \
|
||||
--enable-pam=yes \
|
||||
--disable-ldap \
|
||||
--enable-raw-printing \
|
||||
--enable-dbus \
|
||||
--with-dbusdir=/etc/dbus-1 \
|
||||
--enable-ssl=yes \
|
||||
--enable-gnutls \
|
||||
--enable-threads \
|
||||
--disable-avahi \
|
||||
--with-php=/usr/bin/php-cgi \
|
||||
--with-pdftops=pdftops \
|
||||
--with-optim="${CFLAGS}"
|
||||
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
|
||||
--libdir=/usr/lib \
|
||||
--with-systemdsystemunitdir=/usr/lib/systemd/system \
|
||||
--with-logdir=/var/log/cups \
|
||||
--with-docdir=/usr/share/cups/doc \
|
||||
--with-cups-user=daemon \
|
||||
--with-cups-group=lp \
|
||||
--enable-pam=yes \
|
||||
--enable-raw-printing \
|
||||
--enable-dbus --with-dbusdir=/etc/dbus-1 \
|
||||
--enable-ssl=yes --enable-gnutls \
|
||||
--enable-threads \
|
||||
--disable-avahi\
|
||||
--with-php=/usr/bin/php-cgi \
|
||||
--with-optim="$CFLAGS"
|
||||
make
|
||||
}
|
||||
|
||||
make
|
||||
check() {
|
||||
cd "$srcdir/$pkgbase-$pkgver"
|
||||
#httpAddrGetList(workstation64): FAIL
|
||||
#1 TESTS FAILED!
|
||||
#make[1]: *** [testhttp] Error 1
|
||||
make -k check || /bin/true
|
||||
}
|
||||
|
||||
package_libcups() {
|
||||
pkgdesc="The CUPS Printing System - client libraries and headers."
|
||||
depends=('gnutls>=2.8.3' 'libtiff>=3.9.2-2' 'libpng>=1.4.0' 'krb5' 'avahi')
|
||||
pkgdesc="The CUPS Printing System - client libraries and headers"
|
||||
depends=('gnutls>=2.8.3' 'libtiff' 'libpng' 'krb5' 'avahi')
|
||||
backup=(etc/cups/client.conf)
|
||||
|
||||
cd "${srcdir}/${pkgbase}-${pkgver}"
|
||||
cd ${srcdir}/${pkgbase}-${pkgver}
|
||||
make BUILDROOT=${pkgdir} install-headers install-libs
|
||||
# put this into the libs pkg to make other software find the libs(no pkg-config file included)
|
||||
mkdir -p "${pkgdir}/usr/bin"
|
||||
install -m755 "${srcdir}/${pkgbase}-${pkgver}/cups-config" "${pkgdir}/usr/bin/cups-config"
|
||||
mkdir -p ${pkgdir}/usr/bin
|
||||
install -m755 ${srcdir}/${pkgbase}-${pkgver}/cups-config ${pkgdir}/usr/bin/cups-config
|
||||
|
||||
# install client.conf man page and config file
|
||||
install -dm755 ${pkgdir}/usr/share/man/man5
|
||||
#install -Dm644 ${srcdir}/${pkgbase}-${pkgver}/man/client.conf.5.gz ${pkgdir}/usr/share/man/man5/
|
||||
install -Dm644 ${srcdir}/${pkgbase}-${pkgver}/man/client.conf.5 ${pkgdir}/usr/share/man/man5/
|
||||
install -dm755 ${pkgdir}/etc/cups
|
||||
touch ${pkgdir}/etc/cups/client.conf
|
||||
echo "# see 'man client.conf'" >> ${pkgdir}/etc/cups/client.conf
|
||||
echo "ServerName /var/run/cups/cups.sock # alternative: ServerName hostname-or-ip-address[:port] of a remote server" >> ${pkgdir}/etc/cups/client.conf
|
||||
chgrp lp ${pkgdir}/etc/cups/client.conf
|
||||
}
|
||||
|
||||
package_cups() {
|
||||
pkgdesc="The CUPS Printing System - deamon package"
|
||||
pkgdesc="The CUPS Printing System - daemon package"
|
||||
install=cups.install
|
||||
backup=(etc/cups/cupsd.conf
|
||||
etc/cups/snmp.conf
|
||||
etc/cups/printers.conf
|
||||
etc/cups/classes.conf
|
||||
etc/cups/client.conf
|
||||
etc/cups/subscriptions.conf
|
||||
etc/dbus-1/system.d/cups.conf
|
||||
etc/logrotate.d/cups
|
||||
etc/pam.d/cups
|
||||
etc/xinetd.d/cups-lpd)
|
||||
depends=('acl' 'openslp' 'pam' "libcups>=${pkgver}" 'xdg-utils' 'poppler>=0.12.3' 'dbus-core' 'hicolor-icon-theme')
|
||||
optdepends=('php: for included phpcups.so module')
|
||||
depends=('acl' 'pam' "libcups>=${pkgver}" 'cups-filters' 'bc' 'libusb' 'dbus-core' 'systemd' 'hicolor-icon-theme')
|
||||
optdepends=('xdg-utils: xdg .desktop file support')
|
||||
|
||||
cd "${srcdir}/${pkgbase}-${pkgver}"
|
||||
make BUILDROOT="${pkgdir}" install-data install-exec
|
||||
cd ${srcdir}/${pkgbase}-${pkgver}
|
||||
make BUILDROOT=${pkgdir} install-data install-exec
|
||||
|
||||
# this one we ship in the libcups pkg
|
||||
rm -f "${pkgdir}/usr/bin/cups-config"
|
||||
rm -f ${pkgdir}/usr/bin/cups-config
|
||||
|
||||
# kill the sysv stuff
|
||||
rm -rf "${pkgdir}"/etc/rc*.d
|
||||
rm -rf "${pkgdir}"/etc/init.d
|
||||
install -D -m755 ../cups "${pkgdir}/etc/rc.d/cups"
|
||||
install -D -m644 ../cups.logrotate "${pkgdir}/etc/logrotate.d/cups"
|
||||
install -D -m644 ../cups.pam "${pkgdir}/etc/pam.d/cups"
|
||||
rm -rf ${pkgdir}/etc/rc*.d
|
||||
rm -rf ${pkgdir}/etc/init.d
|
||||
install -D -m755 ../cups ${pkgdir}/etc/rc.d/cupsd
|
||||
install -D -m644 ../cups.logrotate ${pkgdir}/etc/logrotate.d/cups
|
||||
install -D -m644 ../cups.pam ${pkgdir}/etc/pam.d/cups
|
||||
|
||||
# fix perms on /var/spool and /etc
|
||||
chmod 755 "${pkgdir}/var/spool"
|
||||
chmod 755 "${pkgdir}/etc"
|
||||
|
||||
# serial backend needs to run as root (http://bugs.archlinux.org/task/20396)
|
||||
chmod 700 "${pkgdir}/usr/lib/cups/backend/serial"
|
||||
chmod 755 ${pkgdir}/var/spool
|
||||
chmod 755 ${pkgdir}/etc
|
||||
|
||||
# install ssl directory where to store the certs, solves some samba issues
|
||||
install -dm700 -g lp "${pkgdir}/etc/cups/ssl"
|
||||
install -dm511 -g lp "${pkgdir}/var/run/cups/certs"
|
||||
install -dm700 -g lp ${pkgdir}/etc/cups/ssl
|
||||
# remove directory from package, we create it in cups rc.d file
|
||||
rm -rf ${pkgdir}/var/run
|
||||
|
||||
# install some more configuration files that will get filled by cupsd
|
||||
touch "${pkgdir}/etc/cups/printers.conf"
|
||||
touch "${pkgdir}/etc/cups/classes.conf"
|
||||
touch "${pkgdir}/etc/cups/client.conf"
|
||||
echo "# see 'man client.conf'" >> "${pkgdir}/etc/cups/client.conf"
|
||||
echo "ServerName /var/run/cups/cups.sock # alternative: ServerName hostname-or-ip-address[:port] of a remote server" >> "${pkgdir}/etc/cups/client.conf"
|
||||
touch "${pkgdir}/etc/cups/subscriptions.conf"
|
||||
chgrp lp "${pkgdir}"/etc/cups/{printers.conf,classes.conf,client.conf,subscriptions.conf}
|
||||
touch ${pkgdir}/etc/cups/printers.conf
|
||||
touch ${pkgdir}/etc/cups/classes.conf
|
||||
touch ${pkgdir}/etc/cups/subscriptions.conf
|
||||
chgrp lp ${pkgdir}/etc/cups/{printers.conf,classes.conf,subscriptions.conf}
|
||||
|
||||
# fix .desktop file
|
||||
sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' "${pkgdir}/usr/share/applications/cups.desktop"
|
||||
sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' ${pkgdir}/usr/share/applications/cups.desktop
|
||||
|
||||
# compress some driver files, adopted from Fedora
|
||||
find "${pkgdir}/usr/share/cups/model" -name "*.ppd" | xargs gzip -n9f
|
||||
}
|
||||
find ${pkgdir}/usr/share/cups/model -name "*.ppd" | xargs gzip -n9f
|
||||
|
||||
# remove client.conf man page
|
||||
rm -f ${pkgdir}/usr/share/man/man5/client.conf.5
|
||||
|
||||
# remove files now part of cups-filters
|
||||
rm -v ${pkgdir}/usr/share/cups/banners/*
|
||||
rm -v ${pkgdir}/usr/share/cups/data/testprint
|
||||
# comment out all conversion rules which use any of the removed filters
|
||||
perl -p -i -e 's:^(.*\s+bannertops\s*)$:#\1:' /usr/share/cups/mime/mime.convs
|
||||
|
||||
# vim:set ts=2 sw=2 et:
|
||||
# Provide native service
|
||||
ln -s cups.service "$pkgdir/usr/lib/systemd/system/cupsd.service"
|
||||
}
|
||||
|
118
cups/avahi-missing-in-conditionals.patch
Normal file
118
cups/avahi-missing-in-conditionals.patch
Normal file
@ -0,0 +1,118 @@
|
||||
diff -uraN cups/scheduler/client.c cups-new/scheduler/client.c
|
||||
--- cups/scheduler/client.c 2012-05-25 15:28:49.000000000 +0200
|
||||
+++ cups-new/scheduler/client.c 2012-08-04 20:13:17.082220961 +0200
|
||||
@@ -4021,7 +4021,7 @@
|
||||
!strncmp(host, "[::1]:", 6));
|
||||
}
|
||||
|
||||
-#ifdef HAVE_DNSSD
|
||||
+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
/*
|
||||
* Check if the hostname is something.local (Bonjour); if so, allow it.
|
||||
*/
|
||||
@@ -4040,7 +4040,7 @@
|
||||
!_cups_strcasecmp(end, ".local.") ||
|
||||
!_cups_strncasecmp(end, ".local.:", 8)))
|
||||
return (1);
|
||||
-#endif /* HAVE_DNSSD */
|
||||
+#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
|
||||
/*
|
||||
* Check if the hostname is an IP address...
|
||||
@@ -4101,7 +4101,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
-#ifdef HAVE_DNSSD
|
||||
+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
for (a = (cupsd_alias_t *)cupsArrayFirst(DNSSDAlias);
|
||||
a;
|
||||
a = (cupsd_alias_t *)cupsArrayNext(DNSSDAlias))
|
||||
@@ -4126,7 +4126,7 @@
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
-#endif /* HAVE_DNSSD */
|
||||
+#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
|
||||
/*
|
||||
* Check for interface hostname matches...
|
||||
diff -uraN cups/scheduler/conf.c cups-new/scheduler/conf.c
|
||||
--- cups/scheduler/conf.c 2012-05-25 15:28:49.000000000 +0200
|
||||
+++ cups-new/scheduler/conf.c 2012-08-04 20:15:49.830978405 +0200
|
||||
@@ -89,9 +89,9 @@
|
||||
{
|
||||
{ "AccessLog", &AccessLog, CUPSD_VARTYPE_STRING },
|
||||
{ "AutoPurgeJobs", &JobAutoPurge, CUPSD_VARTYPE_BOOLEAN },
|
||||
-#ifdef HAVE_DNSSD
|
||||
+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
{ "BrowseDNSSDSubTypes", &DNSSDSubTypes, CUPSD_VARTYPE_STRING },
|
||||
-#endif /* HAVE_DNSSD */
|
||||
+#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
{ "BrowseWebIF", &BrowseWebIF, CUPSD_VARTYPE_BOOLEAN },
|
||||
{ "Browsing", &Browsing, CUPSD_VARTYPE_BOOLEAN },
|
||||
{ "CacheDir", &CacheDir, CUPSD_VARTYPE_STRING },
|
||||
@@ -735,9 +735,9 @@
|
||||
Browsing = CUPS_DEFAULT_BROWSING;
|
||||
DefaultShared = CUPS_DEFAULT_DEFAULT_SHARED;
|
||||
|
||||
-#ifdef HAVE_DNSSD
|
||||
+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
cupsdSetString(&DNSSDSubTypes, "_cups,_print");
|
||||
-#endif /* HAVE_DNSSD */
|
||||
+#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
|
||||
cupsdSetString(&LPDConfigFile, CUPS_DEFAULT_LPD_CONFIG_FILE);
|
||||
cupsdSetString(&SMBConfigFile, CUPS_DEFAULT_SMB_CONFIG_FILE);
|
||||
diff -uraN cups/scheduler/ipp.c cups-new/scheduler/ipp.c
|
||||
--- cups/scheduler/ipp.c 2012-05-25 15:28:49.000000000 +0200
|
||||
+++ cups-new/scheduler/ipp.c 2012-08-04 20:13:17.086220978 +0200
|
||||
@@ -4813,7 +4813,7 @@
|
||||
ippAddDate(con->response, IPP_TAG_PRINTER, "printer-current-time",
|
||||
ippTimeToDate(curtime));
|
||||
|
||||
-#ifdef HAVE_DNSSD
|
||||
+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
if (!ra || cupsArrayFind(ra, "printer-dns-sd-name"))
|
||||
{
|
||||
if (printer->reg_name)
|
||||
@@ -4823,7 +4823,7 @@
|
||||
ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_NOVALUE,
|
||||
"printer-dns-sd-name", 0);
|
||||
}
|
||||
-#endif /* HAVE_DNSSD */
|
||||
+#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
|
||||
if (!ra || cupsArrayFind(ra, "printer-error-policy"))
|
||||
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME,
|
||||
diff -uraN cups/scheduler/main.c cups-new/scheduler/main.c
|
||||
--- cups/scheduler/main.c 2012-05-25 15:28:49.000000000 +0200
|
||||
+++ cups-new/scheduler/main.c 2012-08-04 20:13:17.090221001 +0200
|
||||
@@ -781,9 +781,9 @@
|
||||
* Got an error from select!
|
||||
*/
|
||||
|
||||
-#ifdef HAVE_DNSSD
|
||||
+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
cupsd_printer_t *p; /* Current printer */
|
||||
-#endif /* HAVE_DNSSD */
|
||||
+#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
|
||||
|
||||
if (errno == EINTR) /* Just interrupted by a signal */
|
||||
@@ -824,13 +824,13 @@
|
||||
job->print_pipes[0], job->print_pipes[1],
|
||||
job->back_pipes[0], job->back_pipes[1]);
|
||||
|
||||
-#ifdef HAVE_DNSSD
|
||||
+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
|
||||
p;
|
||||
p = (cupsd_printer_t *)cupsArrayNext(Printers))
|
||||
cupsdLogMessage(CUPSD_LOG_EMERG, "printer[%s] reg_name=\"%s\"", p->name,
|
||||
p->reg_name ? p->reg_name : "(null)");
|
||||
-#endif /* HAVE_DNSSD */
|
||||
+#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
|
||||
break;
|
||||
}
|
@ -2,9 +2,9 @@ diff -up cups-1.5b1/config-scripts/cups-manpages.m4.no-gzip-man cups-1.5b1/confi
|
||||
--- cups-1.5b1/config-scripts/cups-manpages.m4.no-gzip-man 2011-05-12 07:21:56.000000000 +0200
|
||||
+++ cups-1.5b1/config-scripts/cups-manpages.m4 2011-05-23 17:25:50.000000000 +0200
|
||||
@@ -69,10 +69,10 @@ case "$uname" in
|
||||
;;
|
||||
Linux* | GNU* | Darwin*)
|
||||
# Linux, GNU Hurd, and Mac OS X
|
||||
;;
|
||||
Linux* | GNU* | Darwin*)
|
||||
# Linux, GNU Hurd, and OS X
|
||||
- MAN1EXT=1.gz
|
||||
- MAN5EXT=5.gz
|
||||
- MAN7EXT=7.gz
|
||||
@ -13,6 +13,6 @@ diff -up cups-1.5b1/config-scripts/cups-manpages.m4.no-gzip-man cups-1.5b1/confi
|
||||
+ MAN5EXT=5
|
||||
+ MAN7EXT=7
|
||||
+ MAN8EXT=8
|
||||
MAN8DIR=8
|
||||
;;
|
||||
*)
|
||||
MAN8DIR=8
|
||||
;;
|
||||
*)
|
||||
|
@ -1,9 +1,9 @@
|
||||
diff -up cups-1.5.2/config.h.in.systemd-socket cups-1.5.2/config.h.in
|
||||
--- cups-1.5.2/config.h.in.systemd-socket 2012-03-16 14:50:57.089449755 +0000
|
||||
+++ cups-1.5.2/config.h.in 2012-03-16 14:50:57.146449787 +0000
|
||||
diff -up cups-1.5.0/config.h.in.systemd-socket cups-1.5.0/config.h.in
|
||||
--- cups-1.5.0/config.h.in.systemd-socket 2011-10-18 15:32:40.741672460 +0100
|
||||
+++ cups-1.5.0/config.h.in 2011-10-18 15:32:40.843670530 +0100
|
||||
@@ -503,6 +503,13 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
+ * Do we have systemd support?
|
||||
+ */
|
||||
@ -14,10 +14,10 @@ diff -up cups-1.5.2/config.h.in.systemd-socket cups-1.5.2/config.h.in
|
||||
+/*
|
||||
* Various scripting languages...
|
||||
*/
|
||||
|
||||
diff -up cups-1.5.2/config-scripts/cups-systemd.m4.systemd-socket cups-1.5.2/config-scripts/cups-systemd.m4
|
||||
--- cups-1.5.2/config-scripts/cups-systemd.m4.systemd-socket 2012-03-16 14:50:57.146449787 +0000
|
||||
+++ cups-1.5.2/config-scripts/cups-systemd.m4 2012-03-16 14:50:57.146449787 +0000
|
||||
|
||||
diff -up cups-1.5.0/config-scripts/cups-systemd.m4.systemd-socket cups-1.5.0/config-scripts/cups-systemd.m4
|
||||
--- cups-1.5.0/config-scripts/cups-systemd.m4.systemd-socket 2011-10-18 15:32:40.844670511 +0100
|
||||
+++ cups-1.5.0/config-scripts/cups-systemd.m4 2011-10-18 15:33:16.861989058 +0100
|
||||
@@ -0,0 +1,36 @@
|
||||
+dnl
|
||||
+dnl "$Id$"
|
||||
@ -55,9 +55,9 @@ diff -up cups-1.5.2/config-scripts/cups-systemd.m4.systemd-socket cups-1.5.2/con
|
||||
+dnl
|
||||
+dnl "$Id$"
|
||||
+dnl
|
||||
diff -up cups-1.5.2/configure.in.systemd-socket cups-1.5.2/configure.in
|
||||
--- cups-1.5.2/configure.in.systemd-socket 2011-08-31 02:36:33.000000000 +0100
|
||||
+++ cups-1.5.2/configure.in 2012-03-16 14:50:57.146449787 +0000
|
||||
diff -up cups-1.5.0/configure.in.systemd-socket cups-1.5.0/configure.in
|
||||
--- cups-1.5.0/configure.in.systemd-socket 2010-11-20 01:03:46.000000000 +0000
|
||||
+++ cups-1.5.0/configure.in 2011-10-18 15:32:40.844670511 +0100
|
||||
@@ -37,6 +37,7 @@ sinclude(config-scripts/cups-pam.m4)
|
||||
sinclude(config-scripts/cups-largefile.m4)
|
||||
sinclude(config-scripts/cups-dnssd.m4)
|
||||
@ -67,30 +67,30 @@ diff -up cups-1.5.2/configure.in.systemd-socket cups-1.5.2/configure.in
|
||||
sinclude(config-scripts/cups-pdf.m4)
|
||||
sinclude(config-scripts/cups-scripting.m4)
|
||||
@@ -71,6 +72,9 @@ AC_OUTPUT(Makedefs
|
||||
conf/snmp.conf
|
||||
cups-config
|
||||
data/testprint
|
||||
conf/snmp.conf
|
||||
cups-config
|
||||
data/testprint
|
||||
+ data/cups.service
|
||||
+ data/cups.socket
|
||||
+ data/cups.path
|
||||
desktop/cups.desktop
|
||||
doc/help/ref-cupsd-conf.html
|
||||
doc/help/standard.html
|
||||
diff -up cups-1.5.2/cups/usersys.c.systemd-socket cups-1.5.2/cups/usersys.c
|
||||
--- cups-1.5.2/cups/usersys.c.systemd-socket 2012-03-16 14:50:57.054449734 +0000
|
||||
+++ cups-1.5.2/cups/usersys.c 2012-03-16 14:50:57.148449788 +0000
|
||||
@@ -778,7 +778,7 @@ cups_read_client_conf(
|
||||
desktop/cups.desktop
|
||||
doc/help/ref-cupsd-conf.html
|
||||
doc/help/standard.html
|
||||
diff -up cups-1.5.0/cups/usersys.c.systemd-socket cups-1.5.0/cups/usersys.c
|
||||
--- cups-1.5.0/cups/usersys.c.systemd-socket 2011-10-18 15:32:40.645674277 +0100
|
||||
+++ cups-1.5.0/cups/usersys.c 2011-10-18 15:32:40.845670492 +0100
|
||||
@@ -770,7 +770,7 @@ cups_read_client_conf(
|
||||
struct stat sockinfo; /* Domain socket information */
|
||||
|
||||
|
||||
if (!stat(CUPS_DEFAULT_DOMAINSOCKET, &sockinfo) &&
|
||||
- (sockinfo.st_mode & S_IRWXO) == S_IRWXO)
|
||||
+ (sockinfo.st_mode & (S_IROTH | S_IWOTH)) == (S_IROTH | S_IWOTH))
|
||||
cups_server = CUPS_DEFAULT_DOMAINSOCKET;
|
||||
else
|
||||
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
|
||||
diff -up cups-1.5.2/data/cups.path.in.systemd-socket cups-1.5.2/data/cups.path.in
|
||||
--- cups-1.5.2/data/cups.path.in.systemd-socket 2012-03-16 14:50:57.148449788 +0000
|
||||
+++ cups-1.5.2/data/cups.path.in 2012-03-16 14:50:57.148449788 +0000
|
||||
diff -up cups-1.5.0/data/cups.path.in.systemd-socket cups-1.5.0/data/cups.path.in
|
||||
--- cups-1.5.0/data/cups.path.in.systemd-socket 2011-10-18 15:32:40.846670473 +0100
|
||||
+++ cups-1.5.0/data/cups.path.in 2011-10-18 15:32:40.846670473 +0100
|
||||
@@ -0,0 +1,8 @@
|
||||
+[Unit]
|
||||
+Description=CUPS Printer Service Spool
|
||||
@ -100,9 +100,9 @@ diff -up cups-1.5.2/data/cups.path.in.systemd-socket cups-1.5.2/data/cups.path.i
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=multi-user.target
|
||||
diff -up cups-1.5.2/data/cups.service.in.systemd-socket cups-1.5.2/data/cups.service.in
|
||||
--- cups-1.5.2/data/cups.service.in.systemd-socket 2012-03-16 14:50:57.149449788 +0000
|
||||
+++ cups-1.5.2/data/cups.service.in 2012-03-16 14:50:57.149449788 +0000
|
||||
diff -up cups-1.5.0/data/cups.service.in.systemd-socket cups-1.5.0/data/cups.service.in
|
||||
--- cups-1.5.0/data/cups.service.in.systemd-socket 2011-10-18 15:32:40.846670473 +0100
|
||||
+++ cups-1.5.0/data/cups.service.in 2011-10-18 15:32:40.846670473 +0100
|
||||
@@ -0,0 +1,10 @@
|
||||
+[Unit]
|
||||
+Description=CUPS Printing Service
|
||||
@ -114,9 +114,9 @@ diff -up cups-1.5.2/data/cups.service.in.systemd-socket cups-1.5.2/data/cups.ser
|
||||
+[Install]
|
||||
+Also=cups.socket cups.path
|
||||
+WantedBy=printer.target
|
||||
diff -up cups-1.5.2/data/cups.socket.in.systemd-socket cups-1.5.2/data/cups.socket.in
|
||||
--- cups-1.5.2/data/cups.socket.in.systemd-socket 2012-03-16 14:50:57.150449788 +0000
|
||||
+++ cups-1.5.2/data/cups.socket.in 2012-03-16 14:50:57.150449788 +0000
|
||||
diff -up cups-1.5.0/data/cups.socket.in.systemd-socket cups-1.5.0/data/cups.socket.in
|
||||
--- cups-1.5.0/data/cups.socket.in.systemd-socket 2011-10-18 15:32:40.847670454 +0100
|
||||
+++ cups-1.5.0/data/cups.socket.in 2011-10-18 15:32:40.847670454 +0100
|
||||
@@ -0,0 +1,11 @@
|
||||
+[Unit]
|
||||
+Description=CUPS Printing Service Sockets
|
||||
@ -129,35 +129,35 @@ diff -up cups-1.5.2/data/cups.socket.in.systemd-socket cups-1.5.2/data/cups.sock
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=sockets.target
|
||||
diff -up cups-1.5.2/data/Makefile.systemd-socket cups-1.5.2/data/Makefile
|
||||
--- cups-1.5.2/data/Makefile.systemd-socket 2011-05-12 06:21:56.000000000 +0100
|
||||
+++ cups-1.5.2/data/Makefile 2012-03-16 14:50:57.151449789 +0000
|
||||
diff -up cups-1.5.0/data/Makefile.systemd-socket cups-1.5.0/data/Makefile
|
||||
--- cups-1.5.0/data/Makefile.systemd-socket 2011-05-12 06:21:56.000000000 +0100
|
||||
+++ cups-1.5.0/data/Makefile 2011-10-18 15:32:40.847670454 +0100
|
||||
@@ -112,6 +112,12 @@ install-data:
|
||||
$(INSTALL_DATA) $$file $(DATADIR)/ppdc; \
|
||||
done
|
||||
$(INSTALL_DIR) -m 755 $(DATADIR)/profiles
|
||||
$(INSTALL_DATA) $$file $(DATADIR)/ppdc; \
|
||||
done
|
||||
$(INSTALL_DIR) -m 755 $(DATADIR)/profiles
|
||||
+ if test "x$(SYSTEMD_UNITS)" != "x" ; then \
|
||||
+ $(INSTALL_DIR) -m 755 $(SYSTEMDUNITDIR); \
|
||||
+ for file in $(SYSTEMD_UNITS); do \
|
||||
+ $(INSTALL_DATA) $$file $(SYSTEMDUNITDIR); \
|
||||
+ done; \
|
||||
+ fi
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
@@ -159,6 +165,9 @@ uninstall:
|
||||
-$(RMDIR) $(DATADIR)/charsets
|
||||
-$(RMDIR) $(DATADIR)/banners
|
||||
-$(RMDIR) $(DATADIR)
|
||||
-$(RMDIR) $(DATADIR)/charsets
|
||||
-$(RMDIR) $(DATADIR)/banners
|
||||
-$(RMDIR) $(DATADIR)
|
||||
+ for file in $(SYSTEMD_UNITS); do \
|
||||
+ $(RM) $(SYSTEMDUNITDIR)/$$file; \
|
||||
+ done
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
diff -up cups-1.5.2/Makedefs.in.systemd-socket cups-1.5.2/Makedefs.in
|
||||
--- cups-1.5.2/Makedefs.in.systemd-socket 2012-03-16 14:50:57.081449751 +0000
|
||||
+++ cups-1.5.2/Makedefs.in 2012-03-16 14:50:57.152449790 +0000
|
||||
diff -up cups-1.5.0/Makedefs.in.systemd-socket cups-1.5.0/Makedefs.in
|
||||
--- cups-1.5.0/Makedefs.in.systemd-socket 2011-10-18 15:32:40.719672876 +0100
|
||||
+++ cups-1.5.0/Makedefs.in 2011-10-18 15:32:40.848670435 +0100
|
||||
@@ -143,6 +143,7 @@ CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@
|
||||
CXXLIBS = @CXXLIBS@
|
||||
DBUS_NOTIFIER = @DBUS_NOTIFIER@
|
||||
@ -172,19 +172,19 @@ diff -up cups-1.5.2/Makedefs.in.systemd-socket cups-1.5.2/Makedefs.in
|
||||
LAUNCHDLIBS = @LAUNCHDLIBS@
|
||||
+SDLIBS = @SDLIBS@
|
||||
LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \
|
||||
-L../scheduler @LDARCHFLAGS@ \
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
-L../scheduler @LDARCHFLAGS@ \
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
@@ -267,6 +269,7 @@ PAMFILE = @PAMFILE@
|
||||
|
||||
|
||||
DEFAULT_LAUNCHD_CONF = @DEFAULT_LAUNCHD_CONF@
|
||||
DBUSDIR = @DBUSDIR@
|
||||
+SYSTEMDUNITDIR = $(BUILDROOT)@systemdsystemunitdir@
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
diff -up cups-1.5.2/scheduler/client.h.systemd-socket cups-1.5.2/scheduler/client.h
|
||||
--- cups-1.5.2/scheduler/client.h.systemd-socket 2011-03-25 21:25:38.000000000 +0000
|
||||
+++ cups-1.5.2/scheduler/client.h 2012-03-16 14:50:57.153449791 +0000
|
||||
diff -up cups-1.5.0/scheduler/client.h.systemd-socket cups-1.5.0/scheduler/client.h
|
||||
--- cups-1.5.0/scheduler/client.h.systemd-socket 2011-03-25 21:25:38.000000000 +0000
|
||||
+++ cups-1.5.0/scheduler/client.h 2011-10-18 15:32:40.848670435 +0100
|
||||
@@ -75,6 +75,9 @@ typedef struct
|
||||
int fd; /* File descriptor for this server */
|
||||
http_addr_t address; /* Bind address of socket */
|
||||
@ -193,101 +193,11 @@ diff -up cups-1.5.2/scheduler/client.h.systemd-socket cups-1.5.2/scheduler/clien
|
||||
+ int is_systemd; /* Is this a systemd socket? */
|
||||
+#endif /* HAVE_SYSTEMD */
|
||||
} cupsd_listener_t;
|
||||
|
||||
|
||||
diff -up cups-1.5.2/scheduler/dirsvc.c.systemd-socket cups-1.5.2/scheduler/dirsvc.c
|
||||
--- cups-1.5.2/scheduler/dirsvc.c.systemd-socket 2012-03-16 14:50:57.112449768 +0000
|
||||
+++ cups-1.5.2/scheduler/dirsvc.c 2012-03-16 14:50:57.155449792 +0000
|
||||
@@ -1512,7 +1512,7 @@ cupsdStartBrowsing(void)
|
||||
}
|
||||
}
|
||||
|
||||
- if (BrowseSocket >= 0)
|
||||
+ if (BrowseSocket >= 0 && !BrowseSocketIsSystemd)
|
||||
{
|
||||
/*
|
||||
* Bind the socket to browse port...
|
||||
@@ -1556,13 +1556,17 @@ cupsdStartBrowsing(void)
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to set broadcast mode - %s.",
|
||||
strerror(errno));
|
||||
|
||||
+ if (!BrowseSocketIsSystemd)
|
||||
+ {
|
||||
#ifdef WIN32
|
||||
- closesocket(BrowseSocket);
|
||||
+ closesocket(BrowseSocket);
|
||||
#else
|
||||
- close(BrowseSocket);
|
||||
+ close(BrowseSocket);
|
||||
#endif /* WIN32 */
|
||||
|
||||
- BrowseSocket = -1;
|
||||
+ BrowseSocket = -1;
|
||||
+ }
|
||||
+
|
||||
BrowseLocalProtocols &= ~BROWSE_CUPS;
|
||||
BrowseRemoteProtocols &= ~BROWSE_CUPS;
|
||||
|
||||
@@ -1885,15 +1889,22 @@ cupsdStopBrowsing(void)
|
||||
if (((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_CUPS) &&
|
||||
BrowseSocket >= 0)
|
||||
{
|
||||
- /*
|
||||
- * Close the socket and remove it from the input selection set.
|
||||
- */
|
||||
+ if (!BrowseSocketIsSystemd)
|
||||
+ {
|
||||
+ /*
|
||||
+ * Close the socket.
|
||||
+ */
|
||||
|
||||
#ifdef WIN32
|
||||
- closesocket(BrowseSocket);
|
||||
+ closesocket(BrowseSocket);
|
||||
#else
|
||||
- close(BrowseSocket);
|
||||
+ close(BrowseSocket);
|
||||
#endif /* WIN32 */
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Remove it from the input selection set.
|
||||
+ */
|
||||
|
||||
cupsdRemoveSelect(BrowseSocket);
|
||||
BrowseSocket = -1;
|
||||
@@ -5693,11 +5704,14 @@ update_cups_browse(void)
|
||||
strerror(errno));
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "CUPS browsing turned off.");
|
||||
|
||||
+ if (!BrowseSocketIsSystemd)
|
||||
+ {
|
||||
#ifdef WIN32
|
||||
- closesocket(BrowseSocket);
|
||||
+ closesocket(BrowseSocket);
|
||||
#else
|
||||
- close(BrowseSocket);
|
||||
+ close(BrowseSocket);
|
||||
#endif /* WIN32 */
|
||||
+ }
|
||||
|
||||
cupsdRemoveSelect(BrowseSocket);
|
||||
BrowseSocket = -1;
|
||||
diff -up cups-1.5.2/scheduler/dirsvc.h.systemd-socket cups-1.5.2/scheduler/dirsvc.h
|
||||
--- cups-1.5.2/scheduler/dirsvc.h.systemd-socket 2012-03-16 14:50:57.113449769 +0000
|
||||
+++ cups-1.5.2/scheduler/dirsvc.h 2012-03-16 14:50:57.157449792 +0000
|
||||
@@ -100,6 +100,8 @@ VAR int Browsing VALUE(TRUE),
|
||||
/* Short names for remote printers? */
|
||||
BrowseSocket VALUE(-1),
|
||||
/* Socket for browsing */
|
||||
+ BrowseSocketIsSystemd VALUE(0),
|
||||
+ /* BrowseSocket is systemd-provided? */
|
||||
BrowsePort VALUE(IPP_PORT),
|
||||
/* Port number for broadcasts */
|
||||
BrowseInterval VALUE(DEFAULT_INTERVAL),
|
||||
diff -up cups-1.5.2/scheduler/listen.c.systemd-socket cups-1.5.2/scheduler/listen.c
|
||||
--- cups-1.5.2/scheduler/listen.c.systemd-socket 2011-04-16 00:38:13.000000000 +0100
|
||||
+++ cups-1.5.2/scheduler/listen.c 2012-03-16 14:50:57.158449792 +0000
|
||||
|
||||
|
||||
diff -up cups-1.5.0/scheduler/listen.c.systemd-socket cups-1.5.0/scheduler/listen.c
|
||||
--- cups-1.5.0/scheduler/listen.c.systemd-socket 2011-04-16 00:38:13.000000000 +0100
|
||||
+++ cups-1.5.0/scheduler/listen.c 2011-10-18 15:32:40.849670416 +0100
|
||||
@@ -401,7 +401,11 @@ cupsdStopListening(void)
|
||||
lis;
|
||||
lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
|
||||
@ -301,9 +211,9 @@ diff -up cups-1.5.2/scheduler/listen.c.systemd-socket cups-1.5.2/scheduler/liste
|
||||
{
|
||||
#ifdef WIN32
|
||||
closesocket(lis->fd);
|
||||
diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
--- cups-1.5.2/scheduler/main.c.systemd-socket 2012-03-16 14:50:57.121449773 +0000
|
||||
+++ cups-1.5.2/scheduler/main.c 2012-03-16 14:51:55.409483636 +0000
|
||||
diff -up cups-1.5.0/scheduler/main.c.systemd-socket cups-1.5.0/scheduler/main.c
|
||||
--- cups-1.5.0/scheduler/main.c.systemd-socket 2011-10-18 15:32:40.802671306 +0100
|
||||
+++ cups-1.5.0/scheduler/main.c 2011-10-18 15:32:40.851670379 +0100
|
||||
@@ -26,6 +26,8 @@
|
||||
* launchd_checkin() - Check-in with launchd and collect the listening
|
||||
* fds.
|
||||
@ -316,7 +226,7 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
@@ -62,6 +64,10 @@
|
||||
# endif /* !LAUNCH_JOBKEY_SERVICEIPC */
|
||||
#endif /* HAVE_LAUNCH_H */
|
||||
|
||||
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+#include <systemd/sd-daemon.h>
|
||||
+#endif /* HAVE_SYSTEMD */
|
||||
@ -337,7 +247,7 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
@@ -537,6 +546,13 @@ main(int argc, /* I - Number of comm
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+ /*
|
||||
+ * If we were started by systemd get the listen sockets file descriptors...
|
||||
@ -349,9 +259,9 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
* Startup the server...
|
||||
*/
|
||||
@@ -759,6 +775,15 @@ main(int argc, /* I - Number of comm
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+ /*
|
||||
+ * If we were started by systemd get the listen sockets file
|
||||
@ -364,10 +274,10 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
/*
|
||||
* Startup the server...
|
||||
*/
|
||||
@@ -1584,6 +1609,139 @@ launchd_checkout(void)
|
||||
@@ -1584,6 +1609,100 @@ launchd_checkout(void)
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+static void
|
||||
+systemd_checkin(void)
|
||||
@ -396,53 +306,14 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
+ char s[256];
|
||||
+
|
||||
+ r = sd_is_socket(fd, AF_UNSPEC, SOCK_STREAM, 1);
|
||||
+ if (r < 0)
|
||||
+ {
|
||||
+ if (r < 0) {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Unable to verify socket type - %s",
|
||||
+ strerror(-r));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (!r)
|
||||
+ {
|
||||
+ if (Browsing &&
|
||||
+ ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_CUPS))
|
||||
+ {
|
||||
+ r = sd_is_socket(fd, AF_UNSPEC, SOCK_DGRAM, 0);
|
||||
+ if (r < 0)
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Unable to verify socket type - %s",
|
||||
+ strerror(-r));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (r)
|
||||
+ {
|
||||
+ /*
|
||||
+ * This is the browse socket.
|
||||
+ */
|
||||
+
|
||||
+ char addrstr[256];
|
||||
+ if (getsockname(fd, (struct sockaddr*) &addr, &addrlen))
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Unable to get local address - %s",
|
||||
+ strerror(errno));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ httpAddrString (&addr, addrstr, sizeof (addrstr));
|
||||
+ BrowseSocket = fd;
|
||||
+ BrowseSocketIsSystemd = 1;
|
||||
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
+ "systemd_checkin: Matched browse (port %d) with fd %d:%s...",
|
||||
+ BrowsePort, fd, addrstr);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+ if (!r) {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Socket not of the right type");
|
||||
+ continue;
|
||||
@ -456,7 +327,7 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ /*
|
||||
+ * Try to match the systemd socket address to one of the listeners...
|
||||
+ */
|
||||
+
|
||||
@ -464,7 +335,7 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
+ lis;
|
||||
+ lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
|
||||
+ if (httpAddrEqual(&lis->address, &addr))
|
||||
+ break;
|
||||
+ break;
|
||||
+
|
||||
+ if (lis)
|
||||
+ {
|
||||
@ -501,27 +372,27 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
+ }
|
||||
+}
|
||||
+#endif /* HAVE_SYSTEMD */
|
||||
|
||||
|
||||
/*
|
||||
* 'parent_handler()' - Catch USR1/CHLD signals...
|
||||
diff -up cups-1.5.2/scheduler/Makefile.systemd-socket cups-1.5.2/scheduler/Makefile
|
||||
--- cups-1.5.2/scheduler/Makefile.systemd-socket 2012-03-16 14:50:57.130449778 +0000
|
||||
+++ cups-1.5.2/scheduler/Makefile 2012-03-16 14:50:57.160449794 +0000
|
||||
diff -up cups-1.5.0/scheduler/Makefile.systemd-socket cups-1.5.0/scheduler/Makefile
|
||||
--- cups-1.5.0/scheduler/Makefile.systemd-socket 2011-10-18 15:32:40.817671022 +0100
|
||||
+++ cups-1.5.0/scheduler/Makefile 2011-10-18 15:32:40.852670360 +0100
|
||||
@@ -382,7 +382,7 @@ cupsd: $(CUPSDOBJS) $(LIBCUPSMIME) ../cu
|
||||
$(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) -L. -lcupsmime \
|
||||
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
|
||||
$(LIBPAPER) $(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBS) \
|
||||
$(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) -L. -lcupsmime \
|
||||
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
|
||||
$(LIBPAPER) $(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBS) \
|
||||
- $(LIBGSSAPI) $(LIBWRAP)
|
||||
+ $(LIBGSSAPI) $(LIBWRAP) $(SDLIBS)
|
||||
|
||||
|
||||
cupsd-static: $(CUPSDOBJS) libcupsmime.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
echo Linking $@...
|
||||
@@ -390,7 +390,7 @@ cupsd-static: $(CUPSDOBJS) libcupsmime.a
|
||||
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \
|
||||
$(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBGSSAPI) \
|
||||
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \
|
||||
$(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBGSSAPI) \
|
||||
- $(LIBWRAP)
|
||||
+ $(LIBWRAP) $(SDLIBS)
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
|
@ -1,60 +1,38 @@
|
||||
add_daemon() {
|
||||
local checkdmn=$(grep '^DAEMONS' /etc/rc.conf | grep cups)
|
||||
|
||||
if [ -z "${checkdmn}" ]; then
|
||||
sed -i '/^DAEMONS/{s/)$/ cups)/}' /etc/rc.conf
|
||||
fi
|
||||
}
|
||||
|
||||
add_group() {
|
||||
# Create the "lpadmin" group, if needed
|
||||
if ! getent group lpadmin 2> /dev/null; then
|
||||
groupadd --system lpadmin
|
||||
fi
|
||||
|
||||
# Add all the users in the "lp" group to "lpadmin" (expect for "daemon")
|
||||
for user in $(getent group lp | cut -d ':' -f 4 | tr ',' ' '); do
|
||||
[ "${user}" != "daemon" ] && gpasswd -a "${user}" lpadmin > /dev/null
|
||||
done
|
||||
}
|
||||
|
||||
post_install() {
|
||||
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
|
||||
echo ">> If you use an HTTPS connection to CUPS, the first time you access"
|
||||
echo ">> the interface it may take a very long time before the site comes up."
|
||||
echo ">> This is because the first request triggers the generation of the CUPS"
|
||||
echo ">> SSL certificates which can be a very time-consuming job."
|
||||
add_group
|
||||
add_daemon
|
||||
/etc/rc.d/cups restart
|
||||
if [ -x usr/bin/xdg-icon-resource ]; then
|
||||
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
|
||||
fi
|
||||
echo ">> If you use an HTTPS connection to CUPS, the first time you access"
|
||||
echo ">> the interface it may take a very long time before the site comes up."
|
||||
echo ">> This is because the first request triggers the generation of the CUPS"
|
||||
echo ">> SSL certificates which can be a very time-consuming job."
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
|
||||
|
||||
# If the "lp" user group is still present, and the user has not changed the cupsd.conf
|
||||
# from the old default "SystemGroup sys root" setting, let's replace that line, so that
|
||||
# it will also allow for the "lp" user group to administrate CUPS.
|
||||
# Without this, non-root users will see the Printers KCM silently hang (the CUPS server
|
||||
# will deny access).
|
||||
|
||||
local cupsd=etc/cups/cupsd.conf
|
||||
|
||||
if ( getent group lp && grep '^SystemGroup sys root$' "${cupsd}") &>/dev/null; then
|
||||
echo "[NOTICE] The CUPS configuration is being automatically tweaked to allow all users belonging to the \"lp\" group to administrate the server."
|
||||
sed -i 's/^SystemGroup sys root$/SystemGroup sys root lpadmin/g' "${cupsd}"
|
||||
if [ -x usr/bin/xdg-icon-resource ]; then
|
||||
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
|
||||
fi
|
||||
if [ "`vercmp $2 1.4.7-2`" -lt 0 ]; then
|
||||
# important upgrade notice
|
||||
echo "daemon script has been renamed to /etc/rc.d/cupsd"
|
||||
echo "change your entry in /etc/rc.conf"
|
||||
fi
|
||||
if [ "`vercmp $2 1.6.0`" -lt 0 ]; then
|
||||
# important upgrade notice
|
||||
echo "* avahi-daemon should now run before you start cupsd for"
|
||||
echo " printer Browsing support"
|
||||
echo "* check your config with cupsd -t"
|
||||
echo " and fix all Browsing related settings"
|
||||
fi
|
||||
if [ "`vercmp $2 1.6.1-3`" -lt 0 ]; then
|
||||
# important upgrade notice
|
||||
echo "> It's now safe to load usblp kernel module."
|
||||
echo "> There's no more need to blacklist it."
|
||||
fi
|
||||
|
||||
add_group
|
||||
add_daemon
|
||||
/etc/rc.d/cups restart
|
||||
}
|
||||
|
||||
pre_remove() {
|
||||
/etc/rc.d/cups stop
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
|
||||
sed -i '/^DAEMONS/{s/ cups)$/)/}' /etc/rc.conf
|
||||
if [ -x usr/bin/xdg-icon-resource ]; then
|
||||
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
|
||||
fi
|
||||
}
|
||||
|
12
cups/cupsd-conf-remove-obsolete-browse-directives.patch
Normal file
12
cups/cupsd-conf-remove-obsolete-browse-directives.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uraN cups/conf/cupsd.conf.in cups-new/conf/cupsd.conf.in
|
||||
--- cups/conf/cupsd.conf.in 2012-05-25 15:28:25.000000000 +0200
|
||||
+++ cups-new/conf/cupsd.conf.in 2012-08-04 20:56:26.699062177 +0200
|
||||
@@ -19,8 +19,6 @@
|
||||
|
||||
# Show shared printers on the local network.
|
||||
Browsing On
|
||||
-BrowseOrder allow,deny
|
||||
-BrowseAllow all
|
||||
BrowseLocalProtocols @CUPS_BROWSE_LOCAL_PROTOCOLS@
|
||||
|
||||
# Default authentication type, when authentication is required...
|
25
cups/recognize-remote-cups-queue-via-dnssd-uri.patch
Normal file
25
cups/recognize-remote-cups-queue-via-dnssd-uri.patch
Normal file
@ -0,0 +1,25 @@
|
||||
diff -uraN cups/scheduler/printers.c cups-new/scheduler/printers.c
|
||||
--- cups/scheduler/printers.c 2012-05-25 15:28:49.000000000 +0200
|
||||
+++ cups-new/scheduler/printers.c 2012-08-04 20:58:40.475725544 +0200
|
||||
@@ -4829,13 +4829,14 @@
|
||||
"printer-make-and-model", NULL,
|
||||
"Local System V Printer");
|
||||
}
|
||||
- else if (!strncmp(p->device_uri, "ipp://", 6) &&
|
||||
- (strstr(p->device_uri, "/printers/") != NULL ||
|
||||
- strstr(p->device_uri, "/classes/") != NULL ||
|
||||
- ((strstr(p->device_uri, "._ipp.") != NULL ||
|
||||
- strstr(p->device_uri, "._ipps.") != NULL) &&
|
||||
- !strcmp(p->device_uri + strlen(p->device_uri) - 5,
|
||||
- "/cups"))))
|
||||
+ else if ((!strncmp(p->device_uri, "ipp://", 6) &&
|
||||
+ (strstr(p->device_uri, "/printers/") != NULL ||
|
||||
+ strstr(p->device_uri, "/classes/") != NULL)) ||
|
||||
+ (!strncmp(p->device_uri, "dnssd://", 8) &&
|
||||
+ (strstr(p->device_uri, "._ipp.") != NULL ||
|
||||
+ strstr(p->device_uri, "._ipps.") != NULL) &&
|
||||
+ !strcmp(p->device_uri + strlen(p->device_uri) - 5,
|
||||
+ "/cups")))
|
||||
{
|
||||
/*
|
||||
* Tell the client this is really a hard-wired remote printer.
|
@ -0,0 +1,74 @@
|
||||
--- backend/usb-libusb.c.orig 2012-07-16 19:10:55.000000000 +0200
|
||||
+++ backend/usb-libusb.c 2012-08-06 11:01:58.034150159 +0200
|
||||
@@ -70,7 +70,7 @@
|
||||
read_endp, /* Read endpoint */
|
||||
protocol, /* Protocol: 1 = Uni-di, 2 = Bi-di. */
|
||||
usblp_attached, /* "usblp" kernel module attached? */
|
||||
- opened_for_job; /* Set to 1 by print_device() */
|
||||
+ reset_after_job; /* Set to 1 by print_device() */
|
||||
unsigned int quirks; /* Quirks flags */
|
||||
struct libusb_device_handle *handle; /* Open handle to device */
|
||||
} usb_printer_t;
|
||||
@@ -122,6 +122,8 @@
|
||||
#define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */
|
||||
#define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific
|
||||
Class or SubClass */
|
||||
+#define USBLP_QUIRK_RESET 0x4000 /* After printing do a reset
|
||||
+ for clean-up */
|
||||
#define USBLP_QUIRK_NO_REATTACH 0x8000 /* After printing we cannot re-attach
|
||||
the usblp kernel module */
|
||||
|
||||
@@ -147,9 +149,11 @@
|
||||
{ 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt
|
||||
Printer M129C */
|
||||
{ 0x067b, 0x2305, USBLP_QUIRK_BIDIR |
|
||||
- USBLP_QUIRK_NO_REATTACH },
|
||||
+ USBLP_QUIRK_NO_REATTACH |
|
||||
+ USBLP_QUIRK_RESET },
|
||||
/* Prolific Technology, Inc. PL2305 Parallel Port
|
||||
(USB -> Parallel adapter) */
|
||||
+ { 0x04e8, 0x0000, USBLP_QUIRK_RESET }, /* All Samsung devices */
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
@@ -256,7 +260,12 @@
|
||||
}
|
||||
|
||||
g.print_fd = print_fd;
|
||||
- g.printer->opened_for_job = 1;
|
||||
+
|
||||
+ /*
|
||||
+ * Some devices need a reset after finishing a job, these devices are
|
||||
+ * marked with the USBLP_QUIRK_RESET quirk.
|
||||
+ */
|
||||
+ g.printer->reset_after_job = (g.printer->quirks & USBLP_QUIRK_RESET ? 1 : 0);
|
||||
|
||||
/*
|
||||
* If we are printing data from a print driver on stdin, ignore SIGTERM
|
||||
@@ -772,7 +781,7 @@
|
||||
* Reset the device to clean up after the job
|
||||
*/
|
||||
|
||||
- if (printer->opened_for_job == 1)
|
||||
+ if (printer->reset_after_job == 1)
|
||||
{
|
||||
if ((errcode = libusb_reset_device(printer->handle)) < 0)
|
||||
fprintf(stderr,
|
||||
@@ -1288,7 +1297,7 @@
|
||||
}
|
||||
|
||||
printer->usblp_attached = 0;
|
||||
- printer->opened_for_job = 0;
|
||||
+ printer->reset_after_job = 0;
|
||||
|
||||
if (verbose)
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
@@ -1586,7 +1595,7 @@
|
||||
for (i = 0; quirk_printers[i].vendorId; i++)
|
||||
{
|
||||
if (vendor == quirk_printers[i].vendorId &&
|
||||
- product == quirk_printers[i].productId)
|
||||
+ (product == 0x0000 || product == quirk_printers[i].productId))
|
||||
return quirk_printers[i].quirks;
|
||||
}
|
||||
return 0;
|
@ -6,7 +6,7 @@
|
||||
|
||||
pkgname=dbus-c++
|
||||
pkgver=0.9.0
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="dbus-c++ attempts to provide a C++ API for D-BUS"
|
||||
url="http://sourceforge.net/projects/dbus-cplusplus/"
|
||||
arch=('i686' 'x86_64')
|
||||
|
@ -1,12 +1,11 @@
|
||||
#
|
||||
# Chakra Packages, part of chakra-project.org
|
||||
# Platform Packages for Chakra, part of chakra-project.org
|
||||
#
|
||||
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
||||
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
||||
# maintainer abveritas@chakra-project.org
|
||||
|
||||
pkgname=dbus-glib
|
||||
pkgver=0.94
|
||||
pkgrel=2
|
||||
pkgver=0.100
|
||||
pkgrel=1
|
||||
pkgdesc="GLib bindings for DBUS"
|
||||
arch=('i686' 'x86_64')
|
||||
license=('GPL')
|
||||
@ -14,16 +13,12 @@ url="http://www.freedesktop.org/wiki/Software/DBusBindings"
|
||||
depends=('dbus-core' 'glib2')
|
||||
makedepends=('pkgconfig')
|
||||
options=('!libtool' '!emptydirs')
|
||||
source=("http://dbus.freedesktop.org/releases/${pkgname}/${pkgname}-${pkgver}.tar.gz"
|
||||
'fix_network_manager.patch')
|
||||
md5sums=('e1f1506a6f4941e67bffd614b1ad5af6'
|
||||
'2a3598342dd25722d452e7beaf21b5f3')
|
||||
source=("http://dbus.freedesktop.org/releases/${pkgname}/${pkgname}-${pkgver}.tar.gz")
|
||||
md5sums=('d33959a9c0c6a158f5ac6d640316e89e')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
|
||||
patch -Np1 -i "${srcdir}/fix_network_manager.patch"
|
||||
|
||||
./configure --prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var \
|
||||
|
@ -4,8 +4,8 @@
|
||||
# maintainer abveritas@chakra-project.org
|
||||
#
|
||||
pkgname=dbus-python
|
||||
pkgver=0.84.0
|
||||
pkgrel=3
|
||||
pkgver=1.1.1
|
||||
pkgrel=1
|
||||
pkgdesc="Python bindings for DBUS"
|
||||
arch=('i686' 'x86_64')
|
||||
license=('GPL' 'LGPL')
|
||||
@ -14,7 +14,7 @@ depends=('dbus-glib' 'python2')
|
||||
makedepends=('pkg-config' 'docutils')
|
||||
options=('!libtool')
|
||||
source=(http://dbus.freedesktop.org/releases/${pkgname}/${pkgname}-${pkgver}.tar.gz)
|
||||
md5sums=('fe69a2613e824463e74f10913708c88a')
|
||||
md5sums=('742c7432ad0f7c3f98291d58fa2e35dc')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
|
@ -1,10 +1,11 @@
|
||||
# $Id: PKGBUILD 32490 2009-04-01 03:19:22Z eric $
|
||||
# Maintainer: Jan de Groot <jgc@archlinux.org>
|
||||
# Maintainer (x86_64:) Mateusz Krawczuk <willingmagic[at]gmail[dot]com>
|
||||
#
|
||||
# Platform Packages for Chakra, part of chakra-project.org
|
||||
#
|
||||
# maintainer abveritas@chakra-project.org
|
||||
|
||||
pkgname=dbus-sharp
|
||||
pkgver=0.7.0
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="C# implementation of D-Bus"
|
||||
arch=('any')
|
||||
url="http://github.com/mono/dbus-sharp/"
|
||||
|
10
dbus/30-dbus
10
dbus/30-dbus
@ -1,10 +1,8 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# launches a session dbus instance
|
||||
|
||||
dbuslaunch="$(which dbus-launch 2>/dev/null)"
|
||||
|
||||
if [ -x "${dbuslaunch}" ] && [ -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then
|
||||
eval $("${dbuslaunch}" --sh-syntax --exit-with-session)
|
||||
dbuslaunch="`which dbus-launch 2>/dev/null`"
|
||||
if [ -n "$dbuslaunch" ] && [ -x "$dbuslaunch" ] && [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
|
||||
eval `$dbuslaunch --sh-syntax --exit-with-session`
|
||||
fi
|
||||
|
||||
|
@ -1,27 +1,26 @@
|
||||
#
|
||||
# Core Packages for Chakra, part of chakra-project.org
|
||||
#
|
||||
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
||||
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
||||
# Platform Packages for Chakra, part of chakra-project.org
|
||||
#
|
||||
# maintainer abveritas@chakra-project.org
|
||||
|
||||
pkgname=dbus
|
||||
pkgver=1.4.14
|
||||
pkgrel=2
|
||||
pkgver=1.6.4
|
||||
pkgrel=1
|
||||
pkgdesc="Freedesktop.org message bus system"
|
||||
url="http://www.freedesktop.org/Software/dbus"
|
||||
arch=(i686 x86_64)
|
||||
arch=('i686' 'x86_64')
|
||||
license=('GPL' 'custom')
|
||||
depends=("dbus-core>=${pkgver}" 'libx11')
|
||||
source=("http://dbus.freedesktop.org/releases/${pkgname}/${pkgname}-${pkgver}.tar.gz"
|
||||
'30-dbus')
|
||||
md5sums=('ae6de2562a57516cfabaf56903375ba9'
|
||||
'd1c8e6ed22a59762773dd81363ffacd8')
|
||||
md5sums=('5ec43dc4554cba638917317b2b4f7640'
|
||||
'9fafe8b28460aeaa6054309ef4c5ed92')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
|
||||
ECHO="echo" ./configure --prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var \
|
||||
--libexecdir=/usr/lib/dbus-1.0 \
|
||||
--with-dbus-user=81 \
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 5ebff5337594d690b322078c512eb222d34aaa82 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Schmidt <mschmidt@redhat.com>
|
||||
Date: Fri, 2 Mar 2012 10:39:10 +0100
|
||||
Subject: [PATCH] util: never follow symlinks in rm_rf_children()
|
||||
|
||||
The function checks if the entry is a directory before recursing, but
|
||||
there is a window between the check and the open, during which the
|
||||
directory could be replaced with a symlink.
|
||||
|
||||
CVE-2012-1174
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=803358
|
||||
---
|
||||
src/util.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/util.c b/src/util.c
|
||||
index 20cbc2b..dfc1dc6 100644
|
||||
--- a/src/util.c
|
||||
+++ b/src/util.c
|
||||
@@ -3593,7 +3593,8 @@ static int rm_rf_children(int fd, bool only_dirs, bool honour_sticky) {
|
||||
if (is_dir) {
|
||||
int subdir_fd;
|
||||
|
||||
- if ((subdir_fd = openat(fd, de->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC)) < 0) {
|
||||
+ subdir_fd = openat(fd, de->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW);
|
||||
+ if (subdir_fd < 0) {
|
||||
if (ret == 0 && errno != ENOENT)
|
||||
ret = -errno;
|
||||
continue;
|
||||
--
|
||||
1.7.9.4
|
@ -1,94 +0,0 @@
|
||||
#
|
||||
# Core Packages for Chakra, part of chakra-project.org
|
||||
#
|
||||
# maintainer (x86_64:) Mateusz Krawczuk <willingmagic[at]gmail[dot]com>
|
||||
|
||||
pkgname=systemd
|
||||
pkgver=44
|
||||
pkgrel=3
|
||||
pkgdesc="Session and Startup manager"
|
||||
arch=('i686' 'x86_64')
|
||||
url="http://www.freedesktop.org/wiki/Software/systemd"
|
||||
license=('GPL2')
|
||||
depends=('acl' 'dbus-core' 'kbd' 'kmod' 'libcap' 'util-linux' 'udev' 'xz' 'pam')
|
||||
makedepends=('gperf' 'cryptsetup' 'docbook-xsl' 'intltool' 'libxslt' 'linux-api-headers')
|
||||
optdepends=('cryptsetup: required for encrypted block devices'
|
||||
'dbus-python: systemd-analyze'
|
||||
'initscripts: legacy support for hostname and vconsole setup'
|
||||
'initscripts-systemd: native boot and initialization scripts'
|
||||
'python2-cairo: systemd-analyze'
|
||||
'systemd-units: collection of native unit files for Chakra daemon/init scripts')
|
||||
options=('!libtool')
|
||||
backup=(etc/dbus-1/system.d/org.freedesktop.systemd1.conf
|
||||
etc/dbus-1/system.d/org.freedesktop.hostname1.conf
|
||||
etc/dbus-1/system.d/org.freedesktop.login1.conf
|
||||
etc/dbus-1/system.d/org.freedesktop.locale1.conf
|
||||
etc/dbus-1/system.d/org.freedesktop.timedate1.conf
|
||||
etc/systemd/system.conf
|
||||
etc/systemd/user.conf
|
||||
etc/systemd/systemd-logind.conf
|
||||
etc/systemd/systemd-journald.conf)
|
||||
install="$pkgname.install"
|
||||
source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz"
|
||||
"os-release"
|
||||
0001-util-never-follow-symlinks-in-rm_rf_children.patch)
|
||||
md5sums=('11f44ff74c87850064e4351518bcff17'
|
||||
'68cf3e12b0e98a51efde9811e5fc713c'
|
||||
'2cf6162256c02f37fe8d38edc96fa4f3')
|
||||
|
||||
build() {
|
||||
cd "$pkgname-$pkgver"
|
||||
|
||||
#https://bugzilla.redhat.com/show_bug.cgi?id=803358
|
||||
patch -p1 <"$srcdir/0001-util-never-follow-symlinks-in-rm_rf_children.patch"
|
||||
|
||||
sed -i -e '/^Environ.*LANG/s/^/#/' \
|
||||
-e '/^ExecStart/s/agetty/& -8/' units/getty@.service.m4
|
||||
|
||||
./configure --sysconfdir=/etc \
|
||||
--libexecdir=/usr/lib \
|
||||
--libdir=/usr/lib \
|
||||
--with-pamlibdir=/usr/lib/security \
|
||||
--localstatedir=/var \
|
||||
--with-distro=other \
|
||||
--disable-gtk
|
||||
|
||||
make
|
||||
|
||||
# fix .so links in manpages
|
||||
sed -i 's|\.so halt\.8|.so man8/systemd.halt.8|' man/{halt,poweroff}.8
|
||||
sed -i 's|\.so systemd\.1|.so man1/systemd.1|' man/init.1
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$pkgname-$pkgver"
|
||||
|
||||
make DESTDIR="$pkgdir" install
|
||||
|
||||
install -Dm644 "$srcdir/os-release" "$pkgdir/etc/os-release"
|
||||
printf "d /run/console 755 root root\n" > "$pkgdir/usr/lib/tmpfiles.d/console.conf"
|
||||
|
||||
# symlink to /bin/systemd for compat and sanity
|
||||
install -dm755 "$pkgdir/bin"
|
||||
ln -s ../usr/lib/systemd/systemd "$pkgdir/bin/systemd"
|
||||
|
||||
# fix systemd-analyze for python2
|
||||
sed -i '1s/python$/python2/' "$pkgdir/usr/bin/systemd-analyze"
|
||||
|
||||
# rename man pages to avoid conflicts with sysvinit and initscripts
|
||||
cd "$pkgdir/usr/share/man"
|
||||
|
||||
# not building this with systemd
|
||||
rm -f "man1/systemadm.1"
|
||||
|
||||
manpages=(man8/{telinit,halt,reboot,poweroff,runlevel,shutdown}.8
|
||||
man5/{hostname,{vconsole,locale}.conf}.5)
|
||||
|
||||
for manpage in "${manpages[@]}"; do
|
||||
IFS='/' read section page <<< "$manpage"
|
||||
mv "$manpage" "$section/systemd.$page"
|
||||
done
|
||||
|
||||
# get rid of uneeded lock directories
|
||||
sed -ri '/\/run\/lock\/(subsys|lockdev)/d' "$pkgdir"/usr/lib/tmpfiles.d/legacy.conf
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
NAME="Chakra GNU/Linux"
|
||||
ID=chakra
|
||||
PRETTY_NAME="Chakra GNU/Linux"
|
||||
ANSI_COLOR="1;36"
|
@ -1,51 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
checkgroups() {
|
||||
if ! getent group lock >/dev/null; then
|
||||
groupadd -g 54 lock
|
||||
fi
|
||||
}
|
||||
|
||||
sd_booted() {
|
||||
[ -e sys/fs/cgroups/systemd ]
|
||||
}
|
||||
|
||||
post_install() {
|
||||
checkgroups
|
||||
|
||||
if [ ! -f etc/machine-id ]; then
|
||||
systemd-machine-id-setup
|
||||
fi
|
||||
|
||||
echo "systemd has been installed to /bin/systemd. Please ensure you append"
|
||||
echo "init=/bin/systemd to your kernel command line in your bootloader."
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
checkgroups
|
||||
|
||||
if [ ! -f etc/machine-id ]; then
|
||||
systemd-machine-id-setup
|
||||
fi
|
||||
|
||||
if sd_booted; then
|
||||
systemctl daemon-reexec >/dev/null
|
||||
fi
|
||||
|
||||
newpkgver=${1%-*}
|
||||
oldpkgver=${2%-*}
|
||||
|
||||
# catch v31 need for restarting systemd-logind.service
|
||||
if [ "$newpkgver" -ge 31 ] && [ "$oldpkgver" -lt 31 ]; then
|
||||
# but only if systemd is running
|
||||
if sd_booted; then
|
||||
systemctl try-restart systemd-logind.service
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
if getent group lock >/dev/null; then
|
||||
groupdel lock
|
||||
fi
|
||||
}
|
Loading…
Reference in New Issue
Block a user