SUBDIRS = po c python artwork man doc
WHOAMI != whoami
EXTRA_SCRIPTS=
nodist_bin_SCRIPTS=${PACKAGE_NAME}
dist_noinst_SCRIPTS=idjc.in.in bootstrap
nodist_doc_DATA=AUTHORS.gz NEWS.gz README.gz ChangeLog.gz
docdir=${prefix}/share/doc/${PACKAGE_NAME}-${PACKAGE_VERSION}
dist_noinst_DATA=idjc.desktop.in.in idjc-pw.desktop.in.in io.sourceforge.idjc.metainfo.xml.in.in
nodist_appmenu_DATA=idjc.desktop ${MAYBE_PW_DESKTOP}
appmenudir=${prefix}/share/applications
nodist_metainfo_DATA=io.sourceforge.idjc.metainfo.xml
metainfodir=${datadir}/metainfo
nodist_pkgdata_DATA=buildinfo

${PACKAGE_NAME} : idjc.in
	@sed -e 's|$${pkglibdir}|${pkglibdir}|g' $? -e 's|$${bindir}|${bindir}|g' >$@

idjc.desktop : idjc.desktop.in
	@sed -e 's|$${prefix}|${prefix}|g' -e 's|$${exec_prefix}|${exec_prefix}|g' $? >$@

idjc-pw.desktop : idjc-pw.desktop.in
	@sed -e 's|$${prefix}|${prefix}|g' -e 's|$${exec_prefix}|${exec_prefix}|g' $? >$@

io.sourceforge.idjc.metainfo.xml : io.sourceforge.idjc.metainfo.xml.in
	@sed -e 's|$${prefix}|${prefix}|g' -e 's|$${exec_prefix}|${exec_prefix}|g' $? >$@

AUTHORS.gz: AUTHORS
	@gzip -c $? >$@

NEWS.gz: NEWS
	@gzip -c $? >$@

README.gz: README
	@gzip -c $? >$@

ChangeLog.gz: ChangeLog
	@gzip -c $? >$@

buildinfo: ;

install-data-local:
if GIT_VERSION_CONTROL
 ifeq (${WHOAMI},root)
	echo Commit hash: $$(su ${USER} -c 'git log -n1 "--pretty=format:%H"') > $(top_builddir)/buildinfo
	echo Commit date: $$(su ${USER} -c 'git log -n1 "--pretty=format:%aD"') >> $(top_builddir)/buildinfo
	echo Repo status: $$(su ${USER} -c '$(top_srcdir)/repostatus') >> $(top_builddir)/buildinfo
	echo Remote URL: $$(su ${USER} -c 'git config --get remote.origin.url') >> $(top_builddir)/buildinfo
	echo >> $(top_builddir)/buildinfo
 else
	echo Commit hash: $$(git log -n1 "--pretty=format:%H") > $(top_builddir)/buildinfo
	echo Commit date: $$(git log -n1 "--pretty=format:%aD") >> $(top_builddir)/buildinfo
	echo Repo status: $$($(top_srcdir)/repostatus) >> $(top_builddir)/buildinfo
	echo Remote URL: $$(git config --get remote.origin.url) >> $(top_builddir)/buildinfo
	echo >> $(top_builddir)/buildinfo
 endif
else
	rm -f $(top_builddir)/buildinfo
endif
	echo Build date: $$(date -R) >> $(top_builddir)/buildinfo

clean-local:
	rm -f buildinfo ChangeLog.gz README.gz NEWS.gz AUTHORS.gz idjc.desktop idjc-pw.desktop io.sourceforge.idjc.metainfo.xml ${PACKAGE_NAME}

.PHONY: ${PACKAGE_NAME} io.sourceforge.idjc.desktop io.sourceforge.idjc-pw.desktop

ACLOCAL_AMFLAGS = -I m4

EXTRA_DIST = config.rpath m4/ChangeLog
