diff --git a/Makefile.am b/Makefile.am index 92060bb..69fbebd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,9 +4,24 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = api epplets -#EXTRA_DIST = +EXTRA_DIST = $(PACKAGE).spec.in MAINTAINERCLEANFILES = \ Makefile.in aclocal.m4 compile config.* configure depcomp \ install-sh ltmain.sh missing */Makefile.in +CLEANFILES = $(PACKAGE).spec + +if SRC_IS_GIT +RPM_RELEASE=`echo -n "1.%(date '+%y%m%d').git"; git rev-parse --short=8 HEAD` +else +RPM_RELEASE=`echo -n "1.%(date '+%y%m%d')"` +endif + +dist-hook: $(top_builddir)/$(PACKAGE).spec + +$(top_builddir)/$(PACKAGE).spec: FORCE + sed "s/\@PACKAGE\@/@PACKAGE@/;s/\@VERSION\@/@VERSION@/;s/\@RPM_RELEASE\@/$(RPM_RELEASE)/" \ + $(top_srcdir)/$(PACKAGE).spec.in > $@ + +FORCE: diff --git a/configure.ac b/configure.ac index b64dbbb..7697e16 100644 --- a/configure.ac +++ b/configure.ac @@ -7,6 +7,8 @@ AC_INIT([e16-epplets],[pkg_version],[enlightenment-devel@lists.sourceforge.net]) AM_INIT_AUTOMAKE([foreign dist-xz]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +AM_CONDITIONAL(SRC_IS_GIT, test -d $srcdir/.git) + AC_CONFIG_MACRO_DIR([m4]) AC_SUBST(E_RPM_REVISION, [rpm_revision]) @@ -142,7 +144,6 @@ Makefile api/Makefile epplets/Makefile api/epplet.h -e16-epplets.spec ]) AC_OUTPUT diff --git a/e16-epplets.spec.in b/e16-epplets.spec.in index 625bf41..9539736 100644 --- a/e16-epplets.spec.in +++ b/e16-epplets.spec.in @@ -1,7 +1,7 @@ Summary: Enlightenment Epplets Name: @PACKAGE@ Version: @VERSION@ -Release: @E_RPM_REVISION@%{?_vendorsuffix:.%{_vendorsuffix}} +Release: @RPM_RELEASE@%{?_vendorsuffix:.%{_vendorsuffix}} License: BSD Group: User Interface/Desktops URL: http://www.enlightenment.org/