simple-adblock: bugfix: proper error reporting on failed downloads; lists update...
[feed/packages.git] / net / simple-adblock / Makefile
1 # Copyright 2017-2018 Stan Grishin (stangri@melmac.net)
2 # TLD optimization written by Dirk Brenken (dev@brenken.org)
3 # This is free software, licensed under the GNU General Public License v3.
4
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=simple-adblock
8 PKG_VERSION:=1.8.3
9 PKG_RELEASE:=9
10 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
11 PKG_LICENSE:=GPL-3.0-or-later
12
13 include $(INCLUDE_DIR)/package.mk
14
15 define Package/simple-adblock
16 SECTION:=net
17 CATEGORY:=Network
18 TITLE:=Simple AdBlock Service
19 PKGARCH:=all
20 endef
21
22 define Package/simple-adblock/description
23 This service provides DNSMASQ or Unbound based ad blocking.
24 Please see the project's README on GitHub for further information.
25
26 endef
27
28 define Package/simple-adblock/conffiles
29 /etc/config/simple-adblock
30 endef
31
32 define Build/Prepare
33 mkdir -p $(PKG_BUILD_DIR)/files/
34 $(CP) ./files/simple-adblock.init $(PKG_BUILD_DIR)/files/simple-adblock.init
35 sed -i "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(PKG_BUILD_DIR)/files/simple-adblock.init
36 endef
37
38 define Build/Configure
39 endef
40
41 define Build/Compile
42 endef
43
44 define Package/simple-adblock/install
45 $(INSTALL_DIR) $(1)/etc/init.d
46 $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/simple-adblock.init $(1)/etc/init.d/simple-adblock
47 $(INSTALL_DIR) $(1)/etc/config
48 $(INSTALL_CONF) ./files/simple-adblock.conf $(1)/etc/config/simple-adblock
49 $(INSTALL_DIR) $(1)/tmp
50 $(INSTALL_CONF) ./files/simple-adblock.conf.update $(1)/tmp/simple-adblock.conf.update
51 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
52 $(INSTALL_BIN) ./files/simple-adblock.hotplug $(1)/etc/hotplug.d/iface/80-simple-adblock
53 endef
54
55 define Package/simple-adblock/postinst
56 #!/bin/sh
57 # check if we are on real system
58 if [ -z "$${IPKG_INSTROOT}" ]; then
59 sed -f /tmp/simple-adblock.conf.update -i /etc/config/simple-adblock || true
60 /etc/init.d/simple-adblock enable
61 fi
62 exit 0
63 endef
64
65 define Package/simple-adblock/prerm
66 #!/bin/sh
67 # check if we are on real system
68 if [ -z "$${IPKG_INSTROOT}" ]; then
69 echo "Stopping service and removing rc.d symlink for simple-adblock"
70 /etc/init.d/simple-adblock stop || true
71 /etc/init.d/simple-adblock killcache || true
72 /etc/init.d/simple-adblock disable || true
73 fi
74 exit 0
75 endef
76
77 $(eval $(call BuildPackage,simple-adblock))