/[baselayout]/trunk/Makefile
Gentoo

Contents of /trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3081 - (show annotations) (download)
Wed Oct 31 22:56:53 2007 UTC (6 years, 5 months ago) by uberlord
File size: 3356 byte(s)
Release rc6
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_rc6
14
15 PKG = $(NAME)-$(VERSION)
16
17 ifeq ($(OS),)
18 OS=$(shell uname -s)
19 ifneq ($(OS),Linux)
20 OS=BSD
21 endif
22 endif
23
24 BASE_DIRS = $(RC_LIB)/init.d $(RC_LIB)/tmp
25 KEEP_DIRS = /boot /home /mnt /root \
26 /usr/local/bin /usr/local/sbin /usr/local/share/doc /usr/local/share/man \
27 /var/lock /var/run
28
29 ifeq ($(OS),Linux)
30 KEEP_DIRS += /dev /sys
31 NET_LO = net.lo
32 endif
33 ifneq ($(OS),Linux)
34 NET_LO = net.lo0
35 endif
36
37 TOPDIR = .
38 include $(TOPDIR)/default.mk
39
40 install::
41 # These dirs may not exist from prior versions
42 for x in $(BASE_DIRS) ; do \
43 $(INSTALL_DIR) $(DESTDIR)$$x || exit $$? ; \
44 touch $(DESTDIR)$$x/.keep || exit $$? ; \
45 done
46 # Don't install runlevels if they already exist
47 if ! test -d $(DESTDIR)/etc/runlevels ; then \
48 (cd runlevels; $(MAKE) install) ; \
49 test -d runlevels.$(OS) && (cd runlevels.$(OS); $(MAKE) install) ; \
50 $(INSTALL_DIR) $(DESTDIR)/etc/runlevels/single || exit $$? ; \
51 $(INSTALL_DIR) $(DESTDIR)/etc/runlevels/nonetwork || exit $$? ; \
52 fi
53 ln -snf ../../$(RC_LIB)/sh/net.sh $(DESTDIR)/etc/init.d/$(NET_LO) || exit $$?
54 ln -snf ../../$(RC_LIB)/sh/functions.sh $(DESTDIR)/etc/init.d || exit $$?
55 # Handle lib correctly
56 if test $(LIB) != "lib" ; then \
57 sed -i'.bak' -e 's,/lib/,/$(LIB)/,g' $(DESTDIR)/$(RC_LIB)/sh/functions.sh || exit $$? ; \
58 rm -f $(DESTDIR)/$(RC_LIB)/sh/functions.sh.bak ; \
59 sed -i'.bak' -e 's,/lib/,/$(LIB)/,g' $(DESTDIR)/$(RC_LIB)/sh/rc-functions.sh || exit $$? ; \
60 rm -f $(DESTDIR)/$(RC_LIB)/sh/rc-functions.sh.bak ; \
61 fi
62
63 layout:
64 # Create base filesytem layout
65 for x in $(KEEP_DIRS) ; do \
66 $(INSTALL_DIR) $(DESTDIR)$$x || exit $$? ; \
67 touch $(DESTDIR)$$x/.keep || exit $$? ; \
68 done
69 # Special dirs
70 install -m 0700 -d $(DESTDIR)/root || exit $$?
71 touch $(DESTDIR)/root/.keep || exit $$?
72 install -m 1777 -d $(DESTDIR)/var/tmp || exit $$?
73 touch $(DESTDIR)/var/tmp/.keep || exit $$?
74 install -m 1777 -d $(DESTDIR)/tmp || exit $$?
75 touch $(DESTDIR)/tmp/.keep || exit $$?
76 # FHS compatibility symlinks stuff
77 ln -snf /var/tmp $(DESTDIR)/usr/tmp || exit $$?
78 ln -snf share/man $(DESTDIR)/usr/local/man || exit $$?
79
80 diststatus:
81 if test -d .svn ; then \
82 svnfiles=`svn status 2>&1 | egrep -v '^(U|P)'` ; \
83 if test "x$$svnfiles" != "x" ; then \
84 echo "Refusing to package tarball until svn is in sync:" ; \
85 echo "$$svnfiles" ; \
86 echo "make distforce to force packaging" ; \
87 exit 1 ; \
88 fi \
89 fi
90
91 distforce:
92 rm -rf /tmp/$(PKG)
93 cp -pPR . /tmp/$(PKG)
94 $(MAKE) -C /tmp/$(PKG) clean
95 (find /tmp/$(PKG) -type d -name .svn -exec rm -rf {} \; 2>/dev/null; exit 0)
96 tar -C /tmp -cvjpf /tmp/$(PKG).tar.bz2 $(PKG)
97 rm -rf /tmp/$(PKG)
98 ls -l /tmp/$(PKG).tar.bz2
99
100 distit:
101 rm -rf /tmp/$(PKG)
102 svn export . /tmp/$(PKG)
103 $(MAKE) -C /tmp/$(PKG) clean
104 tar -C /tmp -cvjpf /tmp/$(PKG).tar.bz2 $(PKG)
105 rm -rf /tmp/$(PKG)
106 ls -l /tmp/$(PKG).tar.bz2
107
108 dist: diststatus distit
109
110 .PHONY: layout dist distforce distit diststatus
111
112 # vim: set ts=4 :

  ViewVC Help
Powered by ViewVC 1.1.20