aboutsummaryrefslogtreecommitdiffhomepage
path: root/sundry/spine_search_cgi/makefile
blob: 4f2747d84fc4d817963c11d4635b73b9239b70f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
SpineBIN          := "${SpineBIN}" # 'result/bin'
SpineOUT          := "${SpineOUT}" # '/srv/www/spine'
SpinePOD          := "${SpinePOD}" # '/grotto-ra/repo/git.repo/projects/project-spine/doc-reform-markup/spine-markup-samples/markup/pod'
SpineSearchAction := 'https://sisudoc.org/spine_search'
SpineCGIform      := 'spine_search'
SpineSQLdb        := 'spine.search.db'

# nix build
build:
	nix-build

# cp cgi search form
cp-cgi:
	sudo cp -vi /var/www/cgi/cgi-bin/spine_search /var/www/cgi/cgi-bin/spine_search_old && \
	sudo cp -vi result/share/cgi-bin/spine_search /var/www/cgi/cgi-bin/spine_search

get_depends:
	hwd=$$(echo `pwd`) && \
	gwd="$${hwd}/src/ext_depends_cgi" && \
	dirs=$$(echo `ls -gx $${gwd}`) && \
	license_bsl="Boost Software License 1.0 (BSL-1.0)" && \
	echo $${hwd} && \
	echo $${gwd} && \
	echo $${deps} && \
	dub upgrade; \
	cd $${gwd} && \
	for dir in $${deps}; do \
	  if [ -d $${dir} ]; then \
	    echo $${dir} && \
	    if [[ "arsd" == $${dir} ]]; then \
	      echo $${dir} && \
	      rm -rf $${dir} && \
          mkdir $${dir} && \
          aria2c -o "$${dir}/cgi.d" "https://raw.githubusercontent.com/adamdruppe/arsd/master/cgi.d" && \
	      cd $${gwd}; \
	    elif [[ "d2sqlite3" == $${dir} ]]; then \
	      echo $${dir} && \
	      rm -rf $${dir} && \
	      git clone --depth=1 https://github.com/dlang-community/$${dir} && \
	      cd $${dir} && \
	      echo "$${dir} `git rev-parse HEAD | cut -c 1-8`"   > ../$${dir}.meta && \
	      echo "https://github.com/dlang-community/$${dir}" >> ../$${dir}.meta && \
	      echo "$${license_bsl}"                            >> ../$${dir}.meta && \
	      cd $${gwd} && \
	      rm -rf $${dir}/.git; \
	    fi; \
	  fi; \
	done; \
	cd $${hwd}

set_depends: get_depends
	dub describe | sed 's~$(shell echo `pwd | sed 's_/_\\/_g'`)~.~g'  > dub_describe.json