summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2013-10-13 16:47:32 +0000
committerPacho Ramos <pacho@gentoo.org>2013-10-13 16:47:32 +0000
commit0a488d8e98f87e577ad6865c11695cb02e727a4f (patch)
tree518bf21be9be293ee391bde071863f210b2d2d77 /net-misc/scponly
parentia64 stable wrt bug #449582 (diff)
downloadhistorical-0a488d8e98f87e577ad6865c11695cb02e727a4f.tar.gz
historical-0a488d8e98f87e577ad6865c11695cb02e727a4f.tar.bz2
historical-0a488d8e98f87e577ad6865c11695cb02e727a4f.zip
Replace pkg_setup hacks (#371667), drop default chdir (#322901)
Package-Manager: portage-2.2.7/cvs/Linux x86_64 Manifest-Sign-Key: 0xA188FBD4
Diffstat (limited to 'net-misc/scponly')
-rw-r--r--net-misc/scponly/ChangeLog7
-rw-r--r--net-misc/scponly/Manifest13
-rw-r--r--net-misc/scponly/scponly-4.8-r5.ebuild249
3 files changed, 262 insertions, 7 deletions
diff --git a/net-misc/scponly/ChangeLog b/net-misc/scponly/ChangeLog
index 7e800c74608e..9e0e7a3d56fb 100644
--- a/net-misc/scponly/ChangeLog
+++ b/net-misc/scponly/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for net-misc/scponly
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/scponly/ChangeLog,v 1.54 2013/02/03 12:36:36 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/scponly/ChangeLog,v 1.55 2013/10/13 16:47:28 pacho Exp $
+
+*scponly-4.8-r5 (13 Oct 2013)
+
+ 13 Oct 2013; Pacho Ramos <pacho@gentoo.org> +scponly-4.8-r5.ebuild:
+ Replace pkg_setup hacks (#371667), drop default chdir (#322901)
03 Feb 2013; Pacho Ramos <pacho@gentoo.org> metadata.xml:
Cleanup due #22900
diff --git a/net-misc/scponly/Manifest b/net-misc/scponly/Manifest
index 5a02aa9194cf..1a3b62d145ff 100644
--- a/net-misc/scponly/Manifest
+++ b/net-misc/scponly/Manifest
@@ -3,14 +3,15 @@ Hash: SHA256
AUX scponly-4.8-gcc4.4.0.patch 571 SHA256 bf89c4b56552654140c93b5cf3090370c24ee20e5870f0cf0df76218e52e15b2 SHA512 2e215ab2c39bb0550345725d3d509354be88144000072e5e14eda9f0ecb1bcc4c418e76d9db85ef6d6568962efc4472fe28d855e15adfe2bc5ba78c69d293a12 WHIRLPOOL 9853aa544070fae241e48da11821adccfb87d7229330dd01d72ccc097ae2f9bc57385d1d1739c8e9f2c5e4fbdcd7820ebdf8a18a74129ca4a57a067ff4956dbd
AUX scponly-4.8-rsync.patch 7838 SHA256 bfab1408ad8cfdfd8fc7f9b583c57a5c6b73be36cb3955db46e4c892acd7e55e SHA512 37885c9b46422ac034182f9c9f230b4e806ce8c894ebb6c621f0e2b3d5f46c91db902c2dae6aefe5471907025d400320e4eff37cc7c5cc4c6f7d8c88a38e53f8 WHIRLPOOL b5114140169e4937f45b52b34db8de37aa03685a1810b47fcc1f7f20136f500551e2673ac8396d6c059b78b47028730f901cee208500939454e3333eb2fe5eba
-DIST scponly-4.8.tgz 101687 SHA256 1693dd678355749c5d9e48ecdd4628dbfe71d82955afde950ee8d88b5adc01cf
+DIST scponly-4.8.tgz 101687 SHA256 1693dd678355749c5d9e48ecdd4628dbfe71d82955afde950ee8d88b5adc01cf SHA512 134c008a7377cef7b8e0be483df8413e162a515967147f561d23b72bdef3dfbe70a8313811dfff6372b88f15c1ac8a4385831fcf329261276993c64d5040f29b WHIRLPOOL 31ed4fda62484dbaa6eb678635a916db3e191ab98bb7ed0e7f6e794ef7d0dac0251e51bf7e627d48c00b17d550ce6dc0ed196fdfa3c2379ca7feec5544b200ba
EBUILD scponly-4.8-r4.ebuild 8816 SHA256 b334c32bf48eb49e88e0a82416fc04988f1baeade5eeaf68c3b17b3c5185f34d SHA512 7547554f790f24f5b3170bab5d6f11c6c5f81bc900aec4fde18589f518d32979ba635a4ac09b0353c1908ea9fab79680c16dff2b48d4baedd88b45395a125a25 WHIRLPOOL f08be213e40d1cb98993a3c91086298e095662b0aac2f5ec239cb8ce905127b92f5f90ccba1fa7331a34db72f4f290230ca11925dda3bd37dfc6b3cbad19c953
-MISC ChangeLog 7727 SHA256 32724e6f75d18010babe621df561d619f233de83d6a77f8a6bf2fbb54da6dde2 SHA512 10e4147497f364e812d83f6821b024a63fe3ba9480a8664e8109fbc8e47dcf8a33dd5158a703545966d3a52f4965c47f96068922f8a3d98487f219a7c7f6b59a WHIRLPOOL 7e38c41d60c72ab02a87af36f411ef85a2951738c0001e40f60d331b88e9b391bf44bb2ed442144fae69ba9b4a71445992143e9b892ab5836a8008252d3331a8
+EBUILD scponly-4.8-r5.ebuild 6952 SHA256 56adf988a97f84f717894c2cdc65f682e1797992784c6111f619522f4f99e3d1 SHA512 e3c6cecfe73736915be213afb4d83ff608656831015f5ad5737fa969662aa443f8ec7478f714a0b7ed4f6c1b0e0b2c3adc37132f8a352535753fcca83197b975 WHIRLPOOL 339742bb30feef70c62a8471015da5930512198d2ab7bb4ec856bfaaa92b63ff1f5d148fa9819394d17b7d36ee9c3eeb56757c50f065fe6d715997a7de5a5f33
+MISC ChangeLog 7895 SHA256 418041a961565858214007cec3bd299d9a17d7489af44130fc256745a64ccb6c SHA512 8d33e18c715089a6d20a7dec8e3420154ee88e8fb5fe229a8cad64062e33df7cfc4face7bf466b1589cc755a904f3099e43221a0a12fca2d40095bf16c507461 WHIRLPOOL 8e75e8a4470c0af275fd06dc130319f3107bb66ca18f6e40297e8b53791824996327f26b0793c09f95c947a162e2a13f6e0eaefa60640658be35ef02cdd2be09
MISC metadata.xml 1412 SHA256 c252f2a7e0b4bc1ffd8eae587ecdc6e049afef2d8e5908f396d0c1af17a3e38e SHA512 4e480de498e90bc616f88b5a9323c619b08cbc9b3e3d42f6b6984cd9a1ee6c2f2792eb3aa943e1f35dd901c0a3d5019e132f1171a00ec22013e64fb24a58779f WHIRLPOOL 02d7339c15e4b70e20eae52d785de0592305847d496fc9e87fbf4bc626d9ff2c8b6445ddeb0894eafb6b5b8534439a166c3655fa1975876b4885b4ffd63bd8e5
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.19 (GNU/Linux)
+Version: GnuPG v2.0.22 (GNU/Linux)
-iEYEAREIAAYFAlEOWdUACgkQCaWpQKGI+9RA5gCfWmstIEbjhYOFnQOgl37R2Be5
-R2YAn3Jnq9kpyhSMWuWWMCKlXe+e92oy
-=4shC
+iEYEAREIAAYFAlJazqEACgkQCaWpQKGI+9RkpQCdGY2pea02FC8Vu86AwmNRBTj9
+NVcAn24b1hkg7Yf0qVbMxHXXvwU7rEqt
+=5TFR
-----END PGP SIGNATURE-----
diff --git a/net-misc/scponly/scponly-4.8-r5.ebuild b/net-misc/scponly/scponly-4.8-r5.ebuild
new file mode 100644
index 000000000000..52011611423b
--- /dev/null
+++ b/net-misc/scponly/scponly-4.8-r5.ebuild
@@ -0,0 +1,249 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/scponly/scponly-4.8-r5.ebuild,v 1.1 2013/10/13 16:47:28 pacho Exp $
+
+EAPI=5
+inherit eutils multilib readme.gentoo toolchain-funcs
+
+DESCRIPTION="A tiny pseudoshell which only permits scp and sftp"
+HOMEPAGE="http://www.sublimation.org/scponly/"
+SRC_URI="mirror://sourceforge/scponly/${P}.tgz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE="+sftp scp winscp gftp rsync unison subversion wildcards quota passwd logging"
+REQUIRED_USE="
+ || ( sftp scp winscp rsync unison subversion )
+"
+
+RDEPEND="
+ sys-apps/sed
+ net-misc/openssh
+ quota? ( sys-fs/quota )
+ rsync? ( net-misc/rsync )
+ subversion? ( dev-vcs/subversion )
+"
+DEPEND="${RDEPEND}"
+
+myuser="scponly"
+myhome="/home/${myuser}"
+mysubdir="/pub"
+
+DOC_CONTENTS="
+ You might want to run\n
+ emerge --config =${CATEGORY}/${PF}\n
+ \nto setup the chroot. Otherwise you will have to setup chroot manually
+ Please read the docs in /usr/share/doc/${PF} for more informations, also
+ the SECURITY file.
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-rsync.patch"
+ # bug #269242
+ epatch "${FILESDIR}/${P}-gcc4.4.0.patch"
+}
+
+src_configure() {
+ CFLAGS="${CFLAGS} ${LDFLAGS}" econf \
+ --with-sftp-server="/usr/$(get_libdir)/misc/sftp-server" \
+ --disable-restrictive-names \
+ --enable-chrooted-binary \
+ --enable-chroot-checkdir \
+ $(use_enable winscp winscp-compat) \
+ $(use_enable gftp gftp-compat) \
+ $(use_enable scp scp-compat) \
+ $(use_enable sftp sftp) \
+ $(use_enable quota quota-compat) \
+ $(use_enable passwd passwd-compat) \
+ $(use_enable rsync rsync-compat) \
+ $(use_enable unison unison-compat) \
+ $(use_enable subversion svn-compat) \
+ $(use_enable subversion svnserv-compat) \
+ $(use_enable logging sftp-logging-compat) \
+ $(use_enable wildcards wildcards)
+}
+
+src_compile() {
+ emake CC=$(tc-getCC)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHOR BUILDING-JAILS.TXT CHANGELOG CONTRIB README SECURITY TODO
+
+ # don't compress setup-script, so it is usable if necessary
+ insinto /usr/share/doc/${PF}/chroot
+ doins setup_chroot.sh config.h
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ # two slashes ('//') are used by scponlyc to determine the chroot point.
+ enewgroup "${myuser}"
+ enewuser "${myuser}" -1 /usr/sbin/scponlyc "${myhome}//" "${myuser}"
+
+ readme.gentoo_print_elog
+}
+
+pkg_config() {
+ # pkg_postinst is based on ${S}/setup_chroot.sh.
+
+ einfo "Collecting binaries and libraries..."
+
+ # Binaries launched in sftp compat mode
+ if built_with_use =${CATEGORY}/${PF} sftp; then
+ BINARIES="/usr/$(get_libdir)/misc/sftp-server"
+ fi
+
+ # Binaries launched by vanilla- and WinSCP modes
+ if built_with_use =${CATEGORY}/${PF} scp || \
+ built_with_use =${CATEGORY}/${PF} winscp; then
+ BINARIES="${BINARIES} /usr/bin/scp /bin/ls /bin/rm /bin/ln /bin/mv"
+ BINARIES="${BINARIES} /bin/chmod /bin/chown /bin/chgrp /bin/mkdir /bin/rmdir"
+ fi
+
+ # Binaries launched in WinSCP compatibility mode
+ if built_with_use =${CATEGORY}/${PF} winscp; then
+ BINARIES="${BINARIES} /bin/pwd /bin/groups /usr/bin/id /bin/echo"
+ fi
+
+ # Rsync compatability mode
+ if built_with_use =${CATEGORY}/${PF} rsync; then
+ BINARIES="${BINARIES} /usr/bin/rsync"
+ fi
+
+ # Unison compatability mode
+ if built_with_use =${CATEGORY}/${PF} unison; then
+ BINARIES="${BINARIES} /usr/bin/unison"
+ fi
+
+ # subversion cli/svnserv compatibility
+ if built_with_use =${CATEGORY}/${PF} subversion; then
+ BINARIES="${BINARIES} /usr/bin/svn /usr/bin/svnserve"
+ fi
+
+ # passwd compatibility
+ if built_with_use =${CATEGORY}/${PF} passwd; then
+ BINARIES="${BINARIES} /bin/passwd"
+ fi
+
+ # quota compatibility
+ if built_with_use =${CATEGORY}/${PF} quota; then
+ BINARIES="${BINARIES} /usr/bin/quota"
+ fi
+
+ # build lib dependencies
+ LIB_LIST=$(ldd ${BINARIES} | sed -n 's:.* => \(/[^ ]\+\).*:\1:p' | sort -u)
+
+ # search and add ld*.so
+ for LIB in /$(get_libdir)/ld.so /libexec/ld-elf.so /libexec/ld-elf.so.1 \
+ /usr/libexec/ld.so /$(get_libdir)/ld-linux*.so.2 /usr/libexec/ld-elf.so.1; do
+ [ -f "${LIB}" ] && LIB_LIST="${LIB_LIST} ${LIB}"
+ done
+
+ # search and add libnss_*.so
+ for LIB in /$(get_libdir)/libnss_{compat,files}*.so.*; do
+ [ -f "${LIB}" ] && LIB_LIST="${LIB_LIST} ${LIB}"
+ done
+
+ # create base dirs
+ if [ ! -d "${myhome}" ]; then
+ einfo "Creating ${myhome}"
+ install -o0 -g0 -m0755 -d "${myhome}"
+ else
+ einfo "Setting owner for ${myhome}"
+ chown 0:0 "${myhome}"
+ fi
+
+ if [ ! -d "${myhome}/etc" ]; then
+ einfo "Creating ${myhome}/etc"
+ install -o0 -g0 -m0755 -d "${myhome}/etc"
+ fi
+
+ if [ ! -d "${myhome}/$(get_libdir)" ]; then
+ einfo "Creating ${myhome}/$(get_libdir)"
+ install -o0 -g0 -m0755 -d "${myhome}/$(get_libdir)"
+ fi
+
+ if [ ! -e "${myhome}/lib" ]; then
+ einfo "Creating ${myhome}/lib"
+ ln -snf $(get_libdir) "${myhome}/lib"
+ fi
+
+ if [ ! -d "${myhome}/usr/$(get_libdir)" ]; then
+ einfo "Creating ${myhome}/usr/$(get_libdir)"
+ install -o0 -g0 -m0755 -d "${myhome}/usr/$(get_libdir)"
+ fi
+
+ if [ ! -e "${myhome}/usr/lib" ]; then
+ einfo "Creating ${myhome}/usr/lib"
+ ln -snf $(get_libdir) "${myhome}/usr/lib"
+ fi
+
+ if [ ! -d "${myhome}${mysubdir}" ]; then
+ einfo "Creating ${myhome}${mysubdir} directory for uploading files"
+ install -o${myuser} -g${myuser} -m0755 -d "${myhome}${mysubdir}"
+ fi
+
+ # create /dev/null (Bug 135505)
+ if [ ! -e "${myhome}/dev/null" ]; then
+ install -o0 -g0 -m0755 -d "${myhome}/dev"
+ mknod -m0777 "${myhome}/dev/null" c 1 3
+ fi
+
+ # install binaries
+ for BIN in ${BINARIES}; do
+ einfo "Install ${BIN}"
+ install -o0 -g0 -m0755 -d "${myhome}$(dirname ${BIN})"
+ if [ "${BIN}" = "/bin/passwd" ]; then # needs suid
+ install -p -o0 -g0 -m04711 "${BIN}" "${myhome}/${BIN}"
+ else
+ install -p -o0 -g0 -m0755 "${BIN}" "${myhome}/${BIN}"
+ fi
+ done
+
+ # install libs
+ for LIB in ${LIB_LIST}; do
+ einfo "Install ${LIB}"
+ install -o0 -g0 -m0755 -d "${myhome}$(dirname ${LIB})"
+ install -p -o0 -g0 -m0755 "${LIB}" "${myhome}/${LIB}"
+ done
+
+ # create ld.so.conf
+ einfo "Creating /etc/ld.so.conf"
+ for LIB in ${LIB_LIST}; do
+ dirname ${LIB}
+ done | sort -u | while read DIR; do
+ if ! grep 2>/dev/null -q "^${DIR}$" "${myhome}/etc/ld.so.conf"; then
+ echo "${DIR}" >> "${myhome}/etc/ld.so.conf"
+ fi
+ done
+ ldconfig -r "${myhome}"
+
+ # update shells
+ einfo "Updating /etc/shells"
+ grep 2>/dev/null -q "^/usr/bin/scponly$" /etc/shells \
+ || echo "/usr/bin/scponly" >> /etc/shells
+
+ grep 2>/dev/null -q "^/usr/sbin/scponlyc$" /etc/shells \
+ || echo "/usr/sbin/scponlyc" >> /etc/shells
+
+ # create /etc/passwd
+ if [ ! -e "${myhome}/etc/passwd" ]; then
+ (
+ echo "root:x:0:0:root:/:/bin/sh"
+ sed -n "s|^\(${myuser}:[^:]*:[^:]*:[^:]*:[^:]*:\).*|\1${mysubdir}:/bin/sh|p" /etc/passwd
+ ) > "${myhome}/etc/passwd"
+ fi
+
+ # create /etc/group
+ if [ ! -e "${myhome}/etc/group" ]; then
+ (
+ echo "root:x:0:"
+ sed -n "s|^\(${myuser}:[^:]*:[^:]*:\).*|\1|p" /etc/group
+ ) > "${myhome}/etc/group"
+ fi
+}