summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-11-27 11:25:52 +0000
committerJoe MacDonald <joe.macdonald@windriver.com>2012-11-27 14:43:59 -0500
commit3d851fe4cec6f3c166c9fb76e767265dbeab5b69 (patch)
tree5854ed85ec3f992d2a96df1f066344c77dc06e55
parent3761a24e1c25fd388f70aec4f1f7b81d89e3caad (diff)
downloadmeta-openembedded-3d851fe4cec6f3c166c9fb76e767265dbeab5b69.tar.gz
proftpd: add from meta-baryon
This was originally from OE-Classic. Improvements over the OE-Classic recipe for reference: * Update to 1.3.4b * Add workaround for proftpd host IP resolution * Add initscript, borrowed from Debian with some modifications for compatibility and handling for hardcoded paths * Use autotools.bbclass and remove unnecessary configure options * PARALLEL_MAKE = "" is no longer needed, the bug was fixed in 1.3.3c * Set SUMMARY (which sets DESCRIPTION) and base it on the short description from the website * Use useradd.bbclass to add ftp user/group * Add HOMEPAGE * Add/fix description in some patches and improve recipe indentation * Make LICENSE more accurate * Add LIC_FILES_CHKSUM Some of this work was done by Dexuan Cui <dexuan.cui@intel.com> and Kevin Strasser <kevin.strasser@linux.intel.com>. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rw-r--r--meta-networking/recipes-daemons/proftpd/files/basic.conf.patch21
-rw-r--r--meta-networking/recipes-daemons/proftpd/files/contrib.patch42
-rw-r--r--meta-networking/recipes-daemons/proftpd/files/default9
-rw-r--r--meta-networking/recipes-daemons/proftpd/files/make.patch66
-rw-r--r--meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init220
-rw-r--r--meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb66
6 files changed, 424 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch b/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch
new file mode 100644
index 000000000..4967bed1e
--- /dev/null
+++ b/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch
@@ -0,0 +1,21 @@
1Upstream-Status: Inappropriate [configuration]
2
3proftpd tries to get the IP address from the hostname.
4Unluckily now the hostname is not properly configured in /etc/hosts.
5We can use this patch as a workaround.
6
7Author: Dexuan Cui <dexuan.cui@intel.com>
8Tue Oct 25 12:59:27 CST 2011
9
10--- proftpd-1.3.3c.orig/sample-configurations/basic.conf
11+++ proftpd-1.3.3c/sample-configurations/basic.conf
12@@ -7,6 +7,9 @@
13 ServerType standalone
14 DefaultServer on
15
16+#By default we bind to all interfaces.
17+DefaultAddress 0.0.0.0
18+
19 # Port 21 is the standard FTP port.
20 Port 21
21
diff --git a/meta-networking/recipes-daemons/proftpd/files/contrib.patch b/meta-networking/recipes-daemons/proftpd/files/contrib.patch
new file mode 100644
index 000000000..7e2a8e3ce
--- /dev/null
+++ b/meta-networking/recipes-daemons/proftpd/files/contrib.patch
@@ -0,0 +1,42 @@
1The contrib directory now contains its own Makefile which is
2used during installation. It was required to pass DESTDIR through
3when it gets called from the base Makefile.
4
5Upstream-Status: Pending
6
7Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
8---
9 Makefile.in | 2 +-
10 contrib/Makefile.in | 6 +++---
11 2 files changed, 4 insertions(+), 4 deletions(-)
12
13diff --git a/Makefile.in b/Makefile.in
14index 5b2e683..ee72fe1 100644
15--- a/Makefile.in
16+++ b/Makefile.in
17@@ -120,7 +120,7 @@ install-modules: $(DESTDIR)$(libexecdir) $(DESTDIR)$(sysconfdir)
18 test -z "$(SHARED_MODULE_OBJS)" -a -z "$(SHARED_MODULE_DIRS)" -a -z "$(STATIC_MODULE_DIRS)" || (cd modules/ && $(MAKE) install)
19
20 install-utils: $(DESTDIR)$(sbindir) $(DESTDIR)$(bindir)
21- cd contrib/ && $(MAKE) install-utils
22+ cd contrib/ && $(MAKE) DESTDIR=${DESTDIR} install-utils
23 $(INSTALL_BIN) ftpcount $(DESTDIR)$(bindir)/ftpcount
24 $(INSTALL_BIN) ftpdctl $(DESTDIR)$(bindir)/ftpdctl
25 $(INSTALL_SBIN) ftpscrub $(DESTDIR)$(sbindir)/ftpscrub
26diff --git a/contrib/Makefile.in b/contrib/Makefile.in
27index 5bcc038..51d248c 100644
28--- a/contrib/Makefile.in
29+++ b/contrib/Makefile.in
30@@ -18,6 +18,6 @@ Makefile: Makefile.in ../config.status
31 cd ../ && ./config.status
32
33 install-utils:
34- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd
35- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail
36- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota
37+ $(INSTALL) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd
38+ $(INSTALL) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail
39+ $(INSTALL) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota
40--
411.7.9.5
42
diff --git a/meta-networking/recipes-daemons/proftpd/files/default b/meta-networking/recipes-daemons/proftpd/files/default
new file mode 100644
index 000000000..b31f36ce2
--- /dev/null
+++ b/meta-networking/recipes-daemons/proftpd/files/default
@@ -0,0 +1,9 @@
1# Defaults for proftpd initscript
2
3# Master system-wide proftpd switch. The initscript
4# will not run if it is not set to yes.
5RUN="yes"
6
7# Default options.
8# For more exhaustive logging, try "-d 3".
9OPTIONS=""
diff --git a/meta-networking/recipes-daemons/proftpd/files/make.patch b/meta-networking/recipes-daemons/proftpd/files/make.patch
new file mode 100644
index 000000000..c5ff0136d
--- /dev/null
+++ b/meta-networking/recipes-daemons/proftpd/files/make.patch
@@ -0,0 +1,66 @@
1Upstream-Status: Inappropriate [configuration]
2
3Index: proftpd-1.3.2/Makefile.in
4===================================================================
5--- proftpd-1.3.2.orig/Makefile.in
6+++ proftpd-1.3.2/Makefile.in
7@@ -76,7 +76,6 @@ check: proftpd$(EXEEXT)
8 $(DESTDIR)$(localedir) $(DESTDIR)$(includedir) $(DESTDIR)$(includedir)/proftpd $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir) $(DESTDIR)$(libdir)/proftpd $(DESTDIR)$(libexecdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir) $(DESTDIR)$(rundir) $(DESTDIR)$(bindir) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man8:
9 @if [ ! -d $@ ]; then \
10 mkdir -p $@; \
11- chown $(INSTALL_USER):$(INSTALL_GROUP) $@; \
12 chmod 0755 $@; \
13 fi
14
15@@ -86,7 +85,6 @@ install-proftpd: proftpd $(DESTDIR)$(inc
16 rm -f $(DESTDIR)$(sbindir)/in.proftpd ; \
17 fi
18 ln -s proftpd $(DESTDIR)$(sbindir)/in.proftpd
19- -chown -h $(INSTALL_USER):$(INSTALL_GROUP) $(DESTDIR)$(sbindir)/in.proftpd
20
21 install-libs: $(DESTDIR)$(libdir)/proftpd
22 cd lib/ && $(MAKE) install
23@@ -121,11 +119,11 @@ install-utils: $(DESTDIR)$(sbindir) $(DE
24 $(INSTALL_SBIN) ftpshut $(DESTDIR)$(sbindir)/ftpshut
25 $(INSTALL_BIN) ftptop $(DESTDIR)$(bindir)/ftptop
26 $(INSTALL_BIN) ftpwho $(DESTDIR)$(bindir)/ftpwho
27- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs
28+ $(INSTALL) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs
29
30 install-conf: $(DESTDIR)$(sysconfdir)
31 if [ ! -f $(DESTDIR)$(sysconfdir)/proftpd.conf ] ; then \
32- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644 \
33+ $(INSTALL) -m 0644 \
34 $(top_srcdir)/sample-configurations/basic.conf \
35 $(DESTDIR)$(sysconfdir)/proftpd.conf ; \
36 fi
37Index: proftpd-1.3.2/Make.rules.in
38===================================================================
39--- proftpd-1.3.2.orig/Make.rules.in
40+++ proftpd-1.3.2/Make.rules.in
41@@ -29,9 +29,9 @@ UTILS_LIBS=@UTILS_LIBS@ @LIBS@
42 INSTALL=@INSTALL@
43 INSTALL_USER=@install_user@
44 INSTALL_GROUP=@install_group@
45-INSTALL_BIN=$(INSTALL) @INSTALL_STRIP@ -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755
46-INSTALL_SBIN=$(INSTALL) @INSTALL_STRIP@ -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755
47-INSTALL_MAN=$(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644
48+INSTALL_BIN=$(INSTALL) -m 0755
49+INSTALL_SBIN=$(INSTALL) -m 0755
50+INSTALL_MAN=$(INSTALL) -m 0644
51
52 RM=rm -f
53 SHELL=/bin/sh
54Index: proftpd-1.3.2/lib/libcap/Makefile
55===================================================================
56--- proftpd-1.3.2.orig/lib/libcap/Makefile
57+++ proftpd-1.3.2/lib/libcap/Makefile
58@@ -26,7 +26,7 @@ OBJS=$(addsuffix .o, $(FILES))
59 all: $(LIBNAME)
60
61 _makenames: _makenames.c cap_names.sed
62- $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
63+ $(BUILD_CC) $(CFLAGS) $(LDFLAGS) $< -o $@
64
65 cap_names.h: _makenames
66 ./_makenames > cap_names.h
diff --git a/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init b/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init
new file mode 100644
index 000000000..01c998c92
--- /dev/null
+++ b/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init
@@ -0,0 +1,220 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: proftpd
5# Required-Start: $remote_fs $syslog $local_fs $network
6# Required-Stop: $remote_fs $syslog $local_fs $network
7# Should-Start: $named
8# Should-Stop: $named
9# Default-Start: 2 3 4 5
10# Default-Stop: 0 1 6
11# Short-Description: Starts ProFTPD daemon
12# Description: This script runs the FTP service offered
13# by the ProFTPD daemon
14### END INIT INFO
15
16# Start the proftpd FTP daemon.
17
18PATH=/bin:/usr/bin:/sbin:/usr/sbin
19DAEMON=/usr/sbin/proftpd
20NAME=proftpd
21
22# Defaults
23RUN="no"
24OPTIONS=""
25CONFIG_FILE=/etc/proftpd.conf
26
27PIDFILE=`grep -i '^pidfile' $CONFIG_FILE|awk '{ print $2 }'`
28if [ "x$PIDFILE" = "x" ];
29then
30 PIDFILE=/var/run/proftpd.pid
31fi
32
33# Read config (will override defaults)
34[ -r /etc/default/proftpd ] && . /etc/default/proftpd
35
36trap "" 1
37trap "" 15
38
39test -f $DAEMON || exit 0
40
41. /etc/init.d/functions
42
43#
44# Servertype could be inetd|standalone|none.
45# In all cases check against inetd and xinetd support.
46#
47if ! egrep -qi "^[[:space:]]*ServerType.*standalone" $CONFIG_FILE
48then
49 if egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.conf 2>/dev/null || \
50 egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.d/* 2>/dev/null || \
51 egrep -qi "^ftp.*/usr/sbin/proftpd" /etc/inetd.conf 2>/dev/null
52 then
53 RUN="no"
54 INETD="yes"
55 else
56 if ! egrep -qi "^[[:space:]]*ServerType.*inetd" $CONFIG_FILE
57 then
58 RUN="yes"
59 INETD="no"
60 else
61 RUN="no"
62 INETD="no"
63 fi
64 fi
65fi
66
67# /var/run could be on a tmpfs
68
69[ ! -d /var/run/proftpd ] && mkdir /var/run/proftpd
70
71inetd_check()
72{
73 if [ ! -x /usr/sbin/inetd -a ! -x /usr/sbin/xinetd ]; then
74 echo "Neither inetd nor xinetd appears installed: check your configuration."
75 fi
76}
77
78start()
79{
80 set -e
81 echo -n "Starting ftp server $NAME... "
82 start-stop-daemon --start --quiet --pidfile "$PIDFILE" --oknodo --exec $DAEMON -- -c $CONFIG_FILE $OPTIONS
83 echo "done."
84}
85
86signal()
87{
88
89 if [ "$1" = "stop" ]; then
90 SIGNAL="TERM"
91 echo -n "Stopping ftp server $NAME... "
92 else
93 if [ "$1" = "reload" ]; then
94 SIGNAL="HUP"
95 echo -n "Reloading ftp server $NAME... "
96 else
97 echo "ERR: wrong parameter given to signal()"
98 exit 1
99 fi
100 fi
101 if [ -f "$PIDFILE" ]; then
102 start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"
103 if [ $? = 0 ]; then
104 echo "done."
105 return
106 else
107 SIGNAL="KILL"
108 start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"
109 if [ $? != 0 ]; then
110 echo
111 [ $2 != 0 ] || exit 0
112 else
113 echo "done."
114 return
115 fi
116 fi
117 if [ "$SIGNAL" = "KILL" ]; then
118 rm -f "$PIDFILE"
119 fi
120 else
121 echo "done."
122 return
123 fi
124}
125
126case "$1" in
127 start)
128 if [ "x$RUN" = "xyes" ] ; then
129 start
130 else
131 if [ "x$INETD" = "xyes" ] ; then
132 echo "ProFTPD is started from inetd/xinetd."
133 inetd_check
134 else
135 echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
136 fi
137 fi
138 ;;
139
140 force-start)
141 if [ "x$INETD" = "xyes" ] ; then
142 echo "Warning: ProFTPD is started from inetd/xinetd (trying to start anyway)."
143 inetd_check
144 fi
145 start
146 ;;
147
148 stop)
149 if [ "x$RUN" = "xyes" ] ; then
150 signal stop 0
151 else
152 if [ "x$INETD" = "xyes" ] ; then
153 echo "ProFTPD is started from inetd/xinetd."
154 inetd_check
155 else
156 echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
157 fi
158 fi
159 ;;
160
161 force-stop)
162 if [ "x$INETD" = "xyes" ] ; then
163 echo "Warning: ProFTPD is started from inetd/xinetd (trying to kill anyway)."
164 inetd_check
165 fi
166 signal stop 0
167 ;;
168
169 reload)
170 signal reload 0
171 ;;
172
173 force-reload|restart)
174 if [ "x$RUN" = "xyes" ] ; then
175 signal stop 1
176 sleep 2
177 start
178 else
179 if [ "x$INETD" = "xyes" ] ; then
180 echo "ProFTPD is started from inetd/xinetd."
181 inetd_check
182 else
183 echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
184 fi
185 fi
186 ;;
187
188 status)
189 if [ "x$INETD" = "xyes" ] ; then
190 echo "ProFTPD is started from inetd/xinetd."
191 inetd_check
192 exit 0
193 else
194 if [ -f "$PIDFILE" ]; then
195 pid=$(cat $PIDFILE)
196 else
197 pid="x"
198 fi
199 if [ `pidof proftpd|grep "$pid"|wc -l` -ne 0 ] ; then
200 echo "ProFTPD is started in standalone mode, currently running."
201 exit 0
202 else
203 echo "ProFTPD is started in standalone mode, currently not running."
204 exit 3
205 fi
206 fi
207 ;;
208
209 check-config)
210 $DAEMON -t >/dev/null && echo "ProFTPD configuration OK" && exit 0
211 exit 1
212 ;;
213
214 *)
215 echo "Usage: /etc/init.d/$NAME {start|status|force-start|stop|force-stop|reload|restart|force-reload|check-config}"
216 exit 1
217 ;;
218esac
219
220exit 0
diff --git a/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb
new file mode 100644
index 000000000..8624c1653
--- /dev/null
+++ b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb
@@ -0,0 +1,66 @@
1SUMMARY = "Secure and configurable FTP server"
2SECTION = "console/network"
3HOMEPAGE = "http://www.proftpd.org"
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=fb0d1484d11915fa88a6a7702f1dc184"
6
7PR = "r1"
8
9SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${PN}-${PV}.tar.gz \
10 file://make.patch \
11 file://basic.conf.patch \
12 file://contrib.patch \
13 file://proftpd-basic.init \
14 file://default \
15 "
16
17SRC_URI[md5sum] = "0871e0b93c9c3c88ca950b6d9a04aed2"
18SRC_URI[sha256sum] = "9f659585cea90fc6af34a0ffae4a90e4ed37abe92dbd9b6c311f95a436c961cb"
19
20inherit autotools useradd update-rc.d
21
22EXTRA_OECONF = "--disable-cap \
23 --disable-auth-pam \
24 "
25
26# proftpd uses libltdl which currently makes configuring using
27# autotools.bbclass a pain...
28do_configure () {
29 oe_runconf
30}
31
32FTPUSER = "ftp"
33FTPGROUP = "ftp"
34
35do_install () {
36 oe_runmake DESTDIR=${D} install
37 rmdir ${D}${libexecdir} ${D}${libdir}/proftpd ${D}${datadir}/locale
38 sed -i '/ *User[ \t]*/s/ftp/${FTPUSER}/' ${D}${sysconfdir}/proftpd.conf
39 sed -i '/ *Group[ \t]*/s/ftp/${FTPGROUP}/' ${D}${sysconfdir}/proftpd.conf
40 install -d ${D}${sysconfdir}/init.d
41 install -m 0755 ${WORKDIR}/proftpd-basic.init ${D}${sysconfdir}/init.d/proftpd
42 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/proftpd
43 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/proftpd
44 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/proftpd
45 sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/proftpd
46
47 install -d ${D}${sysconfdir}/default
48 install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/proftpd
49}
50
51INITSCRIPT_NAME = "proftpd"
52INITSCRIPT_PARAM = "defaults 85 15"
53
54USERADD_PACKAGES = "${PN}"
55GROUPADD_PARAM_${PN} = "${FTPGROUP}"
56USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} ${FTPUSER}"
57
58pkg_postinst_${PN} () {
59 if [ "x$D" != "x" ] ; then
60 exit 1
61 fi
62
63 # create the pub directory
64 mkdir -p /home/${FTPUSER}/pub/
65 chown -R ${FTPUSER}:${FTPGROUP} /home/${FTPUSER}/pub
66}