# $Progeny$

etc_files=		${srcdir}/discover.conf \
			${srcdir}/discover-modprobe.conf \
			${srcdir}/conffile.dtd

all: ${etc_files}

###############################################################################
# Clean

clean_FILES=		#none
distclean_FILES=	Makefile

clean:

distclean:
	rm -rf ${clean_FILES} ${distclean_FILES}

maintainer-clean:
	rm -rf ${clean_FILES} ${distclean_FILES}

###############################################################################
# Installation

install: ${etc_files}
	${INSTALL_DIR} ${DESTDIR}${sysconfdir}
	${INSTALL_DIR} ${DESTDIR}${sysconfdir}/discover.conf.d
	${INSTALL_DIR} ${DESTDIR}${datadir}/discover/dtd
	if [ ! -f ${DESTDIR}${sysconfdir}/discover.conf.d/00discover ]; then \
		${INSTALL_DATA} ${srcdir}/discover.conf			\
			${DESTDIR}${sysconfdir}/discover.conf.d/00discover; \
	fi
	if [ ! -f ${DESTDIR}${sysconfdir}/discover-modprobe.conf ]; then \
		${INSTALL_DATA} ${srcdir}/discover-modprobe.conf	\
			${DESTDIR}${sysconfdir}/discover-modprobe.conf;	\
	else	\
		${INSTALL_DATA} ${srcdir}/discover-modprobe.conf \
			${DESTDIR}${sysconfdir}/discover-modprobe.conf.example;	\
	fi
	${INSTALL_DATA} ${srcdir}/conffile.dtd \
			  ${DESTDIR}${datadir}/discover/dtd/conffile.dtd

uninstall:
	rm -f ${DESTDIR}${sysconfdir}/discover.conf.example
	rm -f ${DESTDIR}${sysconfdir}/discover-modprobe.conf.example
	rm -f ${DESTDIR}${datadir}/discover/dtd/conffile.dtd


###############################################################################
# Distribution

DISTFILES=		Makefile.in conffile.dtd discover.conf \
			discover-modprobe.conf

distdir: ${DISTFILES}
	${top_srcdir}/buildtools/distdir ${distdir}/${_THISDIR_} ${DISTFILES}
