/[baselayout]/trunk/Makefile
Gentoo

Contents of /trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3191 - (show annotations) (download)
Sat Jun 18 03:44:10 2011 UTC (3 years, 3 months ago) by vapier
File size: 2709 byte(s)
install more skel dirs as required by fhs and our general usage
1 # baselayout Makefile
2 # Copyright 2006-2011 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 PV = $(shell cat .pv)
11 PKG = baselayout-$(PV)
12
13 DESTDIR =
14 LIB = lib
15
16 INSTALL_DIR = install -m 0755 -d
17 INSTALL_EXE = install -m 0755
18 INSTALL_FILE = install -m 0644
19 INSTALL_SECURE = install -m 0600
20
21 ifeq ($(OS),)
22 OS=$(shell uname -s)
23 ifneq ($(OS),Linux)
24 OS=BSD
25 endif
26 endif
27
28 KEEP_DIRS-Linux += \
29 /dev \
30 /sys \
31 /usr/src
32 KEEP_DIRS = $(KEEP_DIRS-$(OS)) \
33 /boot \
34 /etc/profile.d \
35 /home \
36 /media \
37 /mnt \
38 /proc \
39 /opt \
40 /root \
41 /usr/local/bin \
42 /usr/local/sbin \
43 /var/cache \
44 /var/empty \
45 /var/lib \
46 /var/lock \
47 /var/log \
48 /var/run \
49 /var/spool
50
51 all:
52
53 clean:
54
55 install:
56 # These dirs may not exist from prior versions
57 for x in $(BASE_DIRS) ; do \
58 $(INSTALL_DIR) $(DESTDIR)$$x || exit $$? ; \
59 touch $(DESTDIR)$$x/.keep || exit $$? ; \
60 done
61
62 $(INSTALL_DIR) $(DESTDIR)/etc
63 cp -pPR etc/* etc.$(OS)/* $(DESTDIR)/etc/
64 $(INSTALL_DIR) $(DESTDIR)/usr/share/baselayout
65 cp -pPR share.$(OS)/* $(DESTDIR)/usr/share/baselayout/
66
67 layout:
68 # Create base filesytem layout
69 for x in $(KEEP_DIRS) ; do \
70 test -e $(DESTDIR)$$x/.keep && continue ; \
71 $(INSTALL_DIR) $(DESTDIR)$$x || exit $$? ; \
72 touch $(DESTDIR)$$x/.keep || echo "ignoring touch failure; mounted fs?" ; \
73 done
74 # Special dirs
75 install -m 0700 -d $(DESTDIR)/root
76 touch $(DESTDIR)/root/.keep
77 install -m 1777 -d $(DESTDIR)/var/tmp
78 touch $(DESTDIR)/var/tmp/.keep
79 install -m 1777 -d $(DESTDIR)/tmp
80 touch $(DESTDIR)/tmp/.keep
81 -chgrp uucp $(DESTDIR)/var/lock
82 # FHS compatibility symlinks stuff
83 ln -snf /var/tmp $(DESTDIR)/usr/tmp
84
85 diststatus:
86 @if [ -z "$(PV)" ] ; then \
87 printf '\nrun: make dist PV=...\n\n'; \
88 exit 1; \
89 fi
90 if test -d .svn ; then \
91 svnfiles=`svn status 2>&1 | egrep -v '^(U|P)'` ; \
92 if test "x$$svnfiles" != "x" ; then \
93 echo "Refusing to package tarball until svn is in sync:" ; \
94 echo "$$svnfiles" ; \
95 echo "make distforce to force packaging" ; \
96 exit 1 ; \
97 fi \
98 fi
99
100 distlive:
101 rm -rf /tmp/$(PKG)
102 cp -r . /tmp/$(PKG)
103 tar jcf /tmp/$(PKG).tar.bz2 -C /tmp $(PKG) --exclude=.svn
104 rm -rf /tmp/$(PKG)
105 ls -l /tmp/$(PKG).tar.bz2
106
107 distsvn:
108 rm -rf $(PKG)
109 svn export -q . $(PKG)
110 echo $(PV) > $(PKG)/.pv
111 svn log . > $(PKG)/ChangeLog.svn
112 tar jcf $(PKG).tar.bz2 $(PKG)
113 rm -rf $(PKG)
114 ls -l $(PKG).tar.bz2
115
116 dist: diststatus distsvn
117
118 .PHONY: all clean install layout dist distforce diststatus
119
120 # vim: set ts=4 :

  ViewVC Help
Powered by ViewVC 1.1.20