gnunet-secushare: auto-configure database backend
authorDaniel Golle <redacted>
Sat, 2 Mar 2019 19:22:25 +0000 (20:22 +0100)
committerDaniel Golle <redacted>
Sat, 2 Mar 2019 19:22:25 +0000 (20:22 +0100)
Import uci-defaults scripts to auto-set psycstore database backend.

Signed-off-by: Daniel Golle <redacted>
net/gnunet-secushare/Makefile
net/gnunet-secushare/files/gnunet-secushare-mysql.defaults [new file with mode: 0644]
net/gnunet-secushare/files/gnunet-secushare-pgsql.defaults [moved from net/gnunet/files/gnunet-social-pgsql.defaults with 100% similarity]
net/gnunet-secushare/files/gnunet-secushare-sqlite.defaults [moved from net/gnunet/files/gnunet-social-sqlite.defaults with 100% similarity]

index 2462742fd205388279f140734d2578c280660458..ae98cb7c5ab0c01ea3e262a3d445e0e2d397eb72 100644 (file)
@@ -5,7 +5,7 @@ PKG_NAME:=gnunet-secushare
 PKG_SOURCE_VERSION:=81939cb93670efcee8e99884d10d2676b02edba9
 PKG_SOURCE_DATE:=20190228
 PKG_MIRROR_HASH:=64a0fb7ad6a515559360de71df85dde152f55a60585668f15114bc1f55cf2742
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_SOURCE_URL:=https://gnunet.org/git/gnunet-secushare.git
 PKG_SOURCE_PROTO:=git
 PKG_LICENSE:=GPL-3.0
@@ -83,16 +83,22 @@ endef
 define Package/gnunet-secushare-mysql/install
        $(INSTALL_DIR) $(1)/usr/lib/gnunet
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_psycstore_mysql.so* $(1)/usr/lib/gnunet/
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/gnunet-secushare-mysql.defaults $(1)/etc/uci-defaults/gnunet-secushare-mysql
 endef
 
 define Package/gnunet-secushare-pgsql/install
        $(INSTALL_DIR) $(1)/usr/lib/gnunet
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_psycstore_postgres.so* $(1)/usr/lib/gnunet/
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/gnunet-secushare-pgsql.defaults $(1)/etc/uci-defaults/gnunet-secushare-pgsql
 endef
 
 define Package/gnunet-secushare-sqlite/install
        $(INSTALL_DIR) $(1)/usr/lib/gnunet
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_psycstore_sqlite.so* $(1)/usr/lib/gnunet/
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/gnunet-secushare-sqlite.defaults $(1)/etc/uci-defaults/gnunet-secushare-sqlite
 endef
 
 $(eval $(call BuildPackage,gnunet-secushare))
diff --git a/net/gnunet-secushare/files/gnunet-secushare-mysql.defaults b/net/gnunet-secushare/files/gnunet-secushare-mysql.defaults
new file mode 100644 (file)
index 0000000..9954a60
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+uci -q get gnunet.psycstore || uci set gnunet.psycstore=gnunet-config
+
+uci -q batch <<EOF
+       set gnunet.psycstore.DATABASE=mysql
+       commit gnunet
+EOF
git clone https://git.99rst.org/PROJECT