From be75c98a06d569fbaa2d86f92676af961795d094 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Fri, 21 Oct 2011 01:28:48 +0100 Subject: Add the mdkconf patch --- mandriva/Makefile | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 mandriva/Makefile (limited to 'mandriva/Makefile') diff --git a/mandriva/Makefile b/mandriva/Makefile new file mode 100644 index 00000000..f9c952a9 --- /dev/null +++ b/mandriva/Makefile @@ -0,0 +1,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 -- cgit v1.2.1