LOCAL_INSTALL=local_install
LOCAL_POSTINSTALL=local_postinstall
LOCAL_CLEAN=local_clean
DIRS = misc translate dialog xconf askrunlevel netconf dnsconf mailconf \
	uucp userconf fstab main conf.files help.files images apache vpop3d

include rules.mak

# preset info for gdebug
dbg:
	dbgset -a. -b. -m/tmp/modules.dbg -r/tmp/ctrl.dbg -t/tmp/types.lst $(DIRS)
	typidx /tmp/types.lst  /tmp/types.dbg


package: strip package.gen

package-nostrip: package.gen

package-src: clean
	(cd ..; \
	tar zcvf /x/xconf/linuxconf-$(PACKAGE_REV).src.tar.gz \
		linuxconf-$(PACKAGE_REV) )

install.dir:
	mkdir -p /install
	cp conf.files/doinst.sh /install
	cp conf.files/uninstall_linuxconf.sh /install
	chmod +x /install/doinst.sh /install/uninstall_linuxconf.sh
	cp conf.files/rc.M /install
	cp conf.files/conf.linuxconf-redhat-4.0 /install
	cp conf.files/conf.linuxconf-debian /install
	cp conf.files/inittab.redhat /install
	cp conf.files/inittab.redhat-4.0 /install
	cp conf.files/inittab.debian /install
	chmod +x /install/rc.M


package.gen: install.dir
	(cd /; tar zcvf /tmp/linuxconf-$(PACKAGE_REV).bin-$(BINFORM).tar.gz \
		bin/linuxconf usr/lib/linuxconf \
		install/doinst.sh \
		/install/uninstall_linuxconf.sh \
		var/run/netconf.level \
		install/rc.M \
		install/conf.linuxconf-debian \
		install/conf.linuxconf-redhat-4.0 \
		install/inittab.debian \
		install/inittab.redhat-4.0 \
		install/inittab.redhat)

#		usr/lib/terminfo/c/con80x25 \
#		usr/lib/terminfo/l/linux \
#		var/named/root.cache \

strip:
	strip /bin/linuxconf

	

ANNOUNCE: ANNOUNCE.txt translate/sgml2flat
	@translate/sgml2flat $< $@
	@rm -f $< ANNOUNCE*.html

translate/sgml2flat: translate/sgml2flat.c
	make -C translate sgml2flat


local_install: 
	@echo
	@echo Installing linuxconf in /usr/lib/linuxconf
	@echo The main utility is /bin/linuxconf
	@echo A bunch of symlinks are install in /bin and /sbin
	@echo
	@echo -n "Sleeping 4 seconds ..."
	@sleep 4
	@echo

local_postinstall: install.dir
	@echo
	@echo Checking RC scripts
	@sh /install/doinst.sh

local_clean:
	rm -f `find . -name \*.bak`

