summaryrefslogtreecommitdiff
path: root/personal-pkgs-repo/Makefile
blob: 624a8959bc3964ba0e812f642a8cd1e1f8b6f260 (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
53
54
55
56
57
58
59
60
61
62
#
## Copyright (C) 2018 Karel Kočí
#
## This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
# #
#
include $(TOPDIR)/rules.mk

PKG_NAME:=personal-pkgs-repo
PKG_VERSION:=1.2
PKG_MAINTAINER:=Karel Kočí <cynerd@email.cz>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Package/$(PKG_NAME)
	TITLE:=Package with repository key
endef

define Build/Compile
	true
endef

define Package/$(PKG_NAME)/install
	$(INSTALL_DIR) $(1)/etc/opkg/keys
	$(INSTALL_DIR) $(1)/etc/updater/keys
	$(INSTALL_DATA) ./files/key.pub $(1)/etc/opkg/keys/6b76319bf5a9dc2
	$(INSTALL_DATA) ./files/key.pub $(1)/etc/updater/keys/personal-pkgs.pub

	$(INSTALL_DIR) $(1)/etc/updater/conf.d
	$(INSTALL_CONF) ./files/updater.lua $(1)/etc/updater/conf.d/personal-pkgs.lua

	$(INSTALL_DIR) $(1)/etc/updater/opkg-ignore
	echo ' personal ' >$(1)/etc/updater/opkg-ignore/personal-pkgs
endef

BOARD:=unknown
ifeq ($(CONFIG_TARGET_PROFILE),"DEVICE_turris-omnia")
	BOARD:=omnia
endif
ifeq ($(CONFIG_TARGET_PROFILE),"TURRIS")
	BOARD:=turris
endif
ifeq ($(CONFIG_TARGET_PROFILE),"DEVICE_cznic-mox")
	BOARD:=mox
endif

define Package/$(PKG_NAME)/postinst
#!/bin/sh
feedsfile="$$IPKG_INSTROOT/etc/opkg/customfeeds.conf"
sed -i '/^src\/gz personal/d' "$$feedsfile"
echo "src/gz personal https://cynerd.cz/repo/openwrt/$(BOARD)" >> "$$feedsfile"
endef

define Package/$(PKG_NAME)/prerm
#!/bin/sh
feedsfile="$$IPKG_INSTROOT/etc/opkg/customfeeds.conf"
sed -i '/^src\/gz personal/d' "$$feedsfile"
endef

$(eval $(call BuildPackage,$(PKG_NAME)))