OSDN Git Service

Plugin::Sendmail: fix warning message
[newslash/newslash.git] / debian / rules
1 #!/usr/bin/make -f
2
3 include /usr/share/cdbs/1/rules/debhelper.mk
4
5 CORE=newslash-core
6 ASSETS=newslash-sradjp-assets
7 SRAD=newslash-sradjp
8 UTILS=newslash-utils
9 EXPORTER=newslash-prometheus-exporter
10 SEARCHD=newslash-searchd
11
12 SRCDIR=src/newslash_web
13 UTILSDIR=src/utils
14 CONFDIR=src/configs
15 CORE_DEST=$(CURDIR)/debian/$(CORE)/usr/share/newslash
16 CORE_ETC=$(CURDIR)/debian/$(CORE)/etc/newslash
17 EXPORTERDIR=src/prometheus-newslash-exporter
18 SEARCHD_DIR=src/ns_search
19
20 ASSETS_DEST=$(CURDIR)/debian/$(ASSETS)/usr/share/newslash
21 SRAD_DEST=$(CURDIR)/debian/$(SRAD)/usr/share/newslash
22 UTILS_DEST=$(CURDIR)/debian/$(UTILS)/usr/share/newslash-utils
23 EXPORTER_DEST=$(CURDIR)/debian/$(EXPORTER)/usr/share/newslash-prometheus-exporter
24 SEARCHD_DEST=$(CURDIR)/debian/$(SEARCHD)/usr/share/newslash-searchd
25 SEARCHD_ETC=$(CURDIR)/debian/$(SEARCHD)/etc/newslash
26
27 install/$(CORE)::
28         cd $(SRCDIR); \
29         find ./lib -name '*.pm' \
30           -exec install -pDm 644 {} $(CORE_DEST)/{} \;
31         cd $(SRCDIR); \
32         find ./external/perllib -name '*.pm' \
33           -exec install -pDm 644 {} $(CORE_DEST)/{} \;
34         install -pDm 755 $(SRCDIR)/script/newslash_web $(CORE_DEST)/script/newslash_web
35         install -pDm 755 $(SRCDIR)/script/newslash_eventd $(CORE_DEST)/script/newslash_eventd
36         install -pDm 755 $(SRCDIR)/script/newslash_feed_fetcher $(CORE_DEST)/script/newslash_feed_fetcher
37         mkdir -m 755 -p $(CORE_ETC)
38         install -pDm 644 $(CONFDIR)/newslash.conf.example $(CORE_ETC)/newslash.conf.example
39
40
41 install/$(ASSETS)::
42         cd $(SRCDIR); \
43         find css public templates ! -name '*~' \
44           -exec install -pDm 644 {} $(ASSETS_DEST)/{} \;
45         cd $(SRCDIR); \
46         find ./external/bootstrap-3.3.7 ! -name '*~' ! -type l \
47           -exec install -pDm 644 {} $(ASSETS_DEST)/{} \;
48         ln -sf ../external/bootstrap-3.3.7/fonts $(ASSETS_DEST)/public/fonts
49         install -pDm 644 $(SRCDIR)/external/escape-html.js/js/escape-html.js $(ASSETS_DEST)/external/escape-html.js/js/escape-html.js
50         ln -sf ../../external/escape-html.js/js/escape-html.js $(ASSETS_DEST)/public/js/escape-html.js
51         install -pDm 644 $(SRCDIR)/public/robots.txt $(ASSETS_DEST)/public/robots.txt
52         install -pDm 644 $(SRCDIR)/public/favicon.ico $(ASSETS_DEST)/public/
53         mkdir $(ASSETS_DEST)/public/css
54
55 install/$(SRAD)::
56         install -pDm 644 misc/newslash.service $(CURDIR)/debian/$(SRAD)/lib/systemd/system/newslash.service
57         install -pDm 644 misc/newslash-eventd.service $(CURDIR)/debian/$(SRAD)/lib/systemd/system/newslash-eventd.service
58 #       install -pDm 644 $(SRCDIR)/newslash-web.production.json $(SRAD_DEST)/newslash-web.production.json
59
60 # todo: restart systemd, add PIDFile dir
61
62 install/$(UTILS)::
63         mkdir -p -m 755 $(UTILS_DEST)/tools
64         mkdir -p -m 755 $(UTILS_DEST)/migration_scripts
65         cd $(UTILSDIR); \
66         find ./migration_scripts -name '*.pl' \
67           -exec install -pDm 644 {} $(UTILS_DEST)/{} \;
68         cd $(UTILSDIR); \
69         find ./migration_scripts -name '*.txt' \
70           -exec install -pDm 644 {} $(UTILS_DEST)/{} \;
71         cd $(UTILSDIR); \
72         find ./migration_scripts -name '*.json' \
73           -exec install -pDm 644 {} $(UTILS_DEST)/{} \;
74         cd $(UTILSDIR); \
75         find ./tools -name '*.pl' \
76           -exec install -pDm 644 {} $(UTILS_DEST)/{} \;
77
78 install/$(EXPORTER)::
79         install -pDm 755 $(EXPORTERDIR)/newslash-exporter.py $(EXPORTER_DEST)/newslash-exporter.py
80         install -pDm 644 $(EXPORTERDIR)/newslash-prometheus-exporter.service \
81           $(CURDIR)/debian/$(EXPORTER)/lib/systemd/system/newslash-prometheus-exporter.service
82
83 install/$(SEARCHD)::
84         mkdir -p -m 755 $(SEARCHD_DEST)/modules
85         mkdir -p -m 755 $(SEARCHD_ETC)
86         cd $(SEARCHD_DIR); for target in newslash_db newslash_searchd newslash_index lucene_wrapper; do \
87           mkdir -p $(SEARCHD_DEST)/modules/$$target ; \
88           find $$target -name '*.py' -exec install -pDm 644 {} $(SEARCHD_DEST)/modules/{} \; ; \
89           done
90         install -pDm 755 $(SEARCHD_DIR)/searchd.py $(SEARCHD_DEST)/modules/
91         install -pDm 755 $(SEARCHD_DIR)/searchd_cli.py $(SEARCHD_DEST)/modules/
92         install -pDm 644 $(SEARCHD_DIR)/searchd.conf.example $(SEARCHD_ETC)/
93         install -pDm 644 misc/newslash-searchd.service $(CURDIR)/debian/$(SEARCHD)/lib/systemd/system/newslash-searchd.service
94
95