Re: [ptxdist] [PATCH v3 5/7] cups: new package: Common Unix Printing System

2017-11-01 Thread Michael Olbrich
On Tue, Oct 31, 2017 at 11:31:45PM +0100, Roland Hieber wrote:
> On 27.10.2017 19:54, Michael Olbrich wrote:
> > On Wed, Oct 25, 2017 at 10:57:49PM +0200, Roland Hieber wrote:
> >> diff --git a/rules/cups.in b/rules/cups.in
> >> new file mode 100644
> >> index 0..13b7142d6
> >> --- /dev/null
> >> +++ b/rules/cups.in
> >> @@ -0,0 +1,113 @@
> >> +## SECTION=applications
> >> +
> >> +menuconfig CUPS
> >> +  tristate
> >> +  prompt "cups  "
> >> +
> >> +  select ROOTFS_VAR_LOG
> >> +  select ROOTFS_VAR_RUN
> >> +  select LIBC_M
> >> +  select LIBC_CRYPT
> >> +  select ZLIB
> >> +
> >> +  select LIBC_PTHREAD if CUPS_THREADING
> >> +  select SYSTEMD  if CUPS_SYSTEMD_UNIT
> >> +  select LIBPAPER if CUPS_LIBPAPER
> >> +  select LIBUSB   if CUPS_LIBUSB
> >> +  select DBUS if CUPS_DBUS
> >> +  select GNUTLS   if CUPS_SSL
> >> +  select AVAHIif CUPS_AVAHI
> >> +  select AVAHI_LIBAVAHI_CLIENTif CUPS_AVAHI
> >> +  select ORACLE_JAVA7_JRE if CUPS_JAVA
> > 
> > This is not good. ORACLE_JAVA7_JRE is the x86-only binary packages.
> > Just add a comment to the help text, that some java is needed.
> > 
> >> +  select PERL if CUPS_PERL
> >> +  select PHP5 if CUPS_PHP
> >> +  select PYTHON   if CUPS_PYTHON
> > 
> > Is python2 the only option or could python3 be used as well?
> 
> Python 3 is possible. But I have to pass the path to the executable to
> CUPS' configure, so I would need to reconfigure CUPS if anything of
> PYTHON || PYTHON3 || PYTHON3_SYMLINK changes. Is there a way to ensure
> this? Same for PHP5_CGI || PHP5_CLI.

If really works with both, then I'd say, make it a choice (2/3/no) and
/usr/bin/python{2,3} explicitly.

Michael

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH v3 5/7] cups: new package: Common Unix Printing System

2017-10-31 Thread Roland Hieber
On 27.10.2017 19:54, Michael Olbrich wrote:
> On Wed, Oct 25, 2017 at 10:57:49PM +0200, Roland Hieber wrote:
>> diff --git a/rules/cups.in b/rules/cups.in
>> new file mode 100644
>> index 0..13b7142d6
>> --- /dev/null
>> +++ b/rules/cups.in
>> @@ -0,0 +1,113 @@
>> +## SECTION=applications
>> +
>> +menuconfig CUPS
>> +tristate
>> +prompt "cups  "
>> +
>> +select ROOTFS_VAR_LOG
>> +select ROOTFS_VAR_RUN
>> +select LIBC_M
>> +select LIBC_CRYPT
>> +select ZLIB
>> +
>> +select LIBC_PTHREAD if CUPS_THREADING
>> +select SYSTEMD  if CUPS_SYSTEMD_UNIT
>> +select LIBPAPER if CUPS_LIBPAPER
>> +select LIBUSB   if CUPS_LIBUSB
>> +select DBUS if CUPS_DBUS
>> +select GNUTLS   if CUPS_SSL
>> +select AVAHIif CUPS_AVAHI
>> +select AVAHI_LIBAVAHI_CLIENTif CUPS_AVAHI
>> +select ORACLE_JAVA7_JRE if CUPS_JAVA
> 
> This is not good. ORACLE_JAVA7_JRE is the x86-only binary packages.
> Just add a comment to the help text, that some java is needed.
> 
>> +select PERL if CUPS_PERL
>> +select PHP5 if CUPS_PHP
>> +select PYTHON   if CUPS_PYTHON
> 
> Is python2 the only option or could python3 be used as well?

Python 3 is possible. But I have to pass the path to the executable to
CUPS' configure, so I would need to reconfigure CUPS if anything of
PYTHON || PYTHON3 || PYTHON3_SYMLINK changes. Is there a way to ensure
this? Same for PHP5_CGI || PHP5_CLI.

