source: projects/initscripts/trunk/Makefile @ 1108

Revision 1108, 4.8 KB checked in by daisuke, 14 years ago (diff)

import initscripts-8.90.6 from internal cvs repository

Line 
1ROOT=/
2SUPERUSER=root
3SUPERGROUP=root
4
5NAME=initscripts
6VERSION := $(shell awk '/Version:/ { print $$2 }' initscripts-vl.spec)
7RELEASE := $(shell awk '/Release:/ { print $$2 }' initscripts-vl.spec)
8CVSTAG = r$(subst .,-,$(VERSION))
9CVSROOT = $(shell cat CVS/Root)
10
11mandir=/usr/share/man
12
13all:
14        (cd src; make)
15        (make -C po)
16install:
17        mkdir -p $(ROOT)/etc
18        mkdir -p $(ROOT)/etc/profile.d $(ROOT)/sbin $(ROOT)/usr/sbin
19        mkdir -p $(ROOT)$(mandir)/man8
20
21        install -m644  inittab $(ROOT)/etc/inittab.sysv
22        install -m644  inittab.upstart $(ROOT)/etc/inittab.upstart
23        install -m644  adjtime $(ROOT)/etc
24        install -m755  setsysfont $(ROOT)/sbin
25        install -m755  service $(ROOT)/sbin
26        install -m644  networks $(ROOT)/etc
27        install -m755  sys-unconfig $(ROOT)/usr/sbin
28        install -m644  service.8 sys-unconfig.8 $(ROOT)$(mandir)/man8
29        install -m644  sysctl.conf $(ROOT)/etc/sysctl.conf
30        if uname -m | grep -q ppc ; then \
31          install -m644 sysctl.conf.ppc $(ROOT)/etc/sysctl.conf ; fi
32        if uname -m | grep -q sparc ; then \
33          install -m644 sysctl.conf.sparc $(ROOT)/etc/sysctl.conf ; fi
34
35        for f in profile.d/* ; do \
36          install -m755 $$f $(ROOT)/etc/profile.d ; \
37        done
38
39        mkdir -p $(ROOT)/etc/X11
40        install -m755 prefdm $(ROOT)/etc/X11/prefdm
41
42        cp -af rc.d sysconfig $(ROOT)/etc
43        cp -af ppp NetworkManager init $(ROOT)/etc
44        mkdir -p $(ROOT)/etc/ppp/peers
45        mkdir -p $(ROOT)/lib
46        cp -af udev $(ROOT)/lib
47        mkdir -p $(ROOT)/etc/sysconfig/modules
48        mkdir -p $(ROOT)/etc/sysconfig/networking/devices
49        mkdir -p $(ROOT)/etc/sysconfig/networking/profiles/default
50        mkdir -p $(ROOT)/etc/sysconfig/console
51
52        mv $(ROOT)/etc/sysconfig/network-scripts/ifup $(ROOT)/sbin
53        mv $(ROOT)/etc/sysconfig/network-scripts/ifdown $(ROOT)/sbin
54        (cd $(ROOT)/etc/sysconfig/network-scripts; \
55          ln -sf ifup-ippp ifup-isdn ; \
56          ln -sf ifdown-ippp ifdown-isdn ; \
57          ln -sf ../../../sbin/ifup . ; \
58          ln -sf ../../../sbin/ifdown . )
59        make install ROOT=$(ROOT) mandir=$(mandir) -C src
60        make install PREFIX=$(ROOT) -C po
61
62# Make sure locale stuff from initscripts goes in /usr/share/locale too
63#       mkdir -p $(ROOT)/usr/share/locale
64#       cp -a $(ROOT)/etc/locale/* $(ROOT)/usr/share/locale/
65
66        mkdir -p $(ROOT)/var/run/netreport
67        mkdir -p $(ROOT)/var/log
68        chown $(SUPERUSER):$(SUPERGROUP) $(ROOT)/var/run/netreport
69        chmod u=rwx,g=rwx,o=rx $(ROOT)/var/run/netreport
70        touch $(ROOT)/var/run/utmp
71        touch $(ROOT)/var/log/wtmp
72        touch $(ROOT)/var/log/btmp
73
74        for i in 0 1 2 3 4 5 6 ; do \
75                dir=$(ROOT)/etc/rc.d/rc$$i.d; \
76                mkdir $$dir; \
77                chmod u=rwx,g=rx,o=rx $$dir; \
78        done
79
80# Can't store symlinks in a CVS archive
81        ln -s ../init.d/killall $(ROOT)/etc/rc.d/rc0.d/S00killall
82        ln -s ../init.d/killall $(ROOT)/etc/rc.d/rc6.d/S00killall
83
84        ln -s ../init.d/halt $(ROOT)/etc/rc.d/rc0.d/S01halt
85        ln -s ../init.d/halt $(ROOT)/etc/rc.d/rc6.d/S01reboot
86
87        ln -s ../init.d/single $(ROOT)/etc/rc.d/rc1.d/S99single
88
89        ln -s ../rc.local $(ROOT)/etc/rc.d/rc2.d/S99local
90        ln -s ../rc.local $(ROOT)/etc/rc.d/rc3.d/S99local
91        ln -s ../rc.local $(ROOT)/etc/rc.d/rc4.d/S99local
92        ln -s ../rc.local $(ROOT)/etc/rc.d/rc5.d/S99local
93
94# These are LSB compatibility symlinks.  At some point in the future
95# the actual files will be here instead of symlinks
96        for i in 0 1 2 3 4 5 6 ; do \
97                ln -s rc.d/rc$$i.d $(ROOT)/etc/rc$$i.d; \
98        done
99        for i in rc rc.sysinit rc.local ; do \
100                ln -s rc.d/$$i $(ROOT)/etc/$$i; \
101        done
102
103
104
105check:
106        for afile in `find . -type f -perm +111|grep -v \.csh | grep -v po/ ` ; do \
107                if ! file $$afile | grep -s ELF  >/dev/null; then \
108                    bash -n $$afile || { echo $$afile ; exit 1 ; } ; \
109                fi  ;\
110        done
111
112changelog:
113        @rcs2log | sed "s|@.*redhat\.com|@redhat.com|" | sed "s|@.*redhat\.de|@redhat.com|" | sed "s|@redhat\.de|@redhat.com|" | sed "s|@@|@|" | \
114         sed "s|/mnt/devel/CVS/initscripts/||g" | sed "s|/cvs/rhl/initscripts/||g" > changenew
115         mv ChangeLog ChangeLog.old
116         cat changenew ChangeLog.old > ChangeLog
117         rm -f changenew
118
119clean:
120        make clean -C src
121        make clean -C po
122        @rm -fv *~ changenew ChangeLog.old *gz
123        @find . -name "*~" -exec rm -f \{\} \;
124
125tag-archive:
126        cvs -Q tag -F $(CVSTAG)
127
128create-archive: tag-archive
129        @rm -rf /tmp/initscripts
130        @cd /tmp; cvs -Q -d $(CVSROOT) export -r$(CVSTAG) initscripts || echo GRRRrrrrr -- ignore [export aborted]
131        @mv /tmp/initscripts /tmp/initscripts-$(VERSION)
132        @cd /tmp; tar --bzip2 -cSpf initscripts-$(VERSION).tar.bz2 initscripts-$(VERSION)
133        @rm -rf /tmp/initscripts-$(VERSION)
134        @cp /tmp/initscripts-$(VERSION).tar.bz2 .
135        @rm -f /tmp/initscripts-$(VERSION).tar.bz2
136        @echo " "
137        @echo "The final archive is ./initscripts-$(VERSION).tar.bz2."
138
139archive: clean check tag-archive create-archive
140
141
142tarbz2: clean tag-archive
143        cd .. && rm -rf $(NAME)-$(VERSION)
144        cd .. && cp -arf $(NAME) $(NAME)-$(VERSION)
145        cd .. && tar --exclude "CVS" -cjf $(NAME)-vine-$(VERSION).tar.bz2 $(NAME)-$(VERSION)
146        mv ../$(NAME)-vine-$(VERSION).tar.bz2 ~/rpm/SOURCES
147        cd .. && rm -rf $(NAME)-$(VERSION)
148
149rpm: tarbz2
150        rpmbuild -ba $(NAME)-vl.spec
151
Note: See TracBrowser for help on using the repository browser.