powerguru-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Powerguru-commit] [SCM] powerguru branch, master, updated. 49104f905c35


From: Rob Savoye
Subject: [Powerguru-commit] [SCM] powerguru branch, master, updated. 49104f905c359cac5c714541b09836d56df37d99
Date: Sun, 13 Jan 2019 17:56:09 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "powerguru".

The branch, master has been updated
       via  49104f905c359cac5c714541b09836d56df37d99 (commit)
      from  5286698f5429410dd0dec9152e69eeffca976cd9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/powerguru.git/commit/?id=49104f905c359cac5c714541b09836d56df37d99


commit 49104f905c359cac5c714541b09836d56df37d99
Author: Rob Savoye <address@hidden>
Date:   Sun Jan 13 15:56:02 2019 -0700

    Include file to make rpms

diff --git a/Makefile.am b/Makefile.am
index 50566c5..94d8c8e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,6 +31,9 @@ if BUILD_SNMP
 SUBDIRS += snmp $(STD_DIRS) #src
 endif
 
+# Build an RPM package
+include $(srcdir)/rpm/rpm.am
+
 # These are built now, as they depend on the the libraries
 SUBDIRS += devices client daemon # testsuite
 
@@ -50,35 +53,7 @@ EXTRA_DIST = \
        po/Makefile.in.in \
        po/POTFILES.in \
        web
-#      powerguru.glade2
-#      powerguru.glade2p
-
-#install-data-local:
-#      @$(NORMAL_INSTALL)
-#      if test -d $(srcdir)/pixmaps; then \
-#        $(mkinstalldirs) $(datadir)/pixmaps/$(PACKAGE); \
-#        for pixmap in $(srcdir)/pixmaps/*; do \
-#          if test -f $$pixmap; then \
-#            $(INSTALL_DATA) $$pixmap $(DESTDIR)$(datadir)/pixmaps/$(PACKAGE); 
\
-#          fi \
-#        done \
-#      fi
-
-#install-doc:
-#      @cd doc/C ; $(MAKE) install-doc
-
-#doc:
-#      @cd doc/C ; $(MAKE) alldocs
-
-#dist-hook:
-#      if test -d pixmaps; then \
-#        mkdir $(distdir)/pixmaps; \
-#        for pixmap in pixmaps/*; do \
-#          if test -f $$pixmap; then \
-#            cp -p $$pixmap $(distdir)/pixmaps; \
-#          fi \
-#        done \
-#      fi
+
 
 # Install executables into qemu, which we do a lot when experimenting with
 # toolchains and cross compiing something that actually works.
@@ -126,7 +101,9 @@ cppclean:
 dump:
        @echo "Dumping configure options"
 if BUILD_SNMP
-       @echo " Building with net-snmp"
+
+
address@hidden "        Building with net-snmp"
 endif
 if BUILD_LIBXML
        @echo " Building with libxml2"
@@ -155,3 +132,7 @@ if BUILD_CROSS
        @echo " User supplied sysroot: $(sysroot)"
        @echo " Libc.so is from here: `${CXX} -print-file-name=libc.so`"
 endif
