/[baselayout]/trunk/Makefile
Gentoo

Contents of /trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20