#!/usr/bin/make -f # # $Id$ prefix=/usr package = osgi-runner srvpackage = osgi-runner-server systemdpackage = osgi-runner-systemd clipackage = osgi-runner-client log4j2package = osgi-runner-log4j2 logstashpackage = osgi-runner-logstash testpackage = osgi-runner-test pkgversion=$(shell dpkg-parsechangelog | sed -rne 's/^Version: ([0-9.]+)[-+].*$$/\1/p') OSGI_HOME=/usr/share/$(package) OSGI_ETC=/etc/$(package) DEB_DH_ALWAYS_EXCLUDE := .svn INSTALL_PROGRAM = install %: dh $@ override_dh_strip_nondeterminism: override_dh_auto_build: clean:: rm -f install-indep rm -rf downloads rm -rf *~ debian/$(srvpackage) debian/$(systemdpackage) debian/$(clipackage) debian/$(log4j2package) debian/*~ debian/substvars debian/devhost.txt.gz debian/*.substvars debian/*.debhelper.log override_dh_auto_install: rm -rf debian/$(srvpackage) debian/$(clipackage) debian/$(log4j2package) debian/$(logstashpackage) ./fetch_bundles.sh mkdir -p debian/$(log4j2package)/etc/osgi-runner/adm.d mkdir -p debian/$(log4j2package)/etc/osgi-runner/adm.d.examples/log4j2 mkdir -p debian/$(log4j2package)$(OSGI_HOME)/bundle2 mkdir -p debian/$(logstashpackage)/etc/osgi-runner/adm.d.examples/log4j2-gelf mkdir -p debian/$(logstashpackage)$(OSGI_HOME)/bundle2 mkdir -p debian/$(srvpackage)$(OSGI_HOME)/sh mkdir -p debian/$(srvpackage)/etc mkdir -p debian/$(systemdpackage)/lib mkdir -p debian/$(systemdpackage)/usr/sbin # collect systemd (cd lib; tar --exclude=.svn --exclude='*~' -c -f - systemd) | (cd debian/$(systemdpackage)/lib; tar xf -) install -m 755 unix/osgi-runner-dump.sh debian/$(systemdpackage)/usr/sbin/osgi-runner-dump install -m 755 unix/osgi-runner-debug.sh debian/$(systemdpackage)/usr/sbin/osgi-runner-debug install -m 755 unix/osgi-runner-run.sh debian/$(systemdpackage)/usr/sbin/osgi-runner-run # collect srv (cd etc; tar --exclude=.svn --exclude='*~' --exclude='org.ops4j.pax.logging*' -c -f - default osgi-runner) | (cd debian/$(srvpackage)/etc; tar xf -) cp etc/osgi-runner/adm.d/org.ops4j.pax.logging.log4j2-cfg debian/$(log4j2package)/etc/osgi-runner/adm.d/org.ops4j.pax.logging.cfg cp etc/osgi-runner/adm.d/org.ops4j.pax.logging.log4j2-cfg debian/$(log4j2package)/etc/osgi-runner/adm.d.examples/log4j2/org.ops4j.pax.logging.cfg cp etc/osgi-runner/adm.d/org.ops4j.pax.logging.log4j2-gelf-cfg debian/$(logstashpackage)/etc/osgi-runner/adm.d.examples/log4j2-gelf/org.ops4j.pax.logging.cfg mkdir -p debian/$(srvpackage)$(OSGI_ETC)/sshd.d chmod 750 debian/$(srvpackage)$(OSGI_ETC)/sshd.d chmod 750 debian/$(srvpackage)$(OSGI_ETC)/htpasswd.d cp unix/unix.properties debian/$(srvpackage)$(OSGI_ETC)/conf.d mkdir debian/$(srvpackage)$(OSGI_HOME)/drivers install -m 755 unix/create-osgi-user.sh debian/$(srvpackage)$(OSGI_HOME)/sh install -m 755 unix/migrate-keys-properties.sh debian/$(srvpackage)$(OSGI_HOME)/sh install -m 755 unix/check-dirs.sh debian/$(srvpackage)$(OSGI_HOME)/sh install -m 755 unix/check-or-create-hostkey.sh debian/$(srvpackage)$(OSGI_HOME)/sh install -m 644 unix/load-config-include.sh debian/$(srvpackage)$(OSGI_HOME)/sh cp -pr downloads/lib debian/$(srvpackage)$(OSGI_HOME) cp -pr downloads/bundle1 debian/$(srvpackage)$(OSGI_HOME) cp -pr downloads/bundle2 debian/$(srvpackage)$(OSGI_HOME) cp -p downloads/bundle2-log4j2/*.jar debian/$(log4j2package)$(OSGI_HOME)/bundle2 cp -p downloads/bundle2-logstash/*.jar debian/$(logstashpackage)$(OSGI_HOME)/bundle2 cp -pr downloads/bundle3 debian/$(srvpackage)$(OSGI_HOME) cp -pr downloads/bundle4 debian/$(srvpackage)$(OSGI_HOME) cp -pr downloads/bundle5 debian/$(srvpackage)$(OSGI_HOME) cp -pr downloads/aux debian/$(srvpackage)$(OSGI_HOME) # collect client mkdir -p debian/$(clipackage)/usr/bin install -m 755 unix/osgi-cmd.sh debian/$(clipackage)/usr/bin/osgi-cmd install -m 755 unix/osgi-install.sh debian/$(clipackage)/usr/bin/osgi-install install -m 755 unix/osgi-shell.sh debian/$(clipackage)/usr/bin/osgi-shell # collect test mkdir -p debian/$(testpackage)$(OSGI_HOME)/test (cd test; tar --exclude=.svn --exclude='*~' -c -f - etc) | (cd debian/$(testpackage)$(OSGI_HOME)/test; tar xf -) mkdir -p debian/$(testpackage)/usr/bin install -m 755 unix/osgi-runner-test-setup.sh debian/$(testpackage)/usr/bin/osgi-runner-test-setup install -m 755 unix/osgi-runner-test.sh debian/$(testpackage)/usr/bin/osgi-runner-test