Browse Source

portmap: import from packages

Peter Wagner 10 years ago
parent
commit
28d0f1d506
3 changed files with 79 additions and 0 deletions
  1. 51
    0
      net/portmap/Makefile
  2. 16
    0
      net/portmap/files/portmap.init
  3. 12
    0
      net/portmap/patches/101-no_pie.patch

+ 51
- 0
net/portmap/Makefile View File

@@ -0,0 +1,51 @@
1
+#
2
+# Copyright (C) 2006-2011 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=portmap
11
+PKG_VERSION:=6.0
12
+PKG_RELEASE:=4
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
15
+PKG_SOURCE_URL:=http://neil.brown.name/portmap/
16
+PKG_MD5SUM:=ac108ab68bf0f34477f8317791aaf1ff
17
+
18
+PKG_LICENSE:=BSD-4c
19
+PKG_LICENSE_FILES:=portmap.man
20
+
21
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
22
+
23
+include $(INCLUDE_DIR)/package.mk
24
+
25
+define Package/portmap
26
+  SECTION:=net
27
+  CATEGORY:=Network
28
+  DEPENDS:=+libwrap $(LIBRPC_DEPENDS)
29
+  TITLE:=The RPC Portmapper
30
+  URL:=http://neil.brown.name/portmap/
31
+endef
32
+
33
+define Package/portmap/description
34
+ Portmap is a server that converts RPC (Remote Procedure Call) program
35
+ numbers into DARPA protocol port numbers.
36
+endef
37
+
38
+MAKE_FLAGS += \
39
+	CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -DHOSTS_ACCESS -DFACILITY=LOG_DAEMON -DIGNORE_SIGCHLD" \
40
+	RPCUSER="rpc" \
41
+	LDLIBS="$(TARGET_LDFLAGS) -lwrap $(LIBRPC)" \
42
+	all
43
+
44
+define Package/portmap/install
45
+	$(INSTALL_DIR) $(1)/usr/sbin
46
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/portmap $(1)/usr/sbin/
47
+	$(INSTALL_DIR) $(1)/etc/init.d
48
+	$(INSTALL_BIN) ./files/portmap.init $(1)/etc/init.d/portmap
49
+endef
50
+
51
+$(eval $(call BuildPackage,portmap))

+ 16
- 0
net/portmap/files/portmap.init View File

@@ -0,0 +1,16 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2006-2011 OpenWrt.org
3
+
4
+START=19
5
+STOP=19
6
+
7
+USE_PROCD=1
8
+
9
+start_service() {
10
+	user_exists rpc 65533 || user_add rpc 65533 65533 rpc /var/empty
11
+	group_exists rpc 65533 || group_add rpc 65533
12
+	
13
+	procd_open_instance
14
+	procd_set_param command /usr/sbin/portmap -f
15
+	procd_close_instance
16
+}

+ 12
- 0
net/portmap/patches/101-no_pie.patch View File

@@ -0,0 +1,12 @@
1
+diff -ur portmap_6.0.org/Makefile portmap_6.0/Makefile
2
+--- portmap_6.0.org/Makefile	2008-04-19 22:44:35.000000000 +0200
3
++++ portmap_6.0/Makefile	2008-04-19 00:02:01.000000000 +0200
4
+@@ -127,7 +127,7 @@
5
+ CPPFLAGS += $(HOSTS_ACCESS)
6
+ portmap: CFLAGS   += -fpie
7
+ portmap: LDLIBS   += $(WRAP_LIB)
8
+-portmap: LDFLAGS  += -pie
9
++#portmap: LDFLAGS  += -pie
10
+ portmap: portmap.o pmap_check.o from_local.o
11
+ 
12
+ from_local: CPPFLAGS += -DTEST