scripts: Use automake instead of installing files manually.

This commit is contained in:
tgoff0 2015-05-26 17:34:22 +00:00
parent d9c54b9d43
commit 70808bf7c2
2 changed files with 21 additions and 22 deletions

1
scripts/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
core-daemon

View file

@ -7,6 +7,8 @@
# Makefile for installing scripts. # Makefile for installing scripts.
# #
CLEANFILES = core-daemon
DISTCLEANFILES = Makefile.in xen/Makefile xen/Makefile.in DISTCLEANFILES = Makefile.in xen/Makefile xen/Makefile.in
EXTRA_DIST = core-daemon-init.d \ EXTRA_DIST = core-daemon-init.d \
@ -21,41 +23,37 @@ SUBDIRS = perf
dist-hook: dist-hook:
rm -rf $(distdir)/xen/.svn rm -rf $(distdir)/xen/.svn
# install startup scripts based on --with-startup=option configure option # install startup scripts based on --with-startup=option configure option
# FreeBSD, init.d (default), systemd, SUSE # FreeBSD, init.d (default), systemd, SUSE
if WANT_BSD if WANT_BSD
install-exec-hook: startupdir = $(DESTDIR)/usr/local/etc/rc.d
test -d "$(DESTDIR)/usr/local/etc/rc.d" || \ startup_SCRIPTS = core-daemon
mkdir -p $(DESTDIR)/usr/local/etc/rc.d
test -d "$(DESTDIR)/usr/local/etc/rc.d" && \ core-daemon: core-daemon-rc.d
cp -f core-daemon-rc.d $(DESTDIR)/usr/local/etc/rc.d/core-daemon cp $< $@
else else
if WANT_INITD if WANT_INITD
install-exec-hook: startupdir = $(DESTDIR)/etc/init.d
test -d "$(DESTDIR)/etc/init.d" || \ startup_SCRIPTS = core-daemon
mkdir -p $(DESTDIR)/etc/init.d
test -d "$(DESTDIR)/etc/init.d" && \ core-daemon: core-daemon-init.d
cp -f core-daemon-init.d $(DESTDIR)/etc/init.d/core-daemon cp $< $@
endif endif
if WANT_SYSTEMD if WANT_SYSTEMD
install-exec-hook: startupdir = $(DESTDIR)/etc/systemd/system
test -d "$(DESTDIR)/etc/systemd/system" || \ startup_SCRIPTS = core-daemon.service
mkdir -p $(DESTDIR)/etc/systemd/system
test -d "$(DESTDIR)/etc/systemd/system" && \
cp -f core-daemon.service $(DESTDIR)/etc/systemd/system/
endif endif
if WANT_SUSE if WANT_SUSE
install-exec-hook: startupdir = $(DESTDIR)/etc/init.d
test -d "$(DESTDIR)/etc/init.d" || \ startup_SCRIPTS = core-daemon
mkdir -p $(DESTDIR)/etc/init.d
test -d "$(DESTDIR)/etc/init.d" && \ core-daemon: core-daemon-init.d-SUSE
cp -f core-daemon-init.d-SUSE $(DESTDIR)/etc/init.d/core-daemon cp $< $@
endif endif
# endif FreeBSD # endif FreeBSD
endif endif
# remove extra scripts and their directories if they are empty # remove extra scripts and their directories if they are empty
uninstall-hook: uninstall-hook:
rm -f /etc/init.d/core-daemon /usr/local/etc/rc.d/core-daemon rmdir -p $(startupdir) || true