/[baselayout]/trunk/Makefile
Gentoo

Contents of /trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2863 - (show annotations) (download)
Sun Sep 2 13:12:24 2007 UTC (7 years, 3 months ago) by uberlord
File size: 3249 byte(s)
Release rc4
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_rc4
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 = /$(LIB)/rcscripts/init.d /$(LIB)/rcscripts/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 ../../$(LIB)/rcscripts/sh/net.sh $(DESTDIR)/etc/init.d/$(NET_LO) || exit $$?
54 ln -snf ../../$(LIB)/rcscripts/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)/$(LIB)/rcscripts/sh/functions.sh || exit $$? ; \
58 rm -f $(DESTDIR)/$(LIB)/rcscripts/sh/functions.sh.bak ; \
59 fi
60
61 layout:
62 # Create base filesytem layout
63 for x in $(KEEP_DIRS) ; do \
64 $(INSTALL_DIR) $(DESTDIR)$$x || exit $$? ; \
65 touch $(DESTDIR)$$x/.keep || exit $$? ; \
66 done
67 # Special dirs
68 install -m 0700 -d $(DESTDIR)/root || exit $$?
69 touch $(DESTDIR)/root/.keep || exit $$?
70 install -m 1777 -d $(DESTDIR)/var/tmp || exit $$?
71 touch $(DESTDIR)/var/tmp/.keep || exit $$?
72 install -m 1777 -d $(DESTDIR)/tmp || exit $$?
73 touch $(DESTDIR)/tmp/.keep || exit $$?
74 # FHS compatibility symlinks stuff
75 ln -snf /var/tmp $(DESTDIR)/usr/tmp || exit $$?
76 ln -snf share/man $(DESTDIR)/usr/local/man || exit $$?
77
78 diststatus:
79 if test -d .svn ; then \
80 svnfiles=`svn status 2>&1 | egrep -v '^(U|P)'` ; \
81 if test "x$$svnfiles" != "x" ; then \
82 echo "Refusing to package tarball until svn is in sync:" ; \
83 echo "$$svnfiles" ; \
84 echo "make distforce to force packaging" ; \
85 exit 1 ; \
86 fi \
87 fi
88
89 distforce:
90 rm -rf /tmp/$(PKG)
91 cp -pPR . /tmp/$(PKG)
92 $(MAKE) -C /tmp/$(PKG) clean
93 (find /tmp/$(PKG) -type d -name .svn -exec rm -rf {} \; 2>/dev/null; exit 0)
94 tar -C /tmp -cvjpf /tmp/$(PKG).tar.bz2 $(PKG)
95 rm -rf /tmp/$(PKG)
96 ls -l /tmp/$(PKG).tar.bz2
97
98 distit:
99 rm -rf /tmp/$(PKG)
100 svn export . /tmp/$(PKG)
101 $(MAKE) -C /tmp/$(PKG) clean
102 tar -C /tmp -cvjpf /tmp/$(PKG).tar.bz2 $(PKG)
103 rm -rf /tmp/$(PKG)
104 ls -l /tmp/$(PKG).tar.bz2
105
106 dist: diststatus distit
107
108 .PHONY: layout dist distforce distit diststatus
109
110 # vim: set ts=4 :

  ViewVC Help
Powered by ViewVC 1.1.20