2008-01-07 15:09:44 +05:30
|
|
|
PROG= rc
|
2008-03-16 22:30:56 +05:30
|
|
|
SRCS= checkpath.c fstabinfo.c mountinfo.c start-stop-daemon.c \
|
2008-01-14 19:54:20 +05:30
|
|
|
rc-applets.c rc-depend.c rc-logger.c \
|
2008-03-21 14:40:59 +05:30
|
|
|
rc-misc.c rc-plugin.c rc-service.c rc-status.c rc-update.c \
|
2009-10-13 12:33:45 +05:30
|
|
|
runscript.c rc.c swclock.c
|
2008-01-06 02:19:48 +05:30
|
|
|
|
2008-01-07 15:09:44 +05:30
|
|
|
CLEANFILES= version.h
|
2008-01-06 02:19:48 +05:30
|
|
|
|
2008-02-28 16:38:49 +05:30
|
|
|
BINDIR= ${PREFIX}/bin
|
|
|
|
SBINDIR= ${PREFIX}/sbin
|
2009-05-24 01:08:12 +05:30
|
|
|
LINKDIR= ${LIBEXECDIR}
|
2008-01-06 02:19:48 +05:30
|
|
|
|
2008-01-07 15:09:44 +05:30
|
|
|
BINLINKS= rc-status
|
2008-03-19 22:41:50 +05:30
|
|
|
SBINLINKS= rc-service rc-update runscript start-stop-daemon
|
2008-01-06 02:19:48 +05:30
|
|
|
RC_BINLINKS= einfon einfo ewarnn ewarn eerrorn eerror ebegin eend ewend \
|
2008-06-03 17:27:15 +05:30
|
|
|
eindent eoutdent esyslog eval_ecolors ewaitfile \
|
2008-01-07 15:09:44 +05:30
|
|
|
veinfo vewarn vebegin veend vewend veindent veoutdent \
|
|
|
|
service_starting service_started \
|
|
|
|
service_stopping service_stopped \
|
|
|
|
service_inactive service_wasinactive \
|
2009-04-18 05:39:03 +05:30
|
|
|
service_hotplugged service_started_daemon service_crashed \
|
2008-01-07 15:09:44 +05:30
|
|
|
checkpath fstabinfo mountinfo rc-depend \
|
|
|
|
service_get_value service_set_value get_options save_options \
|
2008-01-14 13:42:37 +05:30
|
|
|
shell_var is_newer_than is_older_than
|
2008-01-06 02:19:48 +05:30
|
|
|
RC_SBINLINKS= mark_service_starting mark_service_started \
|
2008-01-07 15:09:44 +05:30
|
|
|
mark_service_stopping mark_service_stopped \
|
|
|
|
mark_service_inactive mark_service_wasinactive \
|
2008-10-30 20:29:14 +05:30
|
|
|
mark_service_hotplugged mark_service_failed \
|
2009-10-13 12:33:45 +05:30
|
|
|
rc-abort swclock
|
2008-03-03 18:34:08 +05:30
|
|
|
ALL_LINKS= ${BINLINKS} ${SBINLINKS} ${RC_BINLINKS} ${RC_SBINLINKS}
|
|
|
|
CLEANFILES+= ${ALL_LINKS}
|
2008-01-06 02:19:48 +05:30
|
|
|
|
2008-07-27 17:00:49 +05:30
|
|
|
CPPFLAGS+= -I../includes -I../librc -I../libeinfo
|
2008-02-02 18:30:01 +05:30
|
|
|
LDFLAGS+= -L../librc -L../libeinfo
|
|
|
|
LDADD+= -lutil -lrc -leinfo
|
|
|
|
|
2009-10-08 04:49:18 +05:30
|
|
|
include ../../Makefile.inc
|
2008-01-10 22:05:59 +05:30
|
|
|
MK= ../../mk
|
2008-07-27 17:00:49 +05:30
|
|
|
include ${MK}/debug.mk
|
2008-01-10 22:05:59 +05:30
|
|
|
include ${MK}/prog.mk
|
2009-05-24 01:08:12 +05:30
|
|
|
include ${MK}/git.mk
|
2008-03-19 20:52:20 +05:30
|
|
|
include ${MK}/cc.mk
|
2008-01-30 20:30:58 +05:30
|
|
|
|
2008-01-13 02:08:57 +05:30
|
|
|
include ${MK}/${MKTERMCAP}.mk
|
2008-01-07 15:09:44 +05:30
|
|
|
LDADD+= ${LIBDL} ${LIBKVM}
|
2008-01-13 02:08:57 +05:30
|
|
|
include ${MK}/${MKPAM}.mk
|
2008-01-06 02:19:48 +05:30
|
|
|
|
2011-01-31 03:50:07 +05:30
|
|
|
# create symlinks to rc if not an SELINUX system, otherwise create a wrapper
|
|
|
|
# script to call rc with the proper name of the applet to execute.
|
|
|
|
# $1 is a list of the links
|
|
|
|
# $2 is the path+name of the target to link to (usually 'rc' or '/sbin/rc')
|
|
|
|
# $3 is the path where the links are created
|
|
|
|
define make-links
|
|
|
|
for x in $(1); do \
|
|
|
|
if test -n "${MKSELINUX}"; then \
|
|
|
|
printf '#!/bin/sh\nexec ${2} --applet %s "$$@"\n' $$x >${3}/$$x; \
|
|
|
|
chmod ${BINMODE} ${3}/$$x; \
|
|
|
|
else \
|
|
|
|
ln -sf ${2} ${3}/$$x; \
|
|
|
|
fi; \
|
|
|
|
done;
|
|
|
|
endef
|
|
|
|
|
2008-01-09 17:14:43 +05:30
|
|
|
${SRCS}: version.h
|
2009-10-16 12:43:34 +05:30
|
|
|
|
|
|
|
.PHONY: version.h.tmp
|
|
|
|
version.h.tmp:
|
|
|
|
echo "#define VERSION \"${VERSION}${GITVER}\"" >$@
|
2008-01-06 02:19:48 +05:30
|
|
|
if test -n "${BRANDING}"; then \
|
2009-10-16 12:43:34 +05:30
|
|
|
echo "#define BRANDING \"${BRANDING}\"" >> $@; \
|
2008-01-06 02:19:48 +05:30
|
|
|
fi
|
|
|
|
|
2009-10-16 12:43:34 +05:30
|
|
|
version.h: version.h.tmp
|
|
|
|
cmp -s $@.tmp $@ && rm $@.tmp || mv $@.tmp $@
|
|
|
|
|
2008-01-07 01:22:43 +05:30
|
|
|
install: all
|
2008-02-28 16:38:49 +05:30
|
|
|
${INSTALL} -d ${DESTDIR}${SBINDIR}
|
|
|
|
${INSTALL} -m ${BINMODE} ${PROG} ${DESTDIR}${SBINDIR}
|
2008-01-06 02:19:48 +05:30
|
|
|
${INSTALL} -d ${DESTDIR}${BINDIR}
|
2011-01-31 03:50:07 +05:30
|
|
|
$(call make-links,${BINLINKS},${SBINDIR}/${PROG},${DESTDIR}${BINDIR})
|
2008-02-28 16:38:49 +05:30
|
|
|
${INSTALL} -d ${DESTDIR}${SBINDIR}
|
2011-01-31 03:50:07 +05:30
|
|
|
$(call make-links,${SBINLINKS},${PROG},${DESTDIR}${SBINDIR})
|
2008-02-28 16:38:49 +05:30
|
|
|
${INSTALL} -d ${DESTDIR}${LINKDIR}/bin
|
2011-01-31 03:50:07 +05:30
|
|
|
$(call make-links,${RC_BINLINKS},${SBINDIR}/${PROG},${DESTDIR}${LINKDIR}/bin)
|
2008-02-28 16:38:49 +05:30
|
|
|
${INSTALL} -d ${DESTDIR}${LINKDIR}/sbin
|
2011-01-31 03:50:07 +05:30
|
|
|
$(call make-links, ${RC_SBINLINKS},${SBINDIR}/${PROG},${DESTDIR}${LINKDIR}/sbin)
|
2008-01-13 15:51:22 +05:30
|
|
|
if test "${MKPAM}" = pam; then \
|
2008-01-06 02:24:34 +05:30
|
|
|
${INSTALL} -d ${DESTDIR}${PAMDIR}; \
|
2008-01-09 17:14:43 +05:30
|
|
|
${INSTALL} -m ${PAMMODE} start-stop-daemon.pam ${DESTDIR}${PAMDIR}/start-stop-daemon; \
|
2008-01-06 02:19:48 +05:30
|
|
|
fi
|
2008-01-14 11:02:39 +05:30
|
|
|
|
2008-03-24 11:40:40 +05:30
|
|
|
check test::
|
|
|
|
|
2008-01-14 11:02:39 +05:30
|
|
|
links: rc
|
2011-01-31 03:50:07 +05:30
|
|
|
$(call make-links,${ALL_LINKS},rc,.)
|