#!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk CORE=newslash-core ASSETS=newslash-sradjp-assets SRAD=newslash-sradjp UTILS=newslash-utils EXPORTER=newslash-prometheus-exporter SEARCHD=newslash-searchd SRCDIR=src/newslash_web UTILSDIR=src/utils CONFDIR=src/configs CORE_DEST=$(CURDIR)/debian/$(CORE)/usr/share/newslash CORE_ETC=$(CURDIR)/debian/$(CORE)/etc/newslash EXPORTERDIR=src/prometheus-newslash-exporter SEARCHD_DIR=src/ns_search ASSETS_DEST=$(CURDIR)/debian/$(ASSETS)/usr/share/newslash SRAD_DEST=$(CURDIR)/debian/$(SRAD)/usr/share/newslash UTILS_DEST=$(CURDIR)/debian/$(UTILS)/usr/share/newslash-utils EXPORTER_DEST=$(CURDIR)/debian/$(EXPORTER)/usr/share/newslash-prometheus-exporter SEARCHD_DEST=$(CURDIR)/debian/$(SEARCHD)/usr/share/newslash-searchd SEARCHD_ETC=$(CURDIR)/debian/$(SEARCHD)/etc/newslash install/$(CORE):: cd $(SRCDIR); \ find ./lib -name '*.pm' \ -exec install -pDm 644 {} $(CORE_DEST)/{} \; cd $(SRCDIR); \ find ./external/perllib -name '*.pm' \ -exec install -pDm 644 {} $(CORE_DEST)/{} \; install -pDm 755 $(SRCDIR)/script/newslash_web $(CORE_DEST)/script/newslash_web install -pDm 755 $(SRCDIR)/script/newslash_eventd $(CORE_DEST)/script/newslash_eventd install -pDm 755 $(SRCDIR)/script/newslash_feed_fetcher $(CORE_DEST)/script/newslash_feed_fetcher mkdir -m 755 -p $(CORE_ETC) install -pDm 644 $(CONFDIR)/newslash.conf.example $(CORE_ETC)/newslash.conf.example install/$(ASSETS):: cd $(SRCDIR); \ find css public templates ! -name '*~' \ -exec install -pDm 644 {} $(ASSETS_DEST)/{} \; cd $(SRCDIR); \ find ./external/bootstrap-3.3.7 ! -name '*~' ! -type l \ -exec install -pDm 644 {} $(ASSETS_DEST)/{} \; ln -sf ../external/bootstrap-3.3.7/fonts $(ASSETS_DEST)/public/fonts install -pDm 644 $(SRCDIR)/external/escape-html.js/js/escape-html.js $(ASSETS_DEST)/external/escape-html.js/js/escape-html.js ln -sf ../../external/escape-html.js/js/escape-html.js $(ASSETS_DEST)/public/js/escape-html.js install -pDm 644 $(SRCDIR)/public/robots.txt $(ASSETS_DEST)/public/robots.txt install -pDm 644 $(SRCDIR)/public/favicon.ico $(ASSETS_DEST)/public/ mkdir $(ASSETS_DEST)/public/css install/$(SRAD):: install -pDm 644 misc/newslash.service $(CURDIR)/debian/$(SRAD)/lib/systemd/system/newslash.service install -pDm 644 misc/newslash-eventd.service $(CURDIR)/debian/$(SRAD)/lib/systemd/system/newslash-eventd.service # install -pDm 644 $(SRCDIR)/newslash-web.production.json $(SRAD_DEST)/newslash-web.production.json # todo: restart systemd, add PIDFile dir install/$(UTILS):: mkdir -p -m 755 $(UTILS_DEST)/tools mkdir -p -m 755 $(UTILS_DEST)/migration_scripts cd $(UTILSDIR); \ find ./migration_scripts -name '*.pl' \ -exec install -pDm 644 {} $(UTILS_DEST)/{} \; cd $(UTILSDIR); \ find ./migration_scripts -name '*.txt' \ -exec install -pDm 644 {} $(UTILS_DEST)/{} \; cd $(UTILSDIR); \ find ./migration_scripts -name '*.json' \ -exec install -pDm 644 {} $(UTILS_DEST)/{} \; cd $(UTILSDIR); \ find ./tools -name '*.pl' \ -exec install -pDm 644 {} $(UTILS_DEST)/{} \; install/$(EXPORTER):: install -pDm 755 $(EXPORTERDIR)/newslash-exporter.py $(EXPORTER_DEST)/newslash-exporter.py install -pDm 644 $(EXPORTERDIR)/newslash-prometheus-exporter.service \ $(CURDIR)/debian/$(EXPORTER)/lib/systemd/system/newslash-prometheus-exporter.service install/$(SEARCHD):: mkdir -p -m 755 $(SEARCHD_DEST)/modules mkdir -p -m 755 $(SEARCHD_ETC) cd $(SEARCHD_DIR); for target in newslash_db newslash_searchd newslash_index lucene_wrapper; do \ mkdir -p $(SEARCHD_DEST)/modules/$$target ; \ find $$target -name '*.py' -exec install -pDm 644 {} $(SEARCHD_DEST)/modules/{} \; ; \ done install -pDm 755 $(SEARCHD_DIR)/searchd.py $(SEARCHD_DEST)/modules/ install -pDm 755 $(SEARCHD_DIR)/searchd_cli.py $(SEARCHD_DEST)/modules/ install -pDm 644 $(SEARCHD_DIR)/searchd.conf.example $(SEARCHD_ETC)/ install -pDm 644 misc/newslash-searchd.service $(CURDIR)/debian/$(SEARCHD)/lib/systemd/system/newslash-searchd.service