/[baselayout]/trunk/Makefile
Gentoo

Contents of /trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3195 - (show annotations) (download)
Mon Jun 27 03:34:09 2011 UTC (3 years, 3 months ago) by vapier
File size: 2541 byte(s)
drop unused BASE_DIRS 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 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 # FHS compatibility symlinks stuff
78 ln -snf /var/tmp $(DESTDIR)/usr/tmp
79
80 diststatus:
81 @if [ -z "$(PV)" ] ; then \
82 printf '\nrun: make dist PV=...\n\n'; \
83 exit 1; \
84 fi
85 if test -d .svn ; then \
86 svnfiles=`svn status 2>&1 | egrep -v '^(U|P)'` ; \
87 if test "x$$svnfiles" != "x" ; then \
88 echo "Refusing to package tarball until svn is in sync:" ; \
89 echo "$$svnfiles" ; \
90 echo "make distforce to force packaging" ; \
91 exit 1 ; \
92 fi \
93 fi
94
95 distlive:
96 rm -rf /tmp/$(PKG)
97 cp -r . /tmp/$(PKG)
98 tar jcf /tmp/$(PKG).tar.bz2 -C /tmp $(PKG) --exclude=.svn
99 rm -rf /tmp/$(PKG)
100 ls -l /tmp/$(PKG).tar.bz2
101
102 distsvn:
103 rm -rf $(PKG)
104 svn export -q . $(PKG)
105 echo $(PV) > $(PKG)/.pv
106 svn log . > $(PKG)/ChangeLog.svn
107 tar jcf $(PKG).tar.bz2 $(PKG)
108 rm -rf $(PKG)
109 ls -l $(PKG).tar.bz2
110
111 dist: diststatus distsvn
112
113 .PHONY: all clean install layout dist distforce diststatus
114
115 # vim: set ts=4 :

  ViewVC Help
Powered by ViewVC 1.1.20