/[baselayout]/trunk/Makefile
Gentoo

Contents of /trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20