/[baselayout]/trunk/Makefile
Gentoo

Contents of /trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3197 - (show annotations) (download)
Wed Sep 28 04:13:57 2011 UTC (2 years, 6 months ago) by vapier
File size: 2581 byte(s)
make sure /var/lock is g+w #377251 by Malte Starostik
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 /run \
31 /sys \
32 /usr/src
33 KEEP_DIRS = $(KEEP_DIRS-$(OS)) \
34 /boot \
35 /etc/profile.d \
36 /home \
37 /media \
38 /mnt \
39 /proc \
40 /opt \
41 /root \
42 /usr/local/bin \
43 /usr/local/sbin \
44 /var/cache \
45 /var/empty \
46 /var/lib \
47 /var/lock \
48 /var/log \
49 /var/run \
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:
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 # Special dirs
70 install -m 0700 -d $(DESTDIR)/root
71 touch $(DESTDIR)/root/.keep
72 install -m 1777 -d $(DESTDIR)/var/tmp
73 touch $(DESTDIR)/var/tmp/.keep
74 install -m 1777 -d $(DESTDIR)/tmp
75 touch $(DESTDIR)/tmp/.keep
76 -chgrp uucp $(DESTDIR)/var/lock
77 install -m 0775 -d $(DESTDIR)/var/lock
78 # FHS compatibility symlinks stuff
79 ln -snf /var/tmp $(DESTDIR)/usr/tmp
80
81 diststatus:
82 @if [ -z "$(PV)" ] ; then \
83 printf '\nrun: make dist PV=...\n\n'; \
84 exit 1; \
85 fi
86 if test -d .svn ; then \
87 svnfiles=`svn status 2>&1 | egrep -v '^(U|P)'` ; \
88 if test "x$$svnfiles" != "x" ; then \
89 echo "Refusing to package tarball until svn is in sync:" ; \
90 echo "$$svnfiles" ; \
91 echo "make distforce to force packaging" ; \
92 exit 1 ; \
93 fi \
94 fi
95
96 distlive:
97 rm -rf /tmp/$(PKG)
98 cp -r . /tmp/$(PKG)
99 tar jcf /tmp/$(PKG).tar.bz2 -C /tmp $(PKG) --exclude=.svn
100 rm -rf /tmp/$(PKG)
101 ls -l /tmp/$(PKG).tar.bz2
102
103 distsvn:
104 rm -rf $(PKG)
105 svn export -q . $(PKG)
106 echo $(PV) > $(PKG)/.pv
107 svn log . > $(PKG)/ChangeLog.svn
108 tar jcf $(PKG).tar.bz2 $(PKG)
109 rm -rf $(PKG)
110 ls -l $(PKG).tar.bz2
111
112 dist: diststatus distsvn
113
114 .PHONY: all clean install layout dist distforce diststatus
115
116 # vim: set ts=4 :

  ViewVC Help
Powered by ViewVC 1.1.20