From 87b0c4bc9ba2a42076bf070f16789de6253e2212 Mon Sep 17 00:00:00 2001 From: Richard Clamp Date: Tue, 29 Oct 2013 17:08:39 +0000 Subject: [PATCH] maint - make 'rake deb' work again It seemed to be that debian packages were built with the ext/debian/patches/makefile.patch which creates a Makefile, but instead debian/rules was calling on the Makefile in ext/ We can't really touch the Makefile in ext/ as that's also touched by the openbsd port, but we can make a new one called Makefile.debian and call on that instead. --- Rakefile | 1 - ext/Makefile.debian | 46 +++++++++++++++++++++++++++++++++++++++++++++ ext/debian/rules | 2 +- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 ext/Makefile.debian diff --git a/Rakefile b/Rakefile index 483c8c8d..849f39b0 100644 --- a/Rakefile +++ b/Rakefile @@ -170,7 +170,6 @@ task :deb => [:clean, :doc, :package] do Dir.chdir("#{PROJ_NAME}-#{CURRENT_VERSION}") do safe_system %{cp -R ext/debian .} safe_system %{cp -R ext/debian/mcollective.init .} - safe_system %{cp -R ext/Makefile .} File.open("debian/changelog", "w") do |f| f.puts("mcollective (#{CURRENT_VERSION}-#{CURRENT_RELEASE}) #{PKG_DEB_DISTRIBUTION}; urgency=low") diff --git a/ext/Makefile.debian b/ext/Makefile.debian new file mode 100644 index 00000000..dbb3ac72 --- /dev/null +++ b/ext/Makefile.debian @@ -0,0 +1,46 @@ +#!/usr/bin/make -f + +# This is the makefile used by debian/rules when invoked by rake deb + +DESTDIR= + +build: + +clean: + +install: install-bin install-lib install-conf install-plugins install-doc + +install-bin: + install -d $(DESTDIR)/usr/sbin + install -d $(DESTDIR)/usr/bin + cp bin/mc-* $(DESTDIR)/usr/sbin + cp bin/mco $(DESTDIR)/usr/bin + cp bin/mcollectived $(DESTDIR)/usr/sbin/mcollectived + +install-lib: + install -d $(DESTDIR)/usr/lib/ruby/vendor_ruby/ + cp -a lib/* $(DESTDIR)/usr/lib/ruby/vendor_ruby/ + +install-conf: + install -d $(DESTDIR)/etc/mcollective/ + install -d $(DESTDIR)/etc/init.d + cp -r etc/* $(DESTDIR)/etc/mcollective/ + cp mcollective.init $(DESTDIR)/etc/init.d/mcollective + rm $(DESTDIR)/etc/mcollective/ssl/PLACEHOLDER + rm $(DESTDIR)/etc/mcollective/ssl/clients/PLACEHOLDER + +install-plugins: + install -d $(DESTDIR)/usr/share/mcollective/ + cp -a plugins $(DESTDIR)/usr/share/mcollective/ + +install-doc: + install -d $(DESTDIR)/usr/share/doc/ + cp -a doc $(DESTDIR)/usr/share/doc/mcollective + +uninstall: + rm -f $(DESTDIR)/usr/sbin/mcollectived + rm -rf $(DESTDIR)/usr/lib/ruby/1.8/mcollective* + rm -rf $(DESTDIR)/usr/share/mcollective + rm -rf $(DESTDIR)/etc/mcollective + +.PHONY: build clean install uninstall diff --git a/ext/debian/rules b/ext/debian/rules index 2551380d..966ff75c 100755 --- a/ext/debian/rules +++ b/ext/debian/rules @@ -6,7 +6,7 @@ DEB_MAKE_INSTALL_TARGET := install DESTDIR=$(CURDIR)/debian/tmp include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/rules/dpatch.mk include /usr/share/cdbs/1/class/makefile.mk -DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -f ext/Makefile -C $(DEB_BUILDDIR) +DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -f ext/Makefile.debian -C $(DEB_BUILDDIR) install/mcollective:: mv $(CURDIR)/debian/tmp/etc/mcollective/server.cfg.dist $(CURDIR)/debian/tmp/etc/mcollective/server.cfg