/[baselayout]/trunk/Makefile
Gentoo

Contents of /trunk/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3139 - (show annotations) (download)
Sun May 24 19:43:29 2009 UTC (5 years, 2 months ago) by vapier
File size: 2540 byte(s)
tweak ChangeLog sed statement to only grab first ver
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 PKG = $(shell sed -n '/^\*/{s:\*\([^ ]*\).*:\1:;p;q}' ChangeLog)
11
12 DESTDIR =
13 LIB = lib
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-Linux += /dev /sys
28 KEEP_DIRS = $(KEEP_DIRS-$(OS)) \
29 /boot /home /mnt /root /proc /etc/profile.d \
30 /usr/local/bin /usr/local/sbin /usr/local/share/doc /usr/local/share/man \
31 /var/lock /var/run /var/empty
32
33 all:
34
35 clean:
36
37 install:
38 # These dirs may not exist from prior versions
39 for x in $(BASE_DIRS) ; do \
40 $(INSTALL_DIR) $(DESTDIR)$$x || exit $$? ; \
41 touch $(DESTDIR)$$x/.keep || exit $$? ; \
42 done
43
44 $(INSTALL_DIR) $(DESTDIR)/etc
45 cp -pPR etc/* etc.$(OS)/* $(DESTDIR)/etc/
46 $(INSTALL_DIR) $(DESTDIR)/usr/share/baselayout
47 cp -pPR share.$(OS)/* $(DESTDIR)/usr/share/baselayout/
48
49 layout:
50 # Create base filesytem layout
51 for x in $(KEEP_DIRS) ; do \
52 $(INSTALL_DIR) $(DESTDIR)$$x || exit $$? ; \
53 touch $(DESTDIR)$$x/.keep || exit $$? ; \
54 done
55 # Special dirs
56 install -m 0700 -d $(DESTDIR)/root || exit $$?
57 touch $(DESTDIR)/root/.keep || exit $$?
58 install -m 1777 -d $(DESTDIR)/var/tmp || exit $$?
59 touch $(DESTDIR)/var/tmp/.keep || exit $$?
60 install -m 1777 -d $(DESTDIR)/tmp || exit $$?
61 touch $(DESTDIR)/tmp/.keep || exit $$?
62 # FHS compatibility symlinks stuff
63 ln -snf /var/tmp $(DESTDIR)/usr/tmp || exit $$?
64 ln -snf share/man $(DESTDIR)/usr/local/man || exit $$?
65
66 diststatus:
67 if test -d .svn ; then \
68 svnfiles=`svn status 2>&1 | egrep -v '^(U|P)'` ; \
69 if test "x$$svnfiles" != "x" ; then \
70 echo "Refusing to package tarball until svn is in sync:" ; \
71 echo "$$svnfiles" ; \
72 echo "make distforce to force packaging" ; \
73 exit 1 ; \
74 fi \
75 fi
76
77 distlive:
78 rm -rf /tmp/$(PKG)
79 cp -r . /tmp/$(PKG)
80 tar jcf /tmp/$(PKG).tar.bz2 -C /tmp $(PKG) --exclude=.svn
81 rm -rf /tmp/$(PKG)
82 ls -l /tmp/$(PKG).tar.bz2
83
84 distsvn:
85 rm -rf $(PKG)
86 svn export -q . $(PKG)
87 tar jcf $(PKG).tar.bz2 $(PKG)
88 rm -rf $(PKG)
89 ls -l $(PKG).tar.bz2
90
91 dist: diststatus distsvn
92
93 .PHONY: all clean install layout dist distforce diststatus
94
95 # vim: set ts=4 :

  ViewVC Help
Powered by ViewVC 1.1.20