source: projects/initscripts/trunk/Makefile @ 6544

Revision 6544, 4.1 KB checked in by daisuke, 10 years ago (diff)

add srpm target to Makefile

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