Skip to content

Commit b959712

Browse files
authored
Add configure options for several PAPPL options (#22)
PAPPL provides several options to set with its server subcommand - this PR implements configure options for several of them providing flexibility for maintainers.
1 parent aaa60b7 commit b959712

File tree

3 files changed

+86
-11
lines changed

3 files changed

+86
-11
lines changed

configure.ac

+76-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ AM_ICONV
5757
AC_PROG_INSTALL
5858
AC_PROG_LN_S
5959
AC_PROG_MAKE_SET
60-
AC_PROG_LIBTOOL
60+
LT_INIT
6161

6262
# ==========
6363
# pkg-config
@@ -264,10 +264,81 @@ AS_IF([test "x$enable_pappl_backends_for_legacy_printer_app" != "xno"], [
264264
AC_DEFINE(ENABLE_PAPPL_BACKENDS, 1, [Build legacy-printer-app with PAPPL backend support])
265265
])
266266

267+
# ===========
268+
# Admin group
269+
# ===========
270+
AC_ARG_WITH([admin_group], AS_HELP_STRING([--with-admin-group=[GROUP]], [Set group which users are authenticated for remote configuration, default=none]), [
271+
AS_IF([test $withval != yes -a $withval != no], [
272+
ADMINGROUP=$withval
273+
], [
274+
ADMINGROUP="none"
275+
])
276+
], [
277+
ADMINGROUP="none"
278+
])
279+
AC_SUBST([ADMINGROUP])
280+
281+
# =============================
282+
# PAM module for authentication
283+
# =============================
284+
AC_ARG_WITH([auth_service], AS_HELP_STRING([--with-auth-service=[SERVICE]], [Set PAM service to use for remote request authentication, default=none]), [
285+
AS_IF([test $withval != yes -a $withval != no], [
286+
AUTHSERV=$withval
287+
], [
288+
AUTHSERV="none"
289+
])
290+
], [
291+
AUTHSERV="none"
292+
])
293+
AC_SUBST([AUTHSERV])
294+
295+
# =======================================
296+
# Listening on specified address/hostname
297+
# =======================================
298+
AC_ARG_WITH([listen_hostname], AS_HELP_STRING([--with-listen-hostname=[HOSTNAME]], [Set address/hostname where listen for connection, default=local IPv4 and IPv6 addresses]), [
299+
AS_IF([test $withval != yes -a $withval != no], [
300+
LISTENHOST="-o listen-hostname=$withval "
301+
], [
302+
LISTENHOST=""
303+
])
304+
], [
305+
LISTENHOST=""
306+
])
307+
AC_SUBST([LISTENHOST])
308+
309+
# ============
310+
# Log location
311+
# ============
312+
AC_ARG_WITH([log_file], AS_HELP_STRING([--with-log-file=[LOCATION]], [Set location for logs: - (stderr), syslog (syslog service), FILENAME, default=-]), [
313+
AS_IF([test $withval != yes -a $withval != no], [
314+
LOGFILE="$withval"
315+
], [
316+
LOGFILE="-"
317+
])
318+
], [
319+
LOGFILE="-"
320+
])
321+
AC_SUBST([LOGFILE])
322+
323+
# ==============
324+
# Server options
325+
# ==============
326+
AC_ARG_WITH([server_options], AS_HELP_STRING([--with-server-options=[SOPTIONS]], [Set default server options, default=multi-queue,web-interface]), [
327+
AS_IF([test $withval != yes -a $withval != no], [
328+
SOPTIONS="$withval"
329+
], [
330+
SOPTIONS="multi-queue,web-interface"
331+
])
332+
], [
333+
SOPTIONS="multi-queue,web-interface"
334+
])
335+
AC_SUBST([SOPTIONS])
336+
267337
# =====================
268338
# Prepare all .in files
269339
# =====================
270340
AC_CONFIG_FILES([
341+
legacy/legacy-printer-app.service
271342
libpappl-retrofit.pc
272343
Makefile
273344
])
@@ -287,5 +358,9 @@ Build configuration:
287358
legacy-printer-app as daemon: ${enable_legacy_printer_app_as_daemon}
288359
legacy-printer-app w/ PAPPL backends: ${enable_pappl_backends_for_legacy_printer_app}
289360
systemd unitdir: ${SYSTEMD_UNITDIR}
361+
log file: ${LOGFILE}
362+
server options: ${SOPTIONS}
363+
auth service: ${AUTHSERV}
364+
admin group: ${ADMINGROUP}
290365
==============================================================================
291366
])

legacy/legacy-printer-app.service

-10
This file was deleted.

legacy/legacy-printer-app.service.in

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Unit]
2+
Description=Legacy Printer Application
3+
4+
[Service]
5+
ExecStart=legacy-printer-app server -o admin-group=@ADMINGROUP@ -o auth-service=@AUTHSERV@ @LISTENHOST@-o log-file=@LOGFILE@ -o log-level=info -o server-options=@SOPTIONS@
6+
ExecStop=legacy-printer-app shutdown
7+
Type=simple
8+
9+
[Install]
10+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)