+
+clean:
+       @-$(RM) -fr powerguru_* pypowerguru_* \
+               powerguru-*dev powerguru*.bz2 *.sum *.log
diff --git a/rpm/rpm.am b/rpm/rpm.am
new file mode 100644
index 0000000..d773bdd
--- /dev/null
+++ b/rpm/rpm.am
@@ -0,0 +1,95 @@
+# 
+# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+#               2014, 2015, 2016, 2017, 2018, 2019
+#   Free Software Foundation, Inc.
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+# 
+
+RPMBUILD_DIR = $(abs_top_builddir)/rpmbuild
+RPMMACROS = $(abs_top_builddir)/.rpmmacros
+RPMSPEC = $(abs_top_builddir)/powerguru.spec
+RPMBUILD_FLAGS = --macros=/usr/lib/rpm/macros:$(RPMMACROS)
+
+powerguru.spec spec: $(srcdir)/packaging/redhat/powerguru.spec
+       mkdir -p $(RPMBUILD_DIR); \
+       echo "%_topdir $(RPMBUILD_DIR)" > $(RPMMACROS); \
+       snapshot_version=$(SNAPSHOT_VERSION); \
+       snapshot_release=`echo $${snapshot_version}|grep "~"|sed 
's/.*~\(.*\)/0.1.\1/'`; \
+       snapshot_version=`echo $${snapshot_version}|cut -d"~" -f1`; \
+       if [ "$${snapshot_release}" = "" ];then snapshot_release=1;fi; \
+       distro=`lsb_release -is`; \
+       echo "Editing the version in the spec file to be $${snapshot_version} 
$${snapshot_release} for Distribution $${distro}..."; \
+       sed -e "s/Version.*/Version:    $${snapshot_version}/" \
+           -e "s/Release.*/Release:    $${snapshot_release}/" \
+           -e "s/Distribution:.*/Distribution:   $${distro}/" 
$(srcdir)/packaging/redhat/powerguru.spec > $(RPMSPEC)
+
+
+# Build an Redhat/Fedora .rpm package
+# We do this by using the source snapshot that we know is 'distclean'.
+# After copying the source tarball to where rpmbuild expects it,
+# we can then build the binary package.
+# older versions of Fedora used /usr/src/redhat/{SOURCES, BUILD} for
+# everything, but the newer version appears to use one's home directory
+# instead, so now you don't have to be root to build rpm packages.
+
+# Do the entire process to build an RPM package
+rpm: distdir spec setup-rpm rpm-powerguru
+
+# build everything in one pass using rpmbuild. This was using
+# --sign powerguru.spec, but it didn't work for the automated builds.
+rpm-powerguru: 
+       rpmbuild -ba $(RPMBUILD_FLAGS) $(RPMSPEC)
+
+# configure the build directory, which we do by executing only the %prep stage,
+# which doesn't actually run configure
+rpm-configure: 
+       rpmbuild -bp $(RPMBUILD_FLAGS) $(RPMSPEC)
+
+# compile the build, which we do by executing only the %build stage, which
+# runs configure as the first step.
+rpm-build:
+       rpmbuild -bc --short-circuit $(RPMBUILD_FLAGS) $(RPMSPEC)
+
+# install the build, which we do by executing only the %install stage, which
+# also builds the actual rpms
+rpm-install: 
+       rpmbuild -bi --short-circuit $(RPMBUILD_FLAGS) $(RPMSPEC)
+
+# After distdir is done, all we have is an empty subdirectory
+# populated from the *_DIST variables used by Automake. RPM and Deb
+# naming conventions are similar, but just different enough that the
+# source directory and tarball names are subtely different, namely
+# Debian uses a '~' character in their version names, which rpmbuild
+# doesn't like, so for an RPM we convert it to a '_' instead. Then we
+# have to rename the subdirectory to match the new version of the
+# snapshot, and edit the configure* files to have the proper version
+# name.
+# Unlike creating a deb, which build their own source tarball, rpm
+# requires we do it ourselves, and copy it to $HOME/rpmbuild/SOURCES
+# before rpmbuild will work.
+setup-rpm: 
+       snapshot_version=$(SNAPSHOT_VERSION); \
+       snapshot_dir="powerguru-`echo $${snapshot_version}|cut -d"~" -f1`"; \
+       if test -d powerguru-$(PACKAGE_VERSION); then \
+         mv powerguru-$(PACKAGE_VERSION) $${snapshot_dir}; \
+       fi; \
+       tar zcf $${snapshot_dir}.tar.gz \
+         --exclude=$${snapshot_dir}/autom4te.cache \
+         --exclude=$${snapshot_dir}/configure.ac.orig \
+         --exclude=$${snapshot_dir}/configure.orig $${snapshot_dir}; \
+       mkdir -p $(RPMBUILD_DIR)/SOURCES; \
+       cp $${snapshot_dir}.tar.gz $(RPMBUILD_DIR)/SOURCES
+
+.PHONY : rpm distdir redhat spec rpm-configure rpm-install rpm-build setup-rpm

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am | 41 +++++++-------------------
 rpm/rpm.am  | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 106 insertions(+), 30 deletions(-)
 create mode 100644 rpm/rpm.am


hooks/post-receive
-- 
powerguru



reply via email to

[Prev in Thread] Current Thread [Next in Thread]