OSDN Git Service

debian: add newslash-searchd package
authorhylom <hylom@users.sourceforge.jp>
Fri, 2 Mar 2018 11:40:14 +0000 (20:40 +0900)
committerhylom <hylom@users.sourceforge.jp>
Fri, 2 Mar 2018 11:40:14 +0000 (20:40 +0900)
debian/control
debian/rules

index 0797444..d5967c1 100644 (file)
@@ -41,3 +41,9 @@ Depends:
 Description: Newslash's statics exporter for prometheus
   Newsslash is 'news lashing discussion platform'. This package include configuration files for srad.jp.
 
+Package: newslash-searchd
+Architecture: any
+Depends:
+ python, gunicorn, python-lucene, python-mysql.connector
+Description: Newslash's search daemon
+  Newsslash is 'news lashing discussion platform'. This package include configuration files for srad.jp.
index e7ab233..29453f2 100755 (executable)
@@ -7,6 +7,7 @@ ASSETS=newslash-sradjp-assets
 SRAD=newslash-sradjp
 UTILS=newslash-utils
 EXPORTER=newslash-prometheus-exporter
+SEARCHD=newslash-searchd
 
 SRCDIR=src/newslash_web
 UTILSDIR=src/utils
@@ -14,11 +15,14 @@ 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); \
@@ -92,3 +96,16 @@ 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)/
+
+