2019-11-28 18:54:57 +00:00
|
|
|
# -*- coding: utf-8; mode: makefile-gmake -*-
|
|
|
|
|
2019-12-04 15:48:36 +00:00
|
|
|
export GIT_URL=https://github.com/asciimoo/searx
|
|
|
|
export SEARX_URL=https://searx.me
|
2019-12-13 15:08:34 +00:00
|
|
|
export DOCS_URL=https://asciimoo.github.io/searx
|
2019-12-04 15:48:36 +00:00
|
|
|
|
2019-11-28 18:54:57 +00:00
|
|
|
PYOBJECTS = searx
|
2019-12-12 11:10:32 +00:00
|
|
|
DOC = docs
|
2019-11-28 18:54:57 +00:00
|
|
|
PY_SETUP_EXTRAS ?= \[test\]
|
|
|
|
|
2019-12-18 15:11:05 +00:00
|
|
|
PYDIST=./dist/py
|
|
|
|
PYBUILD=./build/py
|
|
|
|
|
2019-11-28 18:54:57 +00:00
|
|
|
include utils/makefile.include
|
|
|
|
include utils/makefile.python
|
2019-12-12 11:10:32 +00:00
|
|
|
include utils/makefile.sphinx
|
2019-11-28 18:54:57 +00:00
|
|
|
|
|
|
|
all: clean install
|
|
|
|
|
|
|
|
PHONY += help
|
|
|
|
help:
|
2019-11-28 19:05:29 +00:00
|
|
|
@echo ' test - run developer tests'
|
2019-12-12 11:10:32 +00:00
|
|
|
@echo ' docs - build documentation'
|
|
|
|
@echo ' docs-live - autobuild HTML documentation while editing'
|
2019-11-28 18:54:57 +00:00
|
|
|
@echo ' run - run developer instance'
|
|
|
|
@echo ' install - developer install (./local)'
|
|
|
|
@echo ' uninstall - uninstall (./local)'
|
2019-12-12 13:15:41 +00:00
|
|
|
@echo ' gh-pages - build docs & deploy on gh-pages branch'
|
2019-12-18 15:11:05 +00:00
|
|
|
@echo ' clean - drop builds and environments'
|
2020-03-01 06:56:46 +00:00
|
|
|
@echo ' project - re-build generic files of the searx project'
|
2020-03-25 13:09:47 +00:00
|
|
|
@echo ' themes - re-build build the source of the themes'
|
2020-03-25 13:50:39 +00:00
|
|
|
@echo ' docker - build Docker image'
|
2020-03-25 15:38:52 +00:00
|
|
|
@echo ' node.env - download & install npm dependencies locally'
|
2019-11-28 18:54:57 +00:00
|
|
|
@echo ''
|
|
|
|
@$(MAKE) -s -f utils/makefile.include make-help
|
|
|
|
@echo ''
|
|
|
|
@$(MAKE) -s -f utils/makefile.python python-help
|
|
|
|
|
|
|
|
PHONY += install
|
|
|
|
install: pyenvinstall
|
|
|
|
|
|
|
|
PHONY += uninstall
|
|
|
|
uninstall: pyenvuninstall
|
|
|
|
|
|
|
|
PHONY += clean
|
2020-03-25 15:38:52 +00:00
|
|
|
clean: pyclean node.clean
|
2019-11-28 18:54:57 +00:00
|
|
|
$(call cmd,common_clean)
|
|
|
|
|
|
|
|
PHONY += run
|
|
|
|
run: pyenvinstall
|
|
|
|
$(Q) ( \
|
|
|
|
sed -i -e "s/debug : False/debug : True/g" ./searx/settings.yml ; \
|
|
|
|
sleep 2 ; \
|
|
|
|
xdg-open http://127.0.0.1:8888/ ; \
|
|
|
|
sleep 3 ; \
|
|
|
|
sed -i -e "s/debug : True/debug : False/g" ./searx/settings.yml ; \
|
|
|
|
) &
|
|
|
|
$(PY_ENV)/bin/python ./searx/webapp.py
|
|
|
|
|
2019-12-12 11:10:32 +00:00
|
|
|
# docs
|
|
|
|
# ----
|
|
|
|
|
|
|
|
PHONY += docs
|
|
|
|
docs: pyenvinstall sphinx-doc
|
|
|
|
$(call cmd,sphinx,html,docs,docs)
|
|
|
|
|
|
|
|
PHONY += docs-live
|
|
|
|
docs-live: pyenvinstall sphinx-live
|
|
|
|
$(call cmd,sphinx_autobuild,html,docs,docs)
|
|
|
|
|
2019-12-13 11:58:46 +00:00
|
|
|
$(GH_PAGES)::
|
|
|
|
@echo "doc available at --> $(DOCS_URL)"
|
2019-12-12 11:10:32 +00:00
|
|
|
|
2020-03-01 06:56:46 +00:00
|
|
|
# update project files
|
|
|
|
# --------------------
|
|
|
|
|
2020-03-26 12:32:08 +00:00
|
|
|
PHONY += project engines.languages searx.brand useragents.update
|
2020-03-01 06:56:46 +00:00
|
|
|
|
2020-03-26 12:32:08 +00:00
|
|
|
project: useragents.update engines.languages searx.brand
|
2020-03-01 06:56:46 +00:00
|
|
|
|
2020-03-26 12:32:08 +00:00
|
|
|
engines.languages: pyenvinstall
|
|
|
|
$(Q)echo "fetch languages .."
|
|
|
|
$(Q)$(PY_ENV_ACT); python utils/fetch_languages.py
|
|
|
|
$(Q)echo "update searx/data/engines_languages.json"
|
|
|
|
$(Q)mv engines_languages.json searx/data/engines_languages.json
|
|
|
|
$(Q)echo "update searx/languages.py"
|
|
|
|
$(Q)mv languages.py searx/languages.py
|
|
|
|
|
|
|
|
useragents.update: pyenvinstall
|
|
|
|
$(Q)echo "Update searx/data/useragents.json with the most recent versions of Firefox."
|
|
|
|
$(Q)$(PY_ENV_ACT); python utils/fetch_firefox_version.py
|
2020-03-01 06:56:46 +00:00
|
|
|
|
2020-03-25 10:49:33 +00:00
|
|
|
searx.brand:
|
|
|
|
$(Q)echo "build searx/brand.py"
|
|
|
|
$(Q)echo "GIT_URL = '$(GIT_URL)'" > searx/brand.py
|
2020-03-26 09:58:25 +00:00
|
|
|
$(Q)echo "ISSUE_URL = 'https://github.com/asciimoo/searx/issues'" >> searx/brand.py
|
2020-03-25 10:49:33 +00:00
|
|
|
$(Q)echo "SEARX_URL = '$(SEARX_URL)'" >> searx/brand.py
|
|
|
|
$(Q)echo "DOCS_URL = '$(DOCS_URL)'" >> searx/brand.py
|
|
|
|
$(Q)echo "PUBLIC_INSTANCES = 'https://searx.space'" >> searx/brand.py
|
|
|
|
|
2020-03-25 15:38:52 +00:00
|
|
|
# node / npm
|
|
|
|
# ----------
|
|
|
|
|
|
|
|
node.env:
|
|
|
|
$(Q)./manage.sh npm_packages
|
|
|
|
|
|
|
|
node.clean:
|
|
|
|
$(Q)echo "CLEAN locally installed npm dependencies"
|
|
|
|
$(Q)rm -rf \
|
|
|
|
./node_modules \
|
|
|
|
./package-lock.json \
|
|
|
|
./searx/static/themes/oscar/package-lock.json \
|
|
|
|
./searx/static/themes/oscar/node_modules \
|
|
|
|
./searx/static/themes/simple/package-lock.json \
|
|
|
|
./searx/static/themes/simple/node_modules
|
|
|
|
|
2020-03-25 13:09:47 +00:00
|
|
|
# build themes
|
|
|
|
# ------------
|
|
|
|
|
|
|
|
PHONY += themes themes.oscar themes.simple
|
|
|
|
themes: themes.oscar themes.simple
|
|
|
|
|
|
|
|
themes.oscar:
|
|
|
|
$(Q)echo '[!] Grunt build : oscar theme'
|
2020-03-25 15:38:52 +00:00
|
|
|
$(Q)PATH="$$(npm bin):$$PATH" grunt --gruntfile "searx/static/themes/oscar/gruntfile.js"
|
2020-03-25 13:09:47 +00:00
|
|
|
|
|
|
|
themes.simple:
|
|
|
|
$(Q)echo '[!] Grunt build : simple theme'
|
2020-03-25 15:38:52 +00:00
|
|
|
$(Q)PATH="$$(npm bin):$$PATH" grunt --gruntfile "searx/static/themes/simple/gruntfile.js"
|
2020-03-25 13:09:47 +00:00
|
|
|
|
2020-03-25 13:50:39 +00:00
|
|
|
# docker
|
|
|
|
# ------
|
|
|
|
|
|
|
|
PHONY += docker
|
|
|
|
docker:
|
|
|
|
$(Q)./manage.sh docker_build
|
|
|
|
|
|
|
|
|
2019-11-28 19:05:29 +00:00
|
|
|
# test
|
|
|
|
# ----
|
|
|
|
|
2019-11-28 19:07:10 +00:00
|
|
|
PHONY += test test.pylint test.pep8 test.unit test.robot
|
2019-11-28 19:05:29 +00:00
|
|
|
|
2020-02-23 19:52:00 +00:00
|
|
|
test: test.pylint test.pep8 test.unit test.robot
|
|
|
|
|
2019-11-28 19:07:10 +00:00
|
|
|
# TODO: balance linting with pylint
|
2020-02-24 07:14:09 +00:00
|
|
|
test.pylint: pyenvinstall
|
2020-02-23 19:52:00 +00:00
|
|
|
$(call cmd,pylint,searx/preferences.py)
|
2020-02-23 21:51:07 +00:00
|
|
|
$(call cmd,pylint,searx/testing.py)
|
2019-11-28 19:05:29 +00:00
|
|
|
|
|
|
|
test.pep8: pyenvinstall
|
|
|
|
$(PY_ENV_ACT); ./manage.sh pep8_check
|
|
|
|
|
|
|
|
test.unit: pyenvinstall
|
|
|
|
$(PY_ENV_ACT); ./manage.sh unit_tests
|
|
|
|
|
|
|
|
test.robot: pyenvinstall
|
|
|
|
$(PY_ENV_ACT); ./manage.sh install_geckodriver
|
|
|
|
$(PY_ENV_ACT); ./manage.sh robot_tests
|
|
|
|
|
2019-11-28 18:54:57 +00:00
|
|
|
.PHONY: $(PHONY)
|