github.com/hugh712/snapd@v0.0.0-20200910133618-1a99902bd583/data/dbus/Makefile (about)

     1  #
     2  # Copyright (C) 2017 Canonical Ltd
     3  #
     4  # This program is free software: you can redistribute it and/or modify
     5  # it under the terms of the GNU General Public License version 3 as
     6  # published by the Free Software Foundation.
     7  #
     8  # This program is distributed in the hope that it will be useful,
     9  # but WITHOUT ANY WARRANTY; without even the implied warranty of
    10  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    11  # GNU General Public License for more details.
    12  #
    13  # You should have received a copy of the GNU General Public License
    14  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
    15  
    16  BINDIR := /usr/bin
    17  DBUSDIR = /usr/share/dbus-1
    18  DBUSSERVICESDIR := ${DBUSDIR}/services
    19  
    20  SERVICES_GENERATED := $(patsubst %.service.in,%.service,$(wildcard *.service.in))
    21  SERVICES := ${SERVICES_GENERATED}
    22  
    23  %.service: %.service.in
    24  	cat $< | sed 's:@bindir@:${BINDIR}:g' | cat > $@
    25  
    26  all: ${SERVICES}
    27  
    28  install:: ${SERVICES}
    29  	# NOTE: old (e.g. 14.04) GNU coreutils doesn't -D with -t
    30  	install -d -m 0755 ${DESTDIR}/${DBUSSERVICESDIR}
    31  	install -m 0644 -t ${DESTDIR}/${DBUSSERVICESDIR} $^
    32  
    33  install:: snapd.session-services.conf
    34  	install -d -m 0755 ${DESTDIR}/${DBUSDIR}/session.d
    35  	install -m 0644 -t ${DESTDIR}/${DBUSDIR}/session.d $^
    36  
    37  install:: snapd.system-services.conf
    38  	install -d -m 0755 ${DESTDIR}/${DBUSDIR}/system.d
    39  	install -m 0644 -t ${DESTDIR}/${DBUSDIR}/system.d $^
    40  
    41  clean:
    42  	rm -f ${SERVICES_GENERATED}