-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile.am
46 lines (40 loc) · 1.7 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
bin_PROGRAMS = nqptp
nqptp_SOURCES = nqptp.c nqptp-clock-sources.c nqptp-message-handlers.c nqptp-utilities.c general-utilities.c debug.c
AM_CFLAGS = -fno-common -Wall -Wextra -pthread --include=config.h
CLEANFILES =
if USE_GIT_VERSION
nqptp.c: gitversion.h
gitversion.h: .git/index
echo "// Do not edit!" > gitversion.h
echo "// This file is automatically generated by 'git describe --tags --dirty --broken', if available." >> gitversion.h
echo -n " char git_version_string[] = \"" >> gitversion.h
git describe --tags --dirty --broken | tr -d '[[:space:]]' >> gitversion.h
echo "\";" >> gitversion.h
FORCE: ;
CLEANFILES += gitversion.h
endif
install-exec-hook:
if BUILD_FOR_LINUX
# Note: NQPTP runs as user/group nqptp/nqptp on Linux.
# Access is given via AmbientCapabilities in the service file.
# If you want to run it from the command line, e.g. for debugging, run it as root user.
# no installer for System V
if INSTALL_SYSTEMD_STARTUP
getent group nqptp &>/dev/null || groupadd -r nqptp &>/dev/null
getent passwd nqptp &> /dev/null || useradd -r -M -g nqptp -s /usr/sbin/nologin nqptp &>/dev/null
[ -e $(DESTDIR)$(libdir)/systemd/system ] || mkdir -p $(DESTDIR)$(libdir)/systemd/system
# don't replace a service file if it already exists...
[ -e $(DESTDIR)$(libdir)/systemd/system/nqptp.service ] || cp nqptp.service $(DESTDIR)$(libdir)/systemd/system
endif
endif
if BUILD_FOR_FREEBSD
# NQPTP runs as root on FreeBSD to access ports 319 and 320
if INSTALL_FREEBSD_STARTUP
cp nqptp.freebsd /usr/local/etc/rc.d/nqptp
chmod 555 /usr/local/etc/rc.d/nqptp
endif
endif
if BUILD_FOR_OPENBSD
# NQPTP starts as root on OpenBSD to access ports 319 and 320
# and drops privileges to the user shairport is running as.
endif