@echo "Files that need to be either removed or checked in:"
@bzr unknowns
-clean-local: clean-libtest-check clean-docs-check
+clean-local: clean-libtest-check clean-docs-check clean-rpm
lcov: lcov-clean check
maintainer-clean-local:
find . -type f -name '*~' -exec rm -f '{}' \;
- -rm -f @PACKAGE@-*.rpm
- -rm -f @PACKAGE@-*.tar.gz
-rm -f man/*.1
-rm -f man/*.3
-rm -f man/*.8
-rm -f build-aux/install-sh
-rm -f build-aux/ltmain.sh
-rm -f build-aux/missing
+ -rm -f build-aux/test-driver
-rm -f build-aux/ylwrap
-rm -f mem_config.in
-rm -f config.log
-rm -f m4/test-driver
-rmdir build-aux
-rm -rf ${top_builddir}/html
- -rm -f bootstrap
+ -rm -f $(DIST_ARCHIVES)
+# configure.ac -*- autoconf -*- vim: filetype=config
+#
# LibmemcacheD
# Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/
# Copyright (C) 2006-2010 Brian Aker, Monty Taylor, Trond Norbye
# the COPYING file in this directory for full text.
m4_include([version.m4])
+
AC_PREREQ([2.61])
AC_INIT([libmemcached],VERSION_NUMBER,[http://libmemcached.org/])
AX_HEX_VERSION([LIBMEMCACHED],[$VERSION])
AX_HEX_VERSION([LIBHASHKIT],[1.0.0])
+AC_SUBST([RPM_RELEASE],[1])
m4_include([libhashkit/include.m4])
AC_CHECK_PROGS([VALGRIND],['valgrind'])
AC_CHECK_PROGS([WINE],['wine'])
AC_CHECK_PROGS([YACC],['bison --warnings=all'],[:])
+AC_CHECK_PROGS([RPMBUILD],[rpmbuild --nocheck])
+AC_CHECK_PROGS([RPMDEV_SETUPTREE],[rpmdev-setuptree])
+AC_CHECK_PROGS([RPM],[rpm])
AC_PROG_AWK
AC_PROG_MKDIR_P
AC_PROG_SED
# vim:ft=automake
+#
-.PHONY: rpm-build
-rpm-build: support/$(PACKAGE).spec distcheck
- @rm -f *.rpm
- @rm -f ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-$(VERSION)*.rpm
- @rm -f ~/rpmbuild/SRPMS/$(PACKAGE)-$(VERSION)*.rpm
- @mkdir -p ~/rpmbuild/BUILD/
- @mkdir -p ~/rpmbuild/RPMS/i386/
- @mkdir -p ~/rpmbuild/RPMS/i686/
- @mkdir -p ~/rpmbuild/RPMS/noarch/
- @mkdir -p ~/rpmbuild/RPMS/x86_64/
- @mkdir -p ~/rpmbuild/SOURCES/
- @mkdir -p ~/rpmbuild/SPECS/
- @mkdir -p ~/rpmbuild/SRPMS/
- @cp $(PACKAGE)-$(VERSION).tar.gz ~/rpmbuild/SOURCES/
- @rpmbuild -ba support/$(PACKAGE).spec
- @cp ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-$(VERSION)*.rpm .
- @cp ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-devel-$(VERSION)*.rpm .
- -cp ~/rpmbuild/RPMS/x86_64/$(PACKAGE)-debuginfo-$(VERSION)*.rpm .
- @cp ~/rpmbuild/SRPMS/$(PACKAGE)-$(VERSION)*.rpm .
+RPM_BUILDDIR= ~/rpmbuild
+
+RPM_BUILD_TARGET= @PACKAGE@-@VERSION@-@RPM_RELEASE@.@build_cpu@.rpm
+RPM_SOURCE= $(RPM_BUILDDIR)/SOURCES/$(DIST_ARCHIVES)
+
+RPMS=
+RPMS+= $(RPM_BUILD_TARGET)
+RPMS+= @PACKAGE@-devel-@VERSION@-@RPM_RELEASE@.@build_cpu@.rpm
+RPMS+= @PACKAGE@-debuginfo-@VERSION@-@RPM_RELEASE@.@build_cpu@.rpm
+
+SRPMS= @PACKAGE@-@VERSION@-@RPM_RELEASE@.src.rpm
+
+RPM_DIST= $(RPMS) $(SRPMS)
+
+BUILD_RPMS= $(foreach rpm_iterator,$(RPMS),$(addprefix $(RPM_BUILDDIR)/RPMS/@build_cpu@/, $(rpm_iterator)))
+BUILD_SRPMS= $(foreach srpm_iterator,$(SRPMS),$(addprefix $(RPM_BUILDDIR)/SRPMS/, $(srpm_iterator)))
+BUILD_RPM_DIR= $(RPM_BUILDDIR)/BUILD/@PACKAGE@-@VERSION@
+
+$(RPM_BUILDDIR):
+ @@RPMDEV_SETUPTREE@
+
+$(DIST_ARCHIVES): $(DISTFILES)
+ $(MAKE) $(AM_MAKEFLAGS) dist-gzip
+
+$(RPM_SOURCE): | $(RPM_BUILDDIR) $(DIST_ARCHIVES)
+ @rm -f $(BUILD_RPMS) $(BUILD_SRPMS) $(BUILD_RPM_DIR)
+ @cp $(DIST_ARCHIVES) $(RPM_SOURCE)
+
+$(RPM_BUILD_TARGET): $(RPM_SOURCE) support/@PACKAGE@.spec
+ @@RPMBUILD@ -ba $(top_srcdir)/support/@PACKAGE@.spec
+ @cp $(BUILD_RPMS) $(BUILD_SRPMS) .
.PHONY: rpm-sign
-rpm-sign: rpm-build
- @rpm --addsign *.rpm
- @rpm --checksig *.rpm
+rpm-sign: $(RPM_BUILD_TARGET)
+ @@RPM@ --addsign $(RPM_DIST)
+ @@RPM@ --checksig $(RPM_DIST)
.PHONY: clean-rpm
clean-rpm:
- @rm -f *.tar.gz
- @rm -f *.src.rpm
- @rm -f *.rpm
+ @rm -f $(BUILD_RPMS) $(BUILD_SRPMS) $(BUILD_RPM_SOURCE) $(BUILD_RPM_DIR) $(RPM_DIST)
-.PHONY: rpm
-rpm: clean-rpm support/$(PACKAGE).spec rpm-build
+rpm: $(RPM_BUILD_TARGET)
+dist-rpm: $(RPM_BUILD_TARGET)
.PHONY: release
release: rpm rpm-sign
.PHONY: auto-rpmbuild
-auto-rpmbuild:
- @auto-br-rpmbuild -ba support/libmemcached.spec
+auto-rpmbuild: support/@PACKAGE@.spec
+ @auto-br-rpmbuild -ba $(top_srcdir)/support/@PACKAGE@.spec