aboutsummaryrefslogtreecommitdiffstats
path: root/mandriva/Makefile
blob: f9c952a911dd67a4b6bbc85f00d51be75f84bb31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# $Id$	
NAME=initscripts
CFLAGS=-g -O2 -Wall
SVNROOT = svn+ssh://svn.mandriva.com/svn/soft/initscripts
SVNCOPY = $(shell LC_ALL=C svn info ..|fgrep 'URL:'|cut -f 2 -d\ )
ROOT=/
LOCALSRPM=/SRPMS/main/release
ARCH := $(shell uname -m)
SH := $(shell echo *.sh) listhome $(shell echo mandrake_*) rc.modules lookupdm mdv-network-event network-up
PL = supermount
mandir=/usr/share
VERSION:=$(shell rpm -q --qf '%{VERSION}\n' --specfile ../$(NAME).spec | head -n 1)
RELEASE:=$(shell rpm -q --qf '%{RELEASE}\n' --specfile ../$(NAME).spec | head -n 1)
RELTAG := $(shell echo "V$(VERSION)_$(RELEASE)" | tr -- '-.' '__')
RH_TAG:=rh$(subst .,_,$(VERSION))
RPM := $(shell if [ -n "$$RPM" ]; then echo $$RPM; else rpm --eval '%{_topdir}'; fi)

SUBDIRS = partmon vpn
PROFILE_LEVEL=10

RPMOPT = --clean

all:

check:
	@for i in $(SH);do /bin/bash -n $$i || exit 1;echo $$i syntax OK;done
	@for i in $(PL);do perl -c $$i ||exit 1;done
	@for i in $(SUBDIRS);do	make -C $$i check;done

clean:

install: all check
	mkdir -p $(ROOT)/usr/{bin/,sbin/,man/man8}
	mkdir -p $(ROOT)/sbin
	mkdir -p $(ROOT)/etc/modprobe.preload.d/
	mkdir -p $(ROOT)/etc/rc.d/init.d/
	mkdir -p $(ROOT)/lib/lsb
	mkdir -p $(ROOT)/etc/profile.d/
	mkdir -p $(ROOT)/etc/ppp/ip-{up,down}.d/
	mkdir -p $(ROOT)/etc/sysconfig/network-scripts/if{up,down}.d
	mkdir -p $(ROOT)/etc/sysconfig/network-scripts/cellular.d
	mkdir -p $(ROOT)/etc/sysconfig/network-scripts/hostname.d
	mkdir -p $(ROOT)/etc/sysconfig/network-scripts/wireless.d
	mkdir -p $(ROOT)/etc/X11/xsetup.d
	mkdir -p $(ROOT)/var/lib/speedboot
	install -m755 if{up,down}-hso $(ROOT)/etc/sysconfig/network-scripts/
	install -m755 rc.modules $(ROOT)/etc/
	install -m644 modules $(ROOT)/etc/
	install -m755 lookupdm $(ROOT)/etc/X11/
	install -m755 90speedboot.xsetup $(ROOT)/etc/X11/xsetup.d/
	install -m644 speedboot $(ROOT)/etc/sysconfig/speedboot
	for profile in {inputrc,tmpdir}.{c,}sh; do \
	  install -m644 $$profile $(ROOT)/etc/profile.d/$(PROFILE_LEVEL)$$profile; \
	done
	install -m755 listhome $(ROOT)/usr/bin/
	install -m755 mandrake_{firstime,everytime} network-auth network-up $(ROOT)/etc/rc.d/init.d/
	install -D -m644 autofsck $(ROOT)/etc/sysconfig/autofsck
	@for i in $(SUBDIRS);do	make -C $$i install;done

	install -m755 dm $(ROOT)/etc/rc.d/init.d/
	install -m755 hibernate-cleanup.sh $(ROOT)/sbin/
	install -m755 lsb-init-functions $(ROOT)/lib/lsb/init-functions
	install -m755 mdv-network-event $(ROOT)/usr/sbin/
ifneq ($(shell if echo $(ARCH)|grep -q 'sparc';then echo sparc;fi),sparc)
	install -m755 supermount $(ROOT)/usr/sbin/
	install -m644 supermount.8 $(ROOT)$(mandir)/man8/
endif
# For Netscrape
ifeq ($(ARCH), alpha)
	@echo -e '\nbinfmt_aout' >> $(ROOT)/etc/modules
endif


localchangelog:
#svn2cl is available in our contrib.
	( cd ..; \
	svn cat `dirname $(SVNROOT)`/common/username.xml > $$TMPDIR/username.xml; \
	svn2cl --authors $$TMPDIR/username.xml --accum -o mandriva/ChangeLog; \
	rm -f mandriva/ChangeLog.bak $$TMPDIR/username.xml; \
	)

changelog: localchangelog
	svn commit -m "Generated by svn2cl the `date '+%c'`" ChangeLog

rpm: $(RPM) changelog source svntag diff build

source:
	[ -r $(RPM)/SOURCES/initscripts-$(VERSION).tar.bz2 ] || (cd $(RPM)/SOURCES/; rpm2cpio $(LOCALSRPM)/initscripts-$(VERSION)*.src.rpm|cpio -iuvm '*.tar.bz2';chmod 644 initscripts-*.tar.bz2 ;)

svntag:
	svn copy $(SVNCOPY) $(SVNROOT)/tags/$(RELTAG) -m "$(RELTAG)"

diff:
	cd ../; LC_ALL=C svn diff $(SVNROOT)/tags/$(RH_TAG) $(SVNCOPY) > $(RPM)/SOURCES/initscripts-mdkconf.patch

build:
	rpmbuild -ba $(RPMOPT) ../initscripts.spec

# special target to build the rpm without commiting to the svn base
localrpm: $(RPM) localchangelog source localdiff build

# FIXME: we need to diff working copy with a remote branch (from url)
localdiff: diff