> Also, for all of these: There is no build-time dependency, right? So this
> should be 'if CUPS_??? && RUNTIME'.

Yes. Thanks for the hint.

 - Roland

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH v3 5/7] cups: new package: Common Unix Printing System

2017-10-31 Thread Roland Hieber
On 28.10.2017 11:54, Michael Olbrich wrote:
> On Wed, Oct 25, 2017 at 10:57:49PM +0200, Roland Hieber wrote:
[...]
>>
>> Notes:
>> changes in v2 -> v3:
>>  - version bump 2.2.4 -> 2.2.5
[...]
>>
>> diff --git 
>> a/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
>>  
>> b/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
>> new file mode 100644
>> index 0..f110f5aaa
>> --- /dev/null
>> +++ 
>> b/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
>> @@ -0,0 +1,92 @@
>> +From: Roland Hieber 
>> +Date: Mon, 25 Sep 2017 15:00:16 +0200
>> +Subject: [PATCH] configure: allow explicit disabling of Java/PHP/Perl/Python
>> + support
>> +
>> +Currently, when configure is called with --with-java or --with-java=,
>> +auto-detection is performed. When called with --without-java, HAVE_JAVA
>> +is still being defined. This is unfortunate when cross-compiling for
>> +embedded systems, we would end up with Java on the host being
>> +auto-detected (which is not what we have on the target), or with a wrong
>> +HAVE_JAVA define. We need a way to explicitely disable scripting support
>> +for all supported languages.
>> +
>> +Forwarded: https://github.com/apple/cups/pull/5122
> 
> It seems something was done upstream. Can you cherry-pick those commits
> instead. That will simplify updating later on.

Ah, that was a leftover from 2.2.4, which is already (somehow) included
in 2.2.5 and no longer relevant.

 - Roland

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH v3 5/7] cups: new package: Common Unix Printing System

2017-10-28 Thread Michael Olbrich
On Wed, Oct 25, 2017 at 10:57:49PM +0200, Roland Hieber wrote:
> If using systemd, CUPS can be started via socket activation or directly,
> in any case it is run as user daemon, group lp. The default spool and
> cache locations were moved to /tmp/cups so we don't need to set up a
> tmpfs for /var/spool/cups and /var/cache/cups.
> 
> sysvinit script is installed from upstream, but untested.
> 
> Some config files are only created by cupsd on the first start and not
> at install time, so we supply reasonable defaults in projectroot/ in
> order to use $(call install_alternative...) on them.
> 
> Signed-off-by: Roland Hieber 
> ---
> 
> Notes:
> changes in v2 -> v3:
>  - version bump 2.2.4 -> 2.2.5
>  - fix SPDX license identifiers
>  - $(PKGDIR)/$(CUPS) -> $(CUPS_PKGDIR)
>  - with CROSS_AUTOCONF_USR, --exec-prefix and --libdir is not needed
>  - always build multithreaded, remove kconfig option
>  - remove debugging options, can easily be enabled by creating a local
>rules/cups-debug.make
>  - fix install_copy for /etc/cups/ssl (missing permissions)
> 
>  ...llow-explicit-disabling-of-Java-PHP-Perl-.patch |  92 
>  ...-remove-leftover-check-for-empty-CUPS_PHP.patch |  29 +++
>  ...e-make-interpreter-detection-more-verbose.patch |  88 
>  patches/cups-2.2.4/autogen.sh  |   7 +
>  patches/cups-2.2.4/series  |   6 +
>  projectroot/etc/cups/classes.conf  |   1 +
>  projectroot/etc/cups/client.conf   |   2 +
>  projectroot/etc/cups/cups-files.conf   |  22 ++
>  projectroot/etc/cups/mailto.conf   |   1 +
>  projectroot/etc/cups/ppd/.createdirectory  |   0
>  projectroot/etc/cups/printers.conf |   1 +
>  projectroot/etc/cups/ssl/.createdirectory  |   0
>  projectroot/etc/printcap   |   3 +
>  projectroot/usr/lib/systemd/system/cups.service|  15 ++
>  projectroot/usr/lib/systemd/system/cups.socket |  14 ++
>  projectroot/usr/lib/tmpfiles.d/cups.conf   |   6 +
>  rules/cups-bbinit.in   |   8 +
>  rules/cups.in  | 113 ++
>  rules/cups.make| 238 
> +
>  19 files changed, 646 insertions(+)
>  create mode 100644 
> patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
>  create mode 100644 
> patches/cups-2.2.4/0002-configure-remove-leftover-check-for-empty-CUPS_PHP.patch
>  create mode 100644 
> patches/cups-2.2.4/0003-configure-make-interpreter-detection-more-verbose.patch
>  create mode 100755 patches/cups-2.2.4/autogen.sh
>  create mode 100644 patches/cups-2.2.4/series
>  create mode 100644 projectroot/etc/cups/classes.conf
>  create mode 100644 projectroot/etc/cups/client.conf
>  create mode 100644 projectroot/etc/cups/cups-files.conf
>  create mode 100644 projectroot/etc/cups/mailto.conf
>  create mode 100644 projectroot/etc/cups/ppd/.createdirectory
>  create mode 100644 projectroot/etc/cups/printers.conf
>  create mode 100644 projectroot/etc/cups/ssl/.createdirectory
>  create mode 100644 projectroot/etc/printcap
>  create mode 100644 projectroot/usr/lib/systemd/system/cups.service
>  create mode 100644 projectroot/usr/lib/systemd/system/cups.socket
>  create mode 100644 projectroot/usr/lib/tmpfiles.d/cups.conf
>  create mode 100644 rules/cups-bbinit.in
>  create mode 100644 rules/cups.in
>  create mode 100644 rules/cups.make
> 
> diff --git 
> a/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
>  
> b/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
> new file mode 100644
> index 0..f110f5aaa
> --- /dev/null
> +++ 
> b/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
> @@ -0,0 +1,92 @@
> +From: Roland Hieber 
> +Date: Mon, 25 Sep 2017 15:00:16 +0200
> +Subject: [PATCH] configure: allow explicit disabling of Java/PHP/Perl/Python
> + support
> +
> +Currently, when configure is called with --with-java or --with-java=,
> +auto-detection is performed. When called with --without-java, HAVE_JAVA
> +is still being defined. This is unfortunate when cross-compiling for
> +embedded systems, we would end up with Java on the host being
> +auto-detected (which is not what we have on the target), or with a wrong
> +HAVE_JAVA define. We need a way to explicitely disable scripting support
> +for all supported languages.
> +
> +Forwarded: https://github.com/apple/cups/pull/5122

