summaryrefslogtreecommitdiffstats
path: root/bin/updater/Makefile
blob: fc2c697fce2e1f9a6562b36bccb77cfd149c5f39 (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
all: install

install: install-systemd

clean:
	sudo rm -rf dist
	sudo rm -rf MANIFEST
	sudo rm -rf build
	sudo rm -rf owncloud_news_updater.egg-info


preinitsetup: clean
	mkdir -p /etc/owncloud/news
	cp $(CURDIR)/example-config.ini /etc/owncloud/news/updater.ini
	python3 setup.py install


install-systemd: preinitsetup
	cp $(CURDIR)/systemd/owncloud-news-updater.service /etc/systemd/system/

	@echo ""
	@echo "Installed files. Please edit your config in /etc/owncloud/news/updater.ini and run:"
	@echo "    systemctl enable owncloud-news-updater.service"
	@echo "    systemctl start owncloud-news-updater.service"
	@echo "to run the updater on startup and:"
	@echo "    systemctl restart owncloud-news-updater.service"
	@echo "to reload the changes if you change the config in /etc/owncloud/news/updater.ini"


install-sysvinit: preinitsetup
	cp $(CURDIR)/sysvinit/owncloud-news-updater /etc/init.d/

	@echo ""
	@echo "Installed files. Please edit your config in /etc/owncloud/news/updater.ini and run:"
	@echo "    sudo update-rc.d /etc/init.d/owncloud-news-updater defaults"
	@echo "    sudo /etc/init.d/owncloud-news-updater start"
	@echo "to run the updater on startup and:"
	@echo "    sudo /etc/init.d/owncloud-news-updater restart"
	@echo "to reload the changes if you change the config in /etc/owncloud/news/updater.ini"


make uninstall: clean
	rm -rf /etc/owncloud/news/updater.ini
	rm -rf /etc/systemd/systemd/owncloud-news-updater.service
	# TBD uninstall sysvinit
	pip3 uninstall owncloud_news_updater

	@echo ""
	@echo "Uninstalled files. Please run: "
	@echo "    systemctl disable owncloud-news-updater"
	@echo "to remove it from boot"