2007-11-14 19:04:42 +05:30
|
|
|
# Open Run Control Makefile
|
2007-04-05 16:48:42 +05:30
|
|
|
# Copyright 2006-2007 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2007-11-14 19:04:42 +05:30
|
|
|
NAME = openrc
|
2007-11-19 19:18:43 +05:30
|
|
|
VERSION = 1.0
|
2007-04-05 16:48:42 +05:30
|
|
|
PKG = $(NAME)-$(VERSION)
|
|
|
|
|
2007-11-19 19:18:43 +05:30
|
|
|
SUBDIR = conf.d etc init.d man net sh src
|
2007-04-05 16:48:42 +05:30
|
|
|
|
|
|
|
TOPDIR = .
|
|
|
|
include $(TOPDIR)/default.mk
|
2007-11-19 19:18:43 +05:30
|
|
|
include $(TOPDIR)/Makefile.$(OS)
|
2007-04-05 16:48:42 +05:30
|
|
|
|
|
|
|
install::
|
|
|
|
# Don't install runlevels if they already exist
|
|
|
|
if ! test -d $(DESTDIR)/etc/runlevels ; then \
|
|
|
|
(cd runlevels; $(MAKE) install) ; \
|
|
|
|
test -d runlevels.$(OS) && (cd runlevels.$(OS); $(MAKE) install) ; \
|
|
|
|
$(INSTALL_DIR) $(DESTDIR)/etc/runlevels/single || exit $$? ; \
|
|
|
|
$(INSTALL_DIR) $(DESTDIR)/etc/runlevels/nonetwork || exit $$? ; \
|
|
|
|
fi
|
2007-09-19 19:23:40 +05:30
|
|
|
ln -snf ../../$(RC_LIB)/sh/net.sh $(DESTDIR)/etc/init.d/$(NET_LO) || exit $$?
|
|
|
|
ln -snf ../../$(RC_LIB)/sh/functions.sh $(DESTDIR)/etc/init.d || exit $$?
|
2007-04-05 16:48:42 +05:30
|
|
|
# Handle lib correctly
|
|
|
|
if test $(LIB) != "lib" ; then \
|
2007-09-19 19:23:40 +05:30
|
|
|
sed -i'.bak' -e 's,/lib/,/$(LIB)/,g' $(DESTDIR)/$(RC_LIB)/sh/functions.sh || exit $$? ; \
|
|
|
|
rm -f $(DESTDIR)/$(RC_LIB)/sh/functions.sh.bak ; \
|
2007-09-24 17:39:43 +05:30
|
|
|
sed -i'.bak' -e 's,/lib/,/$(LIB)/,g' $(DESTDIR)/$(RC_LIB)/sh/rc-functions.sh || exit $$? ; \
|
|
|
|
rm -f $(DESTDIR)/$(RC_LIB)/sh/rc-functions.sh.bak ; \
|
2007-04-05 16:48:42 +05:30
|
|
|
fi
|
|
|
|
|
2007-04-13 20:11:46 +05:30
|
|
|
diststatus:
|
2007-04-05 16:48:42 +05:30
|
|
|
if test -d .svn ; then \
|
|
|
|
svnfiles=`svn status 2>&1 | egrep -v '^(U|P)'` ; \
|
|
|
|
if test "x$$svnfiles" != "x" ; then \
|
|
|
|
echo "Refusing to package tarball until svn is in sync:" ; \
|
|
|
|
echo "$$svnfiles" ; \
|
|
|
|
echo "make distforce to force packaging" ; \
|
|
|
|
exit 1 ; \
|
|
|
|
fi \
|
|
|
|
fi
|
|
|
|
|
2007-04-13 20:11:46 +05:30
|
|
|
distit:
|
2007-04-13 20:06:30 +05:30
|
|
|
rm -rf /tmp/$(PKG)
|
2007-04-13 20:03:22 +05:30
|
|
|
svn export . /tmp/$(PKG)
|
2007-04-25 18:02:47 +05:30
|
|
|
$(MAKE) -C /tmp/$(PKG) clean
|
2007-04-05 16:48:42 +05:30
|
|
|
tar -C /tmp -cvjpf /tmp/$(PKG).tar.bz2 $(PKG)
|
2007-04-13 20:06:30 +05:30
|
|
|
rm -rf /tmp/$(PKG)
|
2007-04-13 20:29:51 +05:30
|
|
|
ls -l /tmp/$(PKG).tar.bz2
|
2007-04-05 16:48:42 +05:30
|
|
|
|
2007-04-13 20:11:46 +05:30
|
|
|
dist: diststatus distit
|
2007-04-05 16:48:42 +05:30
|
|
|
|
2007-11-14 19:04:42 +05:30
|
|
|
.PHONY: layout dist distit diststatus
|
2007-04-13 20:03:22 +05:30
|
|
|
|
2007-04-05 16:48:42 +05:30
|
|
|
# vim: set ts=4 :
|