RPM update.
authorBrian Aker <brian@tangent.org>
Sun, 9 Feb 2014 07:28:22 +0000 (23:28 -0800)
committerBrian Aker <brian@tangent.org>
Sun, 9 Feb 2014 07:28:22 +0000 (23:28 -0800)
.bzrignore
GNUmakefile
Makefile.am
bootstrap.sh
configure.ac
rpm/include.am
support/libmemcached.spec.in

index 652e9d91312315becbd2101f7a2769ed3b7f736d..a140236c0d35f7962a035afb1b19c3c830c5007e 100644 (file)
@@ -32,6 +32,7 @@ Makefile.in
 TAGS
 aclocal.m4
 aminclude.am
+artifacts
 autom4te.cache
 autoscan.log
 build-aux/
index 33ec5acc4415ee30931807e07585b9eb7a33b76d..b105d0131e2f41122c3580c0dc58ab0124ea1bd8 100644 (file)
@@ -1,4 +1,4 @@
-# -*-Makefile-*-
+# vim:ft=make
 #
 _bootstrap_Makefile := $(wildcard [M]akefile)
 _bootstrap_config-status := $(wildcard config.status)
index 7432e682d45d3cb5fe2dbc429892d5cc7c8e7c47..d001031047c8c09b3b6963d943f8094b6e4c9539 100644 (file)
@@ -104,7 +104,7 @@ merge-clean:
        @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
@@ -126,8 +126,6 @@ DISTCLEANFILES+= config/top.h
 
 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
@@ -141,6 +139,7 @@ maintainer-clean-local:
        -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
@@ -154,4 +153,4 @@ maintainer-clean-local:
        -rm -f m4/test-driver
        -rmdir build-aux
        -rm -rf ${top_builddir}/html
-       -rm -f bootstrap
+       -rm -f $(DIST_ARCHIVES)
index 5a7cb779f7885a8b690732be9e4fc646d34f9d3c..6f6821b765ff3fe10ab1650f868c6fb413e1f232 100755 (executable)
@@ -1014,7 +1014,10 @@ make_rpm ()
       mkdir -p ~/rpmbuild/RPMS/{i386,i486,i586,i686,noarch,athlon}
 
       run_configure_if_required
-      make_target 'rpm'
+      make_target 'dist-rpm'
+
+      mkdir artifacts
+      cp *gz *rpm artifacts
 
       if $jenkins_build_environment; then
         make_target 'clean'
index e74ebb7b0f5b49936e4e73ae9d7628b2fbae10e2..17b7351e3eabd1ece46ffaf636a456a60b2f1a78 100644 (file)
@@ -1,3 +1,5 @@
+# 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
@@ -7,6 +9,7 @@
 # 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/])
 
@@ -47,6 +50,7 @@ AC_SUBST([MEMCACHED_LIBRARY_VERSION])
 
 AX_HEX_VERSION([LIBMEMCACHED],[$VERSION])
 AX_HEX_VERSION([LIBHASHKIT],[1.0.0])
+AC_SUBST([RPM_RELEASE],[1])
 
 m4_include([libhashkit/include.m4])
 
@@ -120,6 +124,9 @@ AC_CHECK_PROGS([PERL],[perl])
 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
index 20967ab6c3ec7fd41140d0721e295c87be6c747f..313a67c79eb3887acf02ab1ef67545ccc3edbd41 100644 (file)
@@ -1,42 +1,53 @@
 # 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
index 6f0ebd8d5d9d6d90d852d7d36f045ebf4745b43b..a89e58d89d3ce3f58d03841f115e2d3cc2c83200 100644 (file)
@@ -1,7 +1,7 @@
 Name:      libmemcached
 Summary:   memcached C library and command line tools
 Version:   @VERSION@
-Release:   1
+Release:   @RPM_RELEASE@
 License:   BSD
 Group:     System Environment/Libraries
 URL:       http://launchpad.net/libmemcached