/[baselayout]/trunk/Makefile
Gentoo

Contents of /trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2547 - (show annotations) (download)
Thu Apr 5 11:18:42 2007 UTC (7 years, 4 months ago) by uberlord
File size: 3266 byte(s)
    Rewrite the core parts in C. We now provide librc so other programs can
    query runlevels, services and state without using bash. We also provide
    libeinfo so other programs can easily use our informational functions.

    As such, we have dropped the requirement of using bash as the init script
    shell. We now use /bin/sh and have strived to make the scripts as portable
    as possible. Shells that work are bash and dash. busybox works provided
    you disable s-s-d. If you have WIPE_TMP set to yes in conf.d/bootmisc you
    should disable find too.
    zsh and ksh do not work at this time.

    Networking support is currently being re-vamped also as it was heavily bash
    array based. As such, a new config format is available like so
    config_eth0="1.2.3.4/24 5.6.7.8/16"
    or like so
    config_eth0="'1.2.3.4 netmask 255.255.255.0' '5.6.7.8 netmask 255.255.0.0'"

    We will still support the old bash array format provided that /bin/sh IS
    a link it bash.

    ChangeLog for baselayout-1 can be found in our SVN repo.
1 # baselayout Makefile
2 # Copyright 2006-2007 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 #
5 # We've moved the installation logic from Gentoo ebuild into a generic
6 # Makefile so that the ebuild is much smaller and more simple.
7 # It also has the added bonus of being easier to install on systems
8 # without an ebuild style package manager.
9
10 SUBDIRS = conf.d etc init.d man net sh share src
11
12 NAME = baselayout
13 #VERSION = 2.0.0_alpha1
14 VERSION = 1.13.99
15
16 PKG = $(NAME)-$(VERSION)
17
18 ARCH = x86
19 ifeq ($(OS),)
20 OS=$(shell uname -s)
21 ifneq ($(OS),Linux)
22 OS=BSD
23 endif
24 endif
25
26 BASE_DIRS = /$(LIB)/rcscripts/init.d /$(LIB)/rcscripts/tmp
27 KEEP_DIRS = /boot /home /mnt /root \
28 /usr/local/bin /usr/local/sbin /usr/local/share/doc /usr/local/share/man \
29 /var/lock /var/run
30
31 ifeq ($(OS),Linux)
32 KEEP_DIRS += /dev /sys
33 NET_LO = net.lo
34 endif
35 ifneq ($(OS),Linux)
36 NET_LO = net.lo0
37 endif
38
39 TOPDIR = .
40 include $(TOPDIR)/default.mk
41
42 install::
43 # These dirs may not exist from prior versions
44 for x in $(BASE_DIRS) ; do \
45 $(INSTALL_DIR) $(DESTDIR)$$x || exit $$? ; \
46 touch $(DESTDIR)$$x/.keep || exit $$? ; \
47 done
48 # Don't install runlevels if they already exist
49 if ! test -d $(DESTDIR)/etc/runlevels ; then \
50 (cd runlevels; $(MAKE) install) ; \
51 test -d runlevels.$(OS) && (cd runlevels.$(OS); $(MAKE) install) ; \
52 $(INSTALL_DIR) $(DESTDIR)/etc/runlevels/single || exit $$? ; \
53 $(INSTALL_DIR) $(DESTDIR)/etc/runlevels/nonetwork || exit $$? ; \
54 fi
55 ln -snf ../../$(LIB)/rcscripts/sh/net.sh $(DESTDIR)/etc/init.d/$(NET_LO) || exit $$?
56 ln -snf ../../$(LIB)/rcscripts/sh/functions.sh $(DESTDIR)/etc/init.d || exit $$?
57 # Handle lib correctly
58 if test $(LIB) != "lib" ; then \
59 sed -i'.bak' -e 's,/lib/,/$(LIB)/,g' $(DESTDIR)/$(LIB)/rcscripts/sh/functions.sh || exit $$? ; \
60 rm -f $(DESTDIR)/$(LIB)/rcscripts/sh/functions.sh.bak ; \
61 fi
62
63 .PHONY: all clean install
64
65 layout:
66 # Create base filesytem layout
67 for x in $(KEEP_DIRS) ; do \
68 $(INSTALL_DIR) $(DESTDIR)$$x || exit $$? ; \
69 touch $(DESTDIR)$$x/.keep || exit $$? ; \
70 done
71 # Special dirs
72 install -m 0700 -d $(DESTDIR)/root || exit $$?
73 touch $(DESTDIR)/root/.keep || exit $$?
74 install -m 1777 -d $(DESTDIR)/var/tmp || exit $$?
75 touch $(DESTDIR)/var/tmp/.keep || exit $$?
76 install -m 1777 -d $(DESTDIR)/tmp || exit $$?
77 touch $(DESTDIR)/tmp/.keep || exit $$?
78 # FHS compatibility symlinks stuff
79 ln -snf /var/tmp $(DESTDIR)/usr/tmp || exit $$?
80 ln -snf share/man $(DESTDIR)/usr/local/man || exit $$?
81
82 distcheck:
83 if test -d .svn ; then \
84 svnfiles=`svn status 2>&1 | egrep -v '^(U|P)'` ; \
85 if test "x$$svnfiles" != "x" ; then \
86 echo "Refusing to package tarball until svn is in sync:" ; \
87 echo "$$svnfiles" ; \
88 echo "make distforce to force packaging" ; \
89 exit 1 ; \
90 fi \
91 fi
92
93 distforce:
94 install -d /tmp/$(PKG)
95 cp -PRp . /tmp/$(PKG)
96 `which find` /tmp/$(PKG) -depth -path "*/.svn/*" -delete
97 `which find` /tmp/$(PKG) -depth -path "*/.svn" -delete
98 rm -rf /tmp/$(PKG)/src/core /tmp/$(PKG)/po
99 $(MAKE) -C /tmp/$(PKG) clean
100 sed -i'.bak' -e '/-Wl,-rpath ./ s/^/#/g' /tmp/$(PKG)/src/Makefile
101 rm -f /tmp/$(PKG)/src/Makefile.bak
102 tar -C /tmp -cvjpf /tmp/$(PKG).tar.bz2 $(PKG)
103 rm -Rf /tmp/$(PKG)
104 du /tmp/$(PKG).tar.bz2
105
106 dist: distcheck distforce
107
108 # vim: set ts=4 :

  ViewVC Help
Powered by ViewVC 1.1.20