Browse Source

gnunet: use templates to package components

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Daniel Golle 9 years ago
parent
commit
93584e3cbe
1 changed files with 107 additions and 188 deletions
  1. 107
    188
      net/gnunet/Makefile

+ 107
- 188
net/gnunet/Makefile View File

@@ -10,10 +10,9 @@ include $(TOPDIR)/rules.mk
10 10
 PKG_NAME:=gnunet
11 11
 PKG_SOURCE_VERSION:=35856
12 12
 PKG_VERSION:=0.10.1-svn$(PKG_SOURCE_VERSION)
13
-PKG_RELEASE:=2
13
+PKG_RELEASE:=3
14 14
 
15 15
 # ToDo:
16
-#  - build packages using templates and lists
17 16
 #  - break-out transports
18 17
 #    -> get rid of microhttpd and gnurl dependency for gns and vpn
19 18
 #       requires upstream to split config files
@@ -50,19 +49,24 @@ CONFIGURE_ARGS+= \
50 49
 # ToDo: request upstream to provide --with-pulseaudio=...
51 50
 TARGET_LDFLAGS+= -Wl,-rpath-link=$(STAGING_DIR)/usr/lib/pulseaudio
52 51
 
53
-define Package/gnunet
52
+define Package/gnunet/Default
54 53
   SECTION:=net
55 54
   CATEGORY:=Network
56
-  TITLE:=GNUnet is peer-to-peer framework focusing on security
55
+  TITLE:=GNUnet
56
+  URL:=https://www.gnunet.org/
57
+endef
58
+
59
+define Package/gnunet
60
+$(call Package/gnunet/Default)
61
+  TITLE+= - a peer-to-peer framework focusing on security
57 62
   DEPENDS:=+ca-certificates +libgnurl +libgnutls +libidn +libltdl \
58 63
            +libmicrohttpd +libunistring +librt
59
-  URL:=https://www.gnunet.org/
60 64
   USERID:=gnunet=400:gnunet=400
61 65
   MENU:=1
62 66
 endef
63 67
 
64 68
 define Package/gnunet/description
65
- GNUnet is peer-to-peer framework focusing on security.  The first and
69
+ GNUnet is a peer-to-peer framework focusing on security. The first and
66 70
  primary application for GNUnet is anonymous file-sharing.  GNUnet is
67 71
  currently developed by a worldwide group of independent free software
