Imported Upstream version 2.4.3
[platform/upstream/audit.git] / init.d / Makefile.am
1 # Makefile.am--
2 # Copyright 2004-07,2012-13 Red Hat Inc., Durham, North Carolina.
3 # All Rights Reserved.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 #
19 # Authors:
20 #   Steve Grubb <sgrubb@redhat.com>
21 #
22
23 CONFIG_CLEAN_FILES = *.rej *.orig
24 EXTRA_DIST = auditd.init auditd.service auditd.sysconfig auditd.conf \
25         audit.rules auditd.cron libaudit.conf audispd.conf auditd.condrestart \
26         auditd.restart auditd.resume auditd.rotate auditd.stop augenrules
27 libconfig = libaudit.conf
28 dispconfig = audispd.conf
29 dispconfigdir = $(sysconfdir)/audisp
30 if ENABLE_SYSTEMD
31 initdir = /usr/lib/systemd/system
32 legacydir = $(libexecdir)/initscripts/legacy-actions/auditd
33 else
34 initdir = $(sysconfdir)/rc.d/init.d
35 sysconfigdir = $(sysconfdir)/sysconfig
36 endif
37
38 auditdir = $(sysconfdir)/audit
39 auditrdir = $(auditdir)/rules.d
40 dist_audit_DATA = auditd.conf
41 dist_auditr_DATA = audit.rules
42 sbin_SCRIPTS = augenrules
43
44 install-data-hook:
45         $(INSTALL_DATA) -D -m 640 ${srcdir}/${dispconfig} ${DESTDIR}${dispconfigdir}
46         $(INSTALL_DATA) -D -m 640 ${srcdir}/${libconfig} ${DESTDIR}${sysconfdir}
47 if ENABLE_SYSTEMD
48 else
49         $(INSTALL_DATA) -D -m 640 ${srcdir}/auditd.sysconfig ${DESTDIR}${sysconfigdir}/auditd
50 endif
51
52 install-exec-hook:
53 if ENABLE_SYSTEMD
54         mkdir -p ${DESTDIR}${initdir}
55         mkdir -p ${DESTDIR}${legacydir}
56         $(INSTALL_SCRIPT) -D -m 640 ${srcdir}/auditd.service ${DESTDIR}${initdir}
57         $(INSTALL_SCRIPT) -D -m 750 ${srcdir}/auditd.rotate ${DESTDIR}${legacydir}/rotate
58         $(INSTALL_SCRIPT) -D -m 750 ${srcdir}/auditd.resume ${DESTDIR}${legacydir}/resume
59         $(INSTALL_SCRIPT) -D -m 750 ${srcdir}/auditd.stop ${DESTDIR}${legacydir}/stop
60         $(INSTALL_SCRIPT) -D -m 750 ${srcdir}/auditd.restart ${DESTDIR}${legacydir}/restart
61         $(INSTALL_SCRIPT) -D -m 750 ${srcdir}/auditd.condrestart ${DESTDIR}${legacydir}/condrestart
62 else
63         $(INSTALL_SCRIPT) -D ${srcdir}/auditd.init ${DESTDIR}${initdir}/auditd
64 endif
65         chmod 0750 $(DESTDIR)$(sbindir)/augenrules
66
67
68 uninstall-hook:
69         rm ${DESTDIR}${dispconfigdir}/${dispconfig}
70         rm ${DESTDIR}${sysconfdir}/${libconfig}
71 if ENABLE_SYSTEMD
72         rm ${DESTDIR}${initdir}/auditd.service
73         rm ${DESTDIR}${legacydir}/rotate
74         rm ${DESTDIR}${legacydir}/resume
75         rm ${DESTDIR}${legacydir}/stop
76         rm ${DESTDIR}${legacydir}/restart
77         rm ${DESTDIR}${legacydir}/condrestart
78 else
79         rm ${DESTDIR}${sysconfigdir}/auditd
80         rm ${DESTDIR}${initdir}/auditd
81 endif
82