It seems something was done upstream. Can you cherry-pick those commits
instead. That will simplify updating later on.

Michael

> +Signed-off-by: Roland Hieber 
> +---
> + config-scripts/cups-scripting.m4 | 24 
> + 1 file changed, 16 insertions(+), 8 deletions(-)
> +

Re: [ptxdist] [PATCH v3 5/7] cups: new package: Common Unix Printing System

2017-10-27 Thread Michael Olbrich
On Wed, Oct 25, 2017 at 10:57:49PM +0200, Roland Hieber wrote:
> If using systemd, CUPS can be started via socket activation or directly,
> in any case it is run as user daemon, group lp. The default spool and
> cache locations were moved to /tmp/cups so we don't need to set up a
> tmpfs for /var/spool/cups and /var/cache/cups.
> 
> sysvinit script is installed from upstream, but untested.
> 
> Some config files are only created by cupsd on the first start and not
> at install time, so we supply reasonable defaults in projectroot/ in
> order to use $(call install_alternative...) on them.
> 
> Signed-off-by: Roland Hieber 
> ---
> 
> Notes:
> changes in v2 -> v3:
>  - version bump 2.2.4 -> 2.2.5
>  - fix SPDX license identifiers
>  - $(PKGDIR)/$(CUPS) -> $(CUPS_PKGDIR)
>  - with CROSS_AUTOCONF_USR, --exec-prefix and --libdir is not needed
>  - always build multithreaded, remove kconfig option
>  - remove debugging options, can easily be enabled by creating a local
>rules/cups-debug.make
>  - fix install_copy for /etc/cups/ssl (missing permissions)
> 
>  ...llow-explicit-disabling-of-Java-PHP-Perl-.patch |  92 
>  ...-remove-leftover-check-for-empty-CUPS_PHP.patch |  29 +++
>  ...e-make-interpreter-detection-more-verbose.patch |  88 
>  patches/cups-2.2.4/autogen.sh  |   7 +
>  patches/cups-2.2.4/series  |   6 +
>  projectroot/etc/cups/classes.conf  |   1 +
>  projectroot/etc/cups/client.conf   |   2 +
>  projectroot/etc/cups/cups-files.conf   |  22 ++
>  projectroot/etc/cups/mailto.conf   |   1 +
>  projectroot/etc/cups/ppd/.createdirectory  |   0
>  projectroot/etc/cups/printers.conf |   1 +
>  projectroot/etc/cups/ssl/.createdirectory  |   0
>  projectroot/etc/printcap   |   3 +
>  projectroot/usr/lib/systemd/system/cups.service|  15 ++
>  projectroot/usr/lib/systemd/system/cups.socket |  14 ++
>  projectroot/usr/lib/tmpfiles.d/cups.conf   |   6 +
>  rules/cups-bbinit.in   |   8 +
>  rules/cups.in  | 113 ++
>  rules/cups.make| 238 
> +
>  19 files changed, 646 insertions(+)
>  create mode 100644 
> patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
>  create mode 100644 
> patches/cups-2.2.4/0002-configure-remove-leftover-check-for-empty-CUPS_PHP.patch
>  create mode 100644 
> patches/cups-2.2.4/0003-configure-make-interpreter-detection-more-verbose.patch
>  create mode 100755 patches/cups-2.2.4/autogen.sh
>  create mode 100644 patches/cups-2.2.4/series
>  create mode 100644 projectroot/etc/cups/classes.conf
>  create mode 100644 projectroot/etc/cups/client.conf
>  create mode 100644 projectroot/etc/cups/cups-files.conf
>  create mode 100644 projectroot/etc/cups/mailto.conf
>  create mode 100644 projectroot/etc/cups/ppd/.createdirectory
>  create mode 100644 projectroot/etc/cups/printers.conf
>  create mode 100644 projectroot/etc/cups/ssl/.createdirectory
>  create mode 100644 projectroot/etc/printcap
>  create mode 100644 projectroot/usr/lib/systemd/system/cups.service
>  create mode 100644 projectroot/usr/lib/systemd/system/cups.socket
>  create mode 100644 projectroot/usr/lib/tmpfiles.d/cups.conf
>  create mode 100644 rules/cups-bbinit.in
>  create mode 100644 rules/cups.in
>  create mode 100644 rules/cups.make
> 
> diff --git 
> a/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
>  
> b/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
> new file mode 100644
> index 0..f110f5aaa
> --- /dev/null
> +++ 
> b/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
> @@ -0,0 +1,92 @@
> +From: Roland Hieber 
> +Date: Mon, 25 Sep 2017 15:00:16 +0200
> +Subject: [PATCH] configure: allow explicit disabling of Java/PHP/Perl/Python
> + support
> +
> +Currently, when configure is called with --with-java or --with-java=,
> +auto-detection is performed. When called with --without-java, HAVE_JAVA
> +is still being defined. This is unfortunate when cross-compiling for
> +embedded systems, we would end up with Java on the host being
> +auto-detected (which is not what we have on the target), or with a wrong
> +HAVE_JAVA define. We need a way to explicitely disable scripting support
> +for all supported languages.
> +
> +Forwarded: https://github.com/apple/cups/pull/5122
> +Signed-off-by: Roland Hieber 
> +---
> + config-scripts/cups-scripting.m4 | 24 
> + 1 file changed, 16 insertions(+), 8 deletions(-)
> +
> +diff --git a/config-scripts/cups-scripting.m4 
> b/config-scripts/cups-scripting.m4
> +index bff3e9a0505c..137c3be72cb0 100644