68 72
  developers.  GNUnet is a GNU package (http://www.gnu.org/).
@@ -75,64 +79,52 @@ define Package/gnunet/description
75 79
  as their helpers.
76 80
 endef
77 81
 
78
-define Package/gnunet-conversation
79
-  SECTION:=net
80
-  CATEGORY:=Network
81
-  TITLE:=GNUnet conversation components
82
-  DEPENDS:=gnunet +gnunet-gns +libgst1app +libgst1audio \
83
-           +libgstreamer1 +glib2 +pulseaudio-daemon +libopus +libogg
84
-endef
85
-
86
-define Package/gnunet-experiments
87
-  SECTION:=net
88
-  CATEGORY:=Network
89
-  TITLE:=GNUnet experimental components
90
-  DEPENDS:=gnunet +libglpk
91
-endef
92
-
93
-define Package/gnunet-fs
94
-  SECTION:=net
95
-  CATEGORY:=Network
96
-  TITLE:=GNUnet file-sharing components
97
-  DEPENDS:=gnunet +gnunet-storage +libextractor
98
-endef
99
-
100
-define Package/gnunet-gns
101
-  SECTION:=net
102
-  CATEGORY:=Network
103
-  TITLE:=GNUnet GNS components
104
-  USERID:=gnunetdns=401:gnunetdns=401
105
-  DEPENDS:=gnunet +gnunet-vpn
106
-  DEFAULT:=y
107
-endef
108
-
109
-define Package/gnunet-storage
110
-  SECTION:=net
111
-  CATEGORY:=Network
112
-  TITLE:=GNUnet storage components
113
-  DEPENDS:=gnunet +gnunet-gns +libsqlite3
114
-endef
115
-
116
-define Package/gnunet-transport-bluetooth
117
-  SECTION:=net
118
-  CATEGORY:=Network
119
-  TITLE:=GNUnet bluetooth transport
120
-  DEPENDS:=gnunet +bluez-libs
121
-endef
122
-
123
-define Package/gnunet-utils
124
-  SECTION:=net
125
-  CATEGORY:=Network
126
-  TITLE:=GNUnet administration utilities
127
-  DEPENDS:=gnunet +certtool +openssl-util
128
-endef
129
-
130
-define Package/gnunet-vpn
131
-  SECTION:=net
132
-  CATEGORY:=Network
133
-  TITLE:=GNUnet VPN components
134
-  DEPENDS:=gnunet +kmod-tun
135
-  DEFAULT:=y
82
+define BuildComponent
83
+  define Package/gnunet-$(1)
84
+    $$(call Package/gnunet/Default)
85
+    TITLE+= $(2)
86
+    DEPENDS:=gnunet $(DEPENDS_$(1))
87
+    DEFAULT:=$(3)
88
+  endef
89
+
90
+  define Package/gnunet-$(1)/install
91
+	( if [ "$(BIN_$(1))" ]; then \
92
+		$(INSTALL_DIR) $$(1)/usr/bin ; \
93
+		for bin in $(BIN_$(1)); do \
94
+			$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$$$$$bin $$(1)/usr/bin/ ; \
95
+		done \
96
+	fi )
97
+
98
+	( if [ "$(LIB_$(1))" ]; then \
99
+		$(INSTALL_DIR) $$(1)/usr/lib ; \
100
+		for lib in $(LIB_$(1)); do \
101
+			$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$$$$$lib.so* $$(1)/usr/lib/ ; \
102
+		done \
103
+	fi )
104
+
105
+	( if [ "$(PLUGIN_$(1))" ]; then \
106
+		$(INSTALL_DIR) $$(1)/usr/lib/gnunet ; \
107
+		for plug in $(PLUGIN_$(1)); do \
108
+			$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$$$$$plug*.so $$(1)/usr/lib/gnunet ; \
109
+		done \
110
+	fi )
111
+
112
+	( if [ "$(LIBEXEC_$(1))" ]; then \
113
+		$(INSTALL_DIR) $$(1)/usr/lib/gnunet/libexec ; \
114
+		for lex in $(LIBEXEC_$(1)); do \
115
+			$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$$$$$lex $$(1)/usr/lib/gnunet/libexec ; \
116
+		done \
117
+	fi )
118
+
119
+	( if [ "$(CONF_$(1))" ]; then \
120
+		$(INSTALL_DIR) $$(1)/usr/share/gnunet/config.d ; \
121
+		for conf in $(CONF_$(1)); do \
122
+		$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$$$$$conf.conf $$(1)/usr/share/gnunet/config.d ; \
123
+		done \
124
+	fi )
125
+  endef
126
+
127
+  $$(eval $$(call BuildPackage,gnunet-$(1)))
136 128
 endef
137 129
 
138 130
 define Package/gnunet/install
@@ -178,122 +170,6 @@ define Package/gnunet/install
178 170
 	$(INSTALL_BIN) ./files/gnunet.init $(1)/etc/init.d/gnunet
179 171
 endef
180 172
 
181
-define Package/gnunet-conversation/install
182
-	$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
183
-	$(INSTALL_DIR) $(1)/usr/share/gnunet/config.d
184
-	( for bin in conversation conversation-test; do \
185
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
186
-	done )
187
-	( for lib in conversation microphone speaker; do \
188
-		$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
189
-	done )
190
-	( for plug in gnsrecord_conversation; do \
191
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
192
-	done )
193
-	( for lex in helper-audio-playback helper-audio-record; do \
194
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
195
-	done )
196
-	( for conf in conversation; do \
197
-		$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
198
-	done )
199
-endef
200
-
201
-define Package/gnunet-experiments/install
202
-	$(INSTALL_DIR) $(1)/usr/lib/gnunet/libexec
203
-	( for plug in ats_mlp ats_ril; do \
204
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
205
-	done )
206
-endef
207
-
208
-define Package/gnunet-fs/install
209
-	$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
210
-	$(INSTALL_DIR) $(1)/usr/share/gnunet/config.d
211
-	( for bin in auto-share directory download download-manager.scm fs publish unindex search; do \
212
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
213
-	done )
214
-	( for lib in fs; do \
215
-		$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
216
-	done )
217
-	( for plug in block_fs ; do \
218
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
219
-	done )
220
-	( for lex in helper-fs-publish service-fs; do \
221
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
222
-	done )
223
-	( for conf in fs; do \
224
-		$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
225
-	done )
226
-endef
227
-
228
-define Package/gnunet-gns/install
229
-	$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
230
-	$(INSTALL_DIR) $(1)/usr/share/gnunet/config.d
231
-	( for bin in gns namecache resolver; do \
232
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
233
-	done )
234
-	( for lib in gns gnsrecord namecache namestore; do \
235
-		$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
236
-	done )
237
-	( for plug in block_dns block_gns gnsrecord_dns gnsrecord_gns; do \
238
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
239
-	done )
240
-	( for lex in dns2gns gns-proxy helper-dns service-dns \
241
-	    service-gns service-namecache service-resolver; do \
242
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
243
-	done )
244
-	( for conf in dns gns namecache resolver; do \
245
-		$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
246
-	done )
247
-endef
248
-
249
-define Package/gnunet-storage/install
250
-	$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
251
-	$(INSTALL_DIR) $(1)/usr/share/gnunet/config.d
252
-	( for bin in datastore peerstore; do \
253
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
254
-	done )
255
-	( for lib in datastore peerstore; do \
256
-		$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
257
-	done )
258
-	( for plug in datacache_sqlite datastore_heap datastore_sqlite namecache_sqlite namestore_sqlite; do \
259
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
260
-	done )
261
-	( for lex in daemon-latency-logger namestore-fcfsd service-datastore service-peerstore; do \
262
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
263
-	done )
264
-	( for conf in datastore peerstore; do \
265
-		$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
266
-	done )
267
-endef
268
-
269
-define Package/gnunet-transport-bluetooth/install
270
-	$(INSTALL_DIR) $(1)/usr/lib/gnunet/libexec
271
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_transport_bluetooth.so $(1)/usr/lib/gnunet
272
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-helper-transport-bluetooth $(1)/usr/lib/gnunet/libexec
273
-endef
274
-
275
-define Package/gnunet-utils/install
276
-	$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
277
-	( for bin in config gns-import.sh gns-proxy-setup-ca \
278
-	    transport-certificate-creation; do \
279
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
280
-	done )
281
-endef
282
-
283
-define Package/gnunet-vpn/install
284
-	$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
285
-	$(INSTALL_DIR) $(1)/usr/share/gnunet/config.d
286
-	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-vpn $(1)/usr/bin/
287
-	( for lib in tun vpn; do \
288
-		$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
289
-	done )
290
-	( for lex in daemon-exit daemon-pt helper-exit  helper-vpn service-vpn; do \
291
-		$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
292
-	done )
293
-	( for conf in exit pt vpn; do \
294
-		$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
295
-	done )
296
-endef
297 173
 
298 174
 define Build/InstallDev
299 175
 	$(INSTALL_DIR) $(1)/usr/include/gnunet $(1)/usr/lib/pkgconfig
@@ -302,12 +178,55 @@ define Build/InstallDev
302 178
 	$(CP) $(PKG_INSTALL_DIR)/usr/include/gnunet/*.h $(1)/usr/include/gnunet
303 179
 endef
304 180
 
181
+DEPENDS_conversation:=+gnunet-gns +libgst1app +libgst1audio +libgstreamer1 +glib2 +pulseaudio-daemon +libopus +libogg
182
+BIN_conversation:=conversation conversation-test
183
+LIB_conversation:=conversation microphone speaker
184
+PLUGIN_conversation:=gnsrecord_conversation
185
+LIBEXEC_conversation:=helper-audio-playback helper-audio-record
186
+CONF_conversation:=conversation
187
+
188
+DEPENDS_experiments:=+libglpk
189
+PLUGIN_experiments:=ats_mlp ats_ril
190
+
191
+DEPENDS_fs:=+gnunet-storage +libextractor
192
+BIN_fs:=auto-share directory download download-manager.scm fs publish unindex search
193
+LIB_fs:=fs
194
+PLUGIN_fs:=block_fs
195
+LIB_EXEC_fs:=helper-fs-publish service-fs
196
+CONF_fs:=fs
197
+
198
+DEPENDS_gns:=+gnunet-vpn
199
+BIN_gns:=gns namecache resolver
200
+LIB_gns:=gns gnsrecord namecache namestore
201
+PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns
202
+LIBEXEC_gns:=dns2gns gns-proxy helper-dns service-dns service-gns service-namecache service-resolver
203
+CONF_gns:=dns gns namecache resolver
204
+
205
+DEPENDS_storage:=+gnunet-gns +libsqlite3
206
+BIN_storage:=datastore peerstore
207
+LIB_storage:=datastore peerstore
208
+PLUGIN_storage:=datacache_sqlite datastore_heap datastore_sqlite namecache_sqlite namestore_sqlite
209
+LIBEXEC_storage:=daemon-latency-logger namestore-fcfsd service-datastore service-peerstore
210
+CONF_storage:=datastore peerstore
211
+
212
+DEPENDS_transport-bluetooth:=+bluez-libs
213
+PLUGIN_transport-bluetooth:=transport_bluetooth
214
+LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
215
+
216
+DEPENDS_utils:=+certtool +openssl-util
217
+BIN_utils:=config gns-import.sh gns-proxy-setup-ca transport-certificate-creation
218
+
219
+DEPENDS_vpn:=+kmod-tun
220
+LIB_vpn:=tun vpn
221
+LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit  helper-vpn service-vpn
222
+CONF_vpn:=exit pt vpn
223
+
305 224
 $(eval $(call BuildPackage,gnunet))
306
-$(eval $(call BuildPackage,gnunet-conversation))
307
-$(eval $(call BuildPackage,gnunet-experiments))
308
-$(eval $(call BuildPackage,gnunet-fs))
309
-$(eval $(call BuildPackage,gnunet-gns))
310
-$(eval $(call BuildPackage,gnunet-storage))
311
-$(eval $(call BuildPackage,gnunet-transport-bluetooth))
312
-$(eval $(call BuildPackage,gnunet-utils))
313
-$(eval $(call BuildPackage,gnunet-vpn))
225
+$(eval $(call BuildComponent,conversation,conversation component,n))
226
+$(eval $(call BuildComponent,experiments,experimental components,n))
227
+$(eval $(call BuildComponent,fs,file-sharing components,n))
228
+$(eval $(call BuildComponent,gns,name resolving components,y))
229
+$(eval $(call BuildComponent,storage,storage components,n))
230
+$(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,n))
231
+$(eval $(call BuildComponent,utils,administration utililties,n))
232
+$(eval $(call BuildComponent,vpn,vpn components,y))