[Asterisk-code-review] Makefile: remove OSARCH check for init install (asterisk[11])
Tzafrir Cohen
asteriskteam at digium.com
Sat May 21 15:05:51 CDT 2016
Tzafrir Cohen has uploaded a new change for review.
https://gerrit.asterisk.org/2895
Change subject: Makefile: remove OSARCH check for init install
......................................................................
Makefile: remove OSARCH check for init install
There are more specific checks for the platform.
Specifically this allows installing OS/X init scripts.
ASTERISK-26038 #close
Change-Id: If08933621145b10362a0cfe73c079301d9c13f50
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
---
M Makefile
1 file changed, 65 insertions(+), 69 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/95/2895/1
diff --git a/Makefile b/Makefile
index efa9978..5b1b41b 100644
--- a/Makefile
+++ b/Makefile
@@ -782,76 +782,72 @@
rm -f contrib/scripts/asterisk.logrotate.tmp
config:
- @if [ "${OSARCH}" = "linux-gnu" -o "${OSARCH}" = "kfreebsd-gnu" ]; then \
- if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
- cat contrib/init.d/rc.redhat.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
- $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/rc.d/init.d/asterisk" ; \
- rm -f contrib/init.d/rc.asterisk.tmp ; \
- if [ ! -f "$(DESTDIR)/etc/sysconfig/asterisk" ] ; then \
- $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
- fi ; \
- if [ -z "$(DESTDIR)" ] ; then \
- /sbin/chkconfig --add asterisk ; \
- fi ; \
- elif [ -f /etc/debian_version ] ; then \
- cat contrib/init.d/rc.debian.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
- $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/init.d/asterisk" ; \
- rm -f contrib/init.d/rc.asterisk.tmp ; \
- if [ ! -f "$(DESTDIR)/etc/default/asterisk" ] ; then \
- $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/default/asterisk" ; \
- fi ; \
- if [ -z "$(DESTDIR)" ] ; then \
- /usr/sbin/update-rc.d asterisk defaults 50 91 ; \
- fi ; \
- elif [ -f /etc/gentoo-release ] ; then \
- cat contrib/init.d/rc.gentoo.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
- $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/init.d/asterisk" ; \
- rm -f contrib/init.d/rc.asterisk.tmp ; \
- if [ -z "$(DESTDIR)" ] ; then \
- /sbin/rc-update add asterisk default ; \
- fi ; \
- elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ] ; then \
- cat contrib/init.d/rc.mandriva.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
- $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/rc.d/init.d/asterisk" ; \
- rm -f contrib/init.d/rc.asterisk.tmp ; \
- if [ ! -f /etc/sysconfig/asterisk ] ; then \
- $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
- fi ; \
- if [ -z "$(DESTDIR)" ] ; then \
- /sbin/chkconfig --add asterisk ; \
- fi ; \
- elif [ -f /etc/SuSE-release -o -f /etc/novell-release ] ; then \
- cat contrib/init.d/rc.suse.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
- $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/init.d/asterisk" ;\
- rm -f contrib/init.d/rc.asterisk.tmp ; \
- if [ ! -f /etc/sysconfig/asterisk ] ; then \
- $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
- fi ; \
- if [ -z "$(DESTDIR)" ] ; then \
- /sbin/chkconfig --add asterisk ; \
- fi ; \
- elif [ -f /etc/arch-release -o -f /etc/arch-release ] ; then \
- cat contrib/init.d/rc.archlinux.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
- $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/rc.d/asterisk" ; \
- rm -f contrib/init.d/rc.asterisk.tmp ; \
- elif [ -d "$(DESTDIR)/Library/LaunchDaemons" ]; then \
- if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist" ]; then \
- sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' < contrib/init.d/org.asterisk.asterisk.plist > asterisk.plist ; \
- $(INSTALL) -m 644 asterisk.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist"; \
- rm -f asterisk.plist; \
- fi; \
- if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist" ]; then \
- sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' < contrib/init.d/org.asterisk.muted.plist > muted.plist ; \
- $(INSTALL) -m 644 muted.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist"; \
- rm -f muted.plist; \
- fi; \
- elif [ -f /etc/slackware-version ]; then \
- echo "Slackware is not currently supported, although an init script does exist for it."; \
- else \
- echo "We could not install init scripts for your distribution." ; \
- fi \
+ if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
+ cat contrib/init.d/rc.redhat.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
+ $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/rc.d/init.d/asterisk" ; \
+ rm -f contrib/init.d/rc.asterisk.tmp ; \
+ if [ ! -f "$(DESTDIR)/etc/sysconfig/asterisk" ] ; then \
+ $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
+ fi ; \
+ if [ -z "$(DESTDIR)" ] ; then \
+ /sbin/chkconfig --add asterisk ; \
+ fi ; \
+ elif [ -f /etc/debian_version ] ; then \
+ cat contrib/init.d/rc.debian.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
+ $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/init.d/asterisk" ; \
+ rm -f contrib/init.d/rc.asterisk.tmp ; \
+ if [ ! -f "$(DESTDIR)/etc/default/asterisk" ] ; then \
+ $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/default/asterisk" ; \
+ fi ; \
+ if [ -z "$(DESTDIR)" ] ; then \
+ /usr/sbin/update-rc.d asterisk defaults 50 91 ; \
+ fi ; \
+ elif [ -f /etc/gentoo-release ] ; then \
+ cat contrib/init.d/rc.gentoo.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
+ $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/init.d/asterisk" ; \
+ rm -f contrib/init.d/rc.asterisk.tmp ; \
+ if [ -z "$(DESTDIR)" ] ; then \
+ /sbin/rc-update add asterisk default ; \
+ fi ; \
+ elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ] ; then \
+ cat contrib/init.d/rc.mandriva.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
+ $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/rc.d/init.d/asterisk" ; \
+ rm -f contrib/init.d/rc.asterisk.tmp ; \
+ if [ ! -f /etc/sysconfig/asterisk ] ; then \
+ $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
+ fi ; \
+ if [ -z "$(DESTDIR)" ] ; then \
+ /sbin/chkconfig --add asterisk ; \
+ fi ; \
+ elif [ -f /etc/SuSE-release -o -f /etc/novell-release ] ; then \
+ cat contrib/init.d/rc.suse.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
+ $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/init.d/asterisk" ;\
+ rm -f contrib/init.d/rc.asterisk.tmp ; \
+ if [ ! -f /etc/sysconfig/asterisk ] ; then \
+ $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
+ fi ; \
+ if [ -z "$(DESTDIR)" ] ; then \
+ /sbin/chkconfig --add asterisk ; \
+ fi ; \
+ elif [ -f /etc/arch-release -o -f /etc/arch-release ] ; then \
+ cat contrib/init.d/rc.archlinux.asterisk | sed 's|__ASTERISK_ETC_DIR__|$(ASTETCDIR)|;s|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/init.d/rc.asterisk.tmp ; \
+ $(INSTALL) -m 755 contrib/init.d/rc.asterisk.tmp "$(DESTDIR)/etc/rc.d/asterisk" ; \
+ rm -f contrib/init.d/rc.asterisk.tmp ; \
+ elif [ -d "$(DESTDIR)/Library/LaunchDaemons" ]; then \
+ if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist" ]; then \
+ sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' < contrib/init.d/org.asterisk.asterisk.plist > asterisk.plist ; \
+ $(INSTALL) -m 644 asterisk.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist"; \
+ rm -f asterisk.plist; \
+ fi; \
+ if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist" ]; then \
+ sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' < contrib/init.d/org.asterisk.muted.plist > muted.plist ; \
+ $(INSTALL) -m 644 muted.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist"; \
+ rm -f muted.plist; \
+ fi; \
+ elif [ -f /etc/slackware-version ]; then \
+ echo "Slackware is not currently supported, although an init script does exist for it."; \
else \
- echo "We could not install init scripts for your operating system." ; \
+ echo "We could not install init scripts for your distribution." ; \
fi
sounds:
--
To view, visit https://gerrit.asterisk.org/2895
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If08933621145b10362a0cfe73c079301d9c13f50
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
More information about the asterisk-code-review
mailing list