/[baselayout]/trunk/Makefile
Gentoo

Contents of /trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3112 - (show annotations) (download)
Sun Mar 23 01:16:58 2008 UTC (6 years, 3 months ago) by vapier
File size: 2093 byte(s)
cleanup dist targets
1 # baselayout Makefile
2 # Copyright 2006-2008 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 = etc share
11
12 NAME = baselayout
13 VERSION = 2.0.0
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 KEEP_DIRS = /boot /home /mnt /root /proc \
25 /usr/local/bin /usr/local/sbin /usr/local/share/doc /usr/local/share/man \
26 /var/lock /var/run /var/empty
27
28 ifeq ($(OS),Linux)
29 KEEP_DIRS += /dev /sys
30 endif
31
32 TOPDIR = .
33 include $(TOPDIR)/default.mk
34
35 install::
36 # These dirs may not exist from prior versions
37 for x in $(BASE_DIRS) ; do \
38 $(INSTALL_DIR) $(DESTDIR)$$x || exit $$? ; \
39 touch $(DESTDIR)$$x/.keep || exit $$? ; \
40 done
41
42 layout:
43 # Create base filesytem layout
44 for x in $(KEEP_DIRS) ; do \
45 $(INSTALL_DIR) $(DESTDIR)$$x || exit $$? ; \
46 touch $(DESTDIR)$$x/.keep || exit $$? ; \
47 done
48 # Special dirs
49 install -m 0700 -d $(DESTDIR)/root || exit $$?
50 touch $(DESTDIR)/root/.keep || exit $$?
51 install -m 1777 -d $(DESTDIR)/var/tmp || exit $$?
52 touch $(DESTDIR)/var/tmp/.keep || exit $$?
53 install -m 1777 -d $(DESTDIR)/tmp || exit $$?
54 touch $(DESTDIR)/tmp/.keep || exit $$?
55 # FHS compatibility symlinks stuff
56 ln -snf /var/tmp $(DESTDIR)/usr/tmp || exit $$?
57 ln -snf share/man $(DESTDIR)/usr/local/man || exit $$?
58
59 diststatus:
60 if test -d .svn ; then \
61 svnfiles=`svn status 2>&1 | egrep -v '^(U|P)'` ; \
62 if test "x$$svnfiles" != "x" ; then \
63 echo "Refusing to package tarball until svn is in sync:" ; \
64 echo "$$svnfiles" ; \
65 echo "make distforce to force packaging" ; \
66 exit 1 ; \
67 fi \
68 fi
69
70 distforce:
71 rm -rf /tmp/$(PKG)
72 svn export -q . /tmp/$(PKG)
73 tar jcf /tmp/$(PKG).tar.bz2 -C /tmp $(PKG)
74 rm -rf /tmp/$(PKG)
75 ls -l /tmp/$(PKG).tar.bz2
76
77 dist: diststatus distforce
78
79 .PHONY: layout dist distforce diststatus
80
81 # vim: set ts=4 :

  ViewVC Help
Powered by ViewVC 1.1.20