Skip to content

Commit

Permalink
maint - make 'rake deb' work again
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
richardc committed Oct 29, 2013
1 parent 5f29f21 commit 87b0c4b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
46 changes: 46 additions & 0 deletions ext/Makefile.debian
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion ext/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 87b0c4b

Please sign in to comment.