[ptxdist] [PATCH v3 5/7] cups: new package: Common Unix Printing System

2017-10-25 Thread Roland Hieber
If using systemd, CUPS can be started via socket activation or directly,
in any case it is run as user daemon, group lp. The default spool and
cache locations were moved to /tmp/cups so we don't need to set up a
tmpfs for /var/spool/cups and /var/cache/cups.

sysvinit script is installed from upstream, but untested.

Some config files are only created by cupsd on the first start and not
at install time, so we supply reasonable defaults in projectroot/ in
order to use $(call install_alternative...) on them.

Signed-off-by: Roland Hieber 
---

Notes:
changes in v2 -> v3:
 - version bump 2.2.4 -> 2.2.5
 - fix SPDX license identifiers
 - $(PKGDIR)/$(CUPS) -> $(CUPS_PKGDIR)
 - with CROSS_AUTOCONF_USR, --exec-prefix and --libdir is not needed
 - always build multithreaded, remove kconfig option
 - remove debugging options, can easily be enabled by creating a local
   rules/cups-debug.make
 - fix install_copy for /etc/cups/ssl (missing permissions)

 ...llow-explicit-disabling-of-Java-PHP-Perl-.patch |  92 
 ...-remove-leftover-check-for-empty-CUPS_PHP.patch |  29 +++
 ...e-make-interpreter-detection-more-verbose.patch |  88 
 patches/cups-2.2.4/autogen.sh  |   7 +
 patches/cups-2.2.4/series  |   6 +
 projectroot/etc/cups/classes.conf  |   1 +
 projectroot/etc/cups/client.conf   |   2 +
 projectroot/etc/cups/cups-files.conf   |  22 ++
 projectroot/etc/cups/mailto.conf   |   1 +
 projectroot/etc/cups/ppd/.createdirectory  |   0
 projectroot/etc/cups/printers.conf |   1 +
 projectroot/etc/cups/ssl/.createdirectory  |   0
 projectroot/etc/printcap   |   3 +
 projectroot/usr/lib/systemd/system/cups.service|  15 ++
 projectroot/usr/lib/systemd/system/cups.socket |  14 ++
 projectroot/usr/lib/tmpfiles.d/cups.conf   |   6 +
 rules/cups-bbinit.in   |   8 +
 rules/cups.in  | 113 ++
 rules/cups.make| 238 +
 19 files changed, 646 insertions(+)
 create mode 100644 
patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
 create mode 100644 
patches/cups-2.2.4/0002-configure-remove-leftover-check-for-empty-CUPS_PHP.patch
 create mode 100644 
patches/cups-2.2.4/0003-configure-make-interpreter-detection-more-verbose.patch
 create mode 100755 patches/cups-2.2.4/autogen.sh
 create mode 100644 patches/cups-2.2.4/series
 create mode 100644 projectroot/etc/cups/classes.conf
 create mode 100644 projectroot/etc/cups/client.conf
 create mode 100644 projectroot/etc/cups/cups-files.conf
 create mode 100644 projectroot/etc/cups/mailto.conf
 create mode 100644 projectroot/etc/cups/ppd/.createdirectory
 create mode 100644 projectroot/etc/cups/printers.conf
 create mode 100644 projectroot/etc/cups/ssl/.createdirectory
 create mode 100644 projectroot/etc/printcap
 create mode 100644 projectroot/usr/lib/systemd/system/cups.service
 create mode 100644 projectroot/usr/lib/systemd/system/cups.socket
 create mode 100644 projectroot/usr/lib/tmpfiles.d/cups.conf
 create mode 100644 rules/cups-bbinit.in
 create mode 100644 rules/cups.in
 create mode 100644 rules/cups.make

diff --git 
a/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
 
b/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
new file mode 100644
index 0..f110f5aaa
--- /dev/null
+++ 
b/patches/cups-2.2.4/0001-configure-allow-explicit-disabling-of-Java-PHP-Perl-.patch
@@ -0,0 +1,92 @@
+From: Roland Hieber 
+Date: Mon, 25 Sep 2017 15:00:16 +0200
+Subject: [PATCH] configure: allow explicit disabling of Java/PHP/Perl/Python
+ support
+
+Currently, when configure is called with --with-java or --with-java=,
+auto-detection is performed. When called with --without-java, HAVE_JAVA
+is still being defined. This is unfortunate when cross-compiling for
+embedded systems, we would end up with Java on the host being
+auto-detected (which is not what we have on the target), or with a wrong
+HAVE_JAVA define. We need a way to explicitely disable scripting support
+for all supported languages.
+
+Forwarded: https://github.com/apple/cups/pull/5122
+Signed-off-by: Roland Hieber 
+---
+ config-scripts/cups-scripting.m4 | 24 
+ 1 file changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/config-scripts/cups-scripting.m4 
b/config-scripts/cups-scripting.m4
+index bff3e9a0505c..137c3be72cb0 100644
+--- a/config-scripts/cups-scripting.m4
 b/config-scripts/cups-scripting.m4
+@@ -14,11 +14,13 @@ dnl
+ dnl Do we have Java?
+ AC_ARG_WITH(java, [  --with-java set Java interpreter for web 
interfaces ],
+   CUPS_JAVA="$withval",
+-