Index: Makefile
===================================================================
--- Makefile (nonexistent)
+++ Makefile (revision 5)
@@ -0,0 +1,282 @@
+
+COMPONENT_TARGETS = $(HARDWARE_INTEL_PC32)
+COMPONENT_TARGETS += $(HARDWARE_INTEL_PC64)
+COMPONENT_TARGETS += $(HARDWARE_EBOX_3350DX2)
+COMPONENT_TARGETS += $(HARDWARE_CB1X)
+COMPONENT_TARGETS += $(HARDWARE_CB2X)
+COMPONENT_TARGETS += $(HARDWARE_CB3X)
+COMPONENT_TARGETS += $(HARDWARE_ORANGE_PP2E)
+COMPONENT_TARGETS += $(HARDWARE_NANOPI_NEO)
+COMPONENT_TARGETS += $(HARDWARE_ORANGE_PP)
+COMPONENT_TARGETS += $(HARDWARE_ORANGE_PL2)
+COMPONENT_TARGETS += $(HARDWARE_WECHIP_TX6)
+COMPONENT_TARGETS += $(HARDWARE_FFRK3288)
+COMPONENT_TARGETS += $(HARDWARE_POIN2)
+COMPONENT_TARGETS += $(HARDWARE_RK3328_CC)
+COMPONENT_TARGETS += $(HARDWARE_KHADAS_EDGE)
+COMPONENT_TARGETS += $(HARDWARE_LEEZ_P710)
+COMPONENT_TARGETS += $(HARDWARE_M201)
+COMPONENT_TARGETS += $(HARDWARE_MXV)
+COMPONENT_TARGETS += $(HARDWARE_P201)
+COMPONENT_TARGETS += $(HARDWARE_NEXBOX_A95X)
+COMPONENT_TARGETS += $(HARDWARE_ODROID_C2)
+COMPONENT_TARGETS += $(HARDWARE_P212)
+COMPONENT_TARGETS += $(HARDWARE_KHADAS_VIM)
+COMPONENT_TARGETS += $(HARDWARE_Q201)
+COMPONENT_TARGETS += $(HARDWARE_ENYBOX_X2)
+COMPONENT_TARGETS += $(HARDWARE_KHADAS_VIM2)
+COMPONENT_TARGETS += $(HARDWARE_NIT6Q)
+COMPONENT_TARGETS += $(HARDWARE_OKMX6DL_C)
+COMPONENT_TARGETS += $(HARDWARE_OKMX6Q_C)
+COMPONENT_TARGETS += $(HARDWARE_BONE_BLACK)
+COMPONENT_TARGETS += $(HARDWARE_OMAP5UEVM)
+COMPONENT_TARGETS += $(HARDWARE_DRA7XXEVM)
+COMPONENT_TARGETS += $(HARDWARE_CI20)
+COMPONENT_TARGETS += $(HARDWARE_BAIKAL_T1)
+COMPONENT_TARGETS += $(HARDWARE_BAIKAL_M1)
+COMPONENT_TARGETS += $(HARDWARE_S824L)
+COMPONENT_TARGETS += $(HARDWARE_VESNIN)
+COMPONENT_TARGETS += $(HARDWARE_S824L_LSB)
+COMPONENT_TARGETS += $(HARDWARE_VESNIN_LSB)
+COMPONENT_TARGETS += $(HARDWARE_TL2WK2)
+COMPONENT_TARGETS += $(HARDWARE_TL2SV2)
+COMPONENT_TARGETS += $(HARDWARE_TL2WK2_LSB)
+COMPONENT_TARGETS += $(HARDWARE_TL2SV2_LSB)
+COMPONENT_TARGETS += $(HARDWARE_SIFIVE_U740)
+
+
+NEED_ABS_PATH = true
+COMPONENT_IS_3PP = true
+
+
+include ../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES = sources/packages/a/mc
+
+REQUIRES = app/gpm/1.20.7
+REQUIRES += app/e2fsprogs/1.46.2
+REQUIRES += libs/libssh2/1.9.0
+REQUIRES += libs/glib2/2.76.0
+REQUIRES += libs/slang/2.3.2
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version = 4.8.26
+tar_xz_archive = $(SRC_PACKAGE_PATH)/packages/a/mc/mc-$(version).tar.xz
+SRC_ARCHIVE = $(tar_xz_archive)
+SRC_DIR = $(TARGET_BUILD_DIR)/mc-$(version)
+src_dir_name = mc-$(version)
+src_done = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_dir = $(TARGET_BUILD_DIR)/build
+build_target = $(TARGET_BUILD_DIR)/.build_done
+install_target = $(TARGET_BUILD_DIR)/.install_done
+
+profile_d = $(CURDIR)/profile.d
+
+WITH_SMBFS_HELPERTS = yes
+
+#
+# To enable smbfs helpers we have to use config.cache:
+#
+ifeq ($(WITH_SMBFS_HELPERTS),yes)
+hw_cache_in = $(CURDIR)/cross/hw.cache
+hw_cache = $(CURDIR)/$(build_dir)/hw.cache
+endif
+
+
+####### Targets
+
+PKG_GROUP = app
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+MC_PKG_NAME = mc
+MC_PKG_VERSION = 4.8.26
+MC_PKG_ARCH = $(PKGARCH)
+MC_PKG_DISTRO_NAME = $(DISTRO_NAME)
+MC_PKG_DISTRO_VERSION = $(DISTRO_VERSION)
+MC_PKG_GROUP = $(PKG_GROUP)
+### |---handy-ruler-------------------------------|
+MC_PKG_SHORT_DESCRIPTION = Midnight Commander file manager
+MC_PKG_URL = $(BUG_URL)
+MC_PKG_LICENSE = GPLv3
+MC_PKG_DESCRIPTION_FILE = $(TARGET_BUILD_DIR)/$(MC_PKG_NAME)-pkg-description
+MC_PKG_DESCRIPTION_FILE_IN = $(MC_PKG_NAME)-pkg-description.in
+MC_PKG_INSTALL_SCRIPT = $(MC_PKG_NAME)-pkg-install.sh
+
+MC_PKG = $(CURDIR)/$(TARGET_BUILD_DIR)/$(MC_PKG_NAME)-package
+
+pkg_basename = $(MC_PKG_NAME)-$(MC_PKG_VERSION)-$(MC_PKG_ARCH)-$(MC_PKG_DISTRO_NAME)-$(MC_PKG_DISTRO_VERSION)
+
+pkg_archive = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_certificate = $(call cert-name,$(pkg_archive))
+pkg_signature = $(call sign-name,$(pkg_archive))
+pkg_description = $(call desc-name,$(pkg_archive))
+products = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS = $(build_target)
+BUILD_TARGETS += $(install_target)
+
+PRODUCT_TARGETS = $(products)
+
+ROOTFS_TARGETS = $(pkg_archive)
+
+
+include ../../../build-system/core.mk
+
+
+env_sysroot = DESTDIR=$(MC_PKG)
+
+
+extra_configure_switches = --libdir=/lib$(LIBSUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(src_dir_name)
+extra_configure_switches += --mandir=/usr/share/man
+extra_configure_switches += --disable-dependency-tracking
+extra_configure_switches += --sysconfdir=/etc
+extra_configure_switches += --localstatedir=/var
+extra_configure_switches += --enable-extcharset
+extra_configure_switches += --enable-netcode
+extra_configure_switches += --enable-background
+extra_configure_switches += --enable-charset
+extra_configure_switches += --with-gpm-mouse
+extra_configure_switches += --with-ext2undel
+extra_configure_switches += --with-x=no
+extra_configure_switches += --with-vfs
+
+ifeq ($(WITH_SMBFS_HELPERTS),yes)
+extra_configure_switches += --enable-vfs-smb
+extra_configure_switches += --with-smb-configdir=/etc/samba
+extra_configure_switches += --with-smb-codepagedir=/etc/codepages
+
+extra_configure_switches += --cache-file=$(hw_cache)
+endif
+
+
+CFLAGS += -Wno-maybe-uninitialized -Wstringop-overflow=0 -Wno-nonnull
+CFLAGS += -Wno-deprecated -Wno-deprecated-declarations
+
+TARGET_BIN_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+ $(UNPACK_SRC_ARCHIVE)
+ $(APPLY_PATCHES)
+ @touch $@
+
+$(build_target): $(src_done)
+ @mkdir -p $(build_dir)
+ifeq ($(WITH_SMBFS_HELPERTS),yes)
+ @cp -a $(hw_cache_in) $(hw_cache)
+endif
+ @cd $(build_dir) && \
+ $(BUILD_ENVIRONMENT) ../$(src_dir_name)/configure \
+ --prefix=/usr \
+ --build=$(BUILD) \
+ --host=$(TARGET) \
+ $(extra_configure_switches)
+ @cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+ @touch $@
+
+$(install_target): $(build_target)
+ @mkdir -p $(MC_PKG)
+ @cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+ # ======= Remove Build-System paths =======
+ @sed -i 's,$(BUILDSYSTEM),,g' $(MC_PKG)/usr/share/mc/syntax/Syntax
+ @sed -i 's,$(BUILDSYSTEM),,g' $(MC_PKG)/usr/libexec/mc/ext.d/misc.sh
+ @( cd $(MC_PKG)/usr/libexec/mc/extfs.d ; \
+ for file in deba uzip deb dpkg+ rpms+ debd patchfs ulib a+ s3+ apt+ mailfs ; do \
+ sed -i 's,$(BUILDSYSTEM),,g' $${file} ; \
+ done ; \
+ )
+ # ======= Install MC wrappers =======
+ @mkdir -p $(MC_PKG)/etc/profile.d
+ @cp -a $(profile_d)/mc.* $(MC_PKG)/etc/profile.d
+ @chmod 0755 $(MC_PKG)/etc/profile.d/*
+ @mkdir -p $(MC_PKG)/usr/share/mc/bin
+ @cp -a $(profile_d)/mc-wrapper.* $(MC_PKG)/usr/share/mc/bin
+ @chmod 0755 $(MC_PKG)/usr/share/mc/bin/*
+ # ======= set right permissions =======
+ @chmod 644 $(MC_PKG)/usr/share/mc/help/*
+ # ======= Compress man pages =======
+ @if [ -d $(MC_PKG)/usr/share/man ]; then \
+ ( cd $(MC_PKG)/usr/share/man ; \
+ for manpagedir in `find . -type d -name "man*"` ; do \
+ ( cd $$manpagedir ; \
+ for eachpage in `find . -type l -maxdepth 1` ; do \
+ ln -s `readlink $$eachpage`.gz $$eachpage.gz ; \
+ rm $$eachpage ; \
+ done ; \
+ gzip -9 *.? ; \
+ ) \
+ done \
+ ) \
+ fi
+ # ======= Install Documentation =======
+ @mkdir -p $(MC_PKG)/usr/doc/$(src_dir_name)
+ @cp -a $(SRC_DIR)/AUTHORS $(SRC_DIR)/COPYING \
+ $(MC_PKG)/usr/doc/$(src_dir_name)
+ @mkdir -p $(MC_PKG)/usr/share/doc/$(src_dir_name)
+ @( cd $(SRC_DIR) ; \
+ cp -a AUTHORS doc/COPYING* doc/FAQ \
+ doc/HACKING doc/INSTALL* \
+ doc/MAINTAINERS doc/MIRRORS.txt \
+ doc/README* doc/TODO \
+ $(MC_PKG)/usr/share/doc/$(src_dir_name) \
+ )
+ @( cd $(SRC_DIR) ; \
+ if [ -r NEWS ]; then \
+ DOCSDIR=`echo $(MC_PKG)/usr/share/doc/$(src_dir_name)` ; \
+ cat NEWS | head -n 1000 > $$DOCSDIR/NEWS ; \
+ touch -r NEWS $$DOCSDIR/NEWS ; \
+ fi \
+ )
+ # ======= Install the same to $(TARGET_DEST_DIR) =======
+ $(call install-into-devenv, $(MC_PKG))
+ # ======= Strip binaries =======
+ @( cd $(MC_PKG) ; \
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+ )
+ifneq ($(PATCHELF),)
+ # ======= Set RPATH/RUNPATH for target binaries =======
+ @( cd $(MC_PKG)/usr/bin ; \
+ for file in `find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+ rpath=`$(PATCHELF) --print-rpath $$file 2> /dev/null` ; \
+ if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+ $(PATCHELF) --set-rpath $(TARGET_BIN_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+ fi ; \
+ done ; \
+ )
+endif
+ @touch $@
+
+$(MC_PKG_DESCRIPTION_FILE): $(MC_PKG_DESCRIPTION_FILE_IN)
+ @cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_certificate) : $(pkg_archive) ;
+$(pkg_signature) : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(MC_PKG_DESCRIPTION_FILE) $(MC_PKG_INSTALL_SCRIPT)
+ @cp $(MC_PKG_DESCRIPTION_FILE) $(MC_PKG)/.DESCRIPTION
+ @cp $(MC_PKG_INSTALL_SCRIPT) $(MC_PKG)/.INSTALL
+ @$(BUILD_PKG_REQUIRES) $(MC_PKG)/.REQUIRES
+ @echo "pkgname=$(MC_PKG_NAME)" > $(MC_PKG)/.PKGINFO ; \
+ echo "pkgver=$(MC_PKG_VERSION)" >> $(MC_PKG)/.PKGINFO ; \
+ echo "arch=$(MC_PKG_ARCH)" >> $(MC_PKG)/.PKGINFO ; \
+ echo "distroname=$(MC_PKG_DISTRO_NAME)" >> $(MC_PKG)/.PKGINFO ; \
+ echo "distrover=$(MC_PKG_DISTRO_VERSION)" >> $(MC_PKG)/.PKGINFO ; \
+ echo "group=$(MC_PKG_GROUP)" >> $(MC_PKG)/.PKGINFO ; \
+ echo "short_description=\"$(MC_PKG_SHORT_DESCRIPTION)\"" >> $(MC_PKG)/.PKGINFO ; \
+ echo "url=$(MC_PKG_URL)" >> $(MC_PKG)/.PKGINFO ; \
+ echo "license=$(MC_PKG_LICENSE)" >> $(MC_PKG)/.PKGINFO
+ @$(PSEUDO) sh -c "cd $(MC_PKG) && \
+ chown -R root:root . && \
+ $(MAKE_PACKAGE) -J --linkadd=yes $(GNUPG_OPTIONS) -m -d .. ."
Index: PATCHES
===================================================================
--- PATCHES (nonexistent)
+++ PATCHES (revision 5)
@@ -0,0 +1,2 @@
+
+../../../sources/packages/a/mc/patches/mc-4.8.26-extfs.patch -p0
Index: cross/hw.cache
===================================================================
--- cross/hw.cache (nonexistent)
+++ cross/hw.cache (revision 5)
@@ -0,0 +1,7 @@
+
+samba_cv_have_longlong=yes
+samba_cv_HAVE_GETTIMEOFDAY_TZ=yes
+samba_cv_HAVE_BROKEN_READDIR=no
+samba_cv_HAVE_NETMASK_IFCONF=yes
+samba_cv_HAVE_NETMASK_IFREQ=no
+samba_cv_HAVE_NETMASK_AIX=no
Index: cross/tests/README
===================================================================
--- cross/tests/README (nonexistent)
+++ cross/tests/README (revision 5)
@@ -0,0 +1,2 @@
+
+See the mc-4.8.26/src/vfs/smbfs/helpers/configure script.
Index: cross/tests/broken_readdir/main.c
===================================================================
--- cross/tests/broken_readdir/main.c (nonexistent)
+++ cross/tests/broken_readdir/main.c (revision 5)
@@ -0,0 +1,6 @@
+#include <sys/types.h>
+#include <stdlib.h>
+#include <dirent.h>
+int main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
+if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
+di->d_name[0] == 0) exit(0); exit(1);}
Index: cross/tests/broken_readdir
===================================================================
--- cross/tests/broken_readdir (nonexistent)
+++ cross/tests/broken_readdir (revision 5)
Property changes on: cross/tests/broken_readdir
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: cross/tests/lib/netmask.c
===================================================================
--- cross/tests/lib/netmask.c (nonexistent)
+++ cross/tests/lib/netmask.c (revision 5)
@@ -0,0 +1,395 @@
+/*
+ Unix SMB/Netbios implementation.
+ Version 1.9.
+ code to query kernel netmask
+
+ Copyright (C) Andrew Tridgell 1998
+
+ Copyright (C) 2011-2014
+ Free Software Foundation, Inc.
+
+ This file is part of the Midnight Commander.
+
+ The Midnight Commander is free software: you can redistribute it
+ and/or modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the License,
+ or (at your option) any later version.
+
+ The Midnight Commander is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+/* working out the netmask for an interface is an incredibly non-portable
+ thing. We have several possible implementations below, and autoconf
+ tries each of them to see what works
+
+ Note that this file does _not_ include includes.h. That is so this code
+ can be called directly from the autoconf tests. That also means
+ this code cannot use any of the normal Samba debug stuff or defines.
+ This is standalone code.
+
+ */
+
+#ifndef AUTOCONF
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef HAVE_NETMASK_IFCONF
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+
+#ifndef SIOCGIFCONF
+#include <sys/sockio.h>
+#endif
+
+/*
+ * Prototype for gcc in fussy mode.
+ */
+
+int get_netmask (struct in_addr *ipaddr, struct in_addr *nmask);
+
+/****************************************************************************
+ get the netmask address for a local interface
+****************************************************************************/
+int
+get_netmask (struct in_addr *ipaddr, struct in_addr *nmask)
+{
+ struct ifconf ifc;
+ char buff[2048];
+ int fd, i, n;
+ struct ifreq *ifr = NULL;
+
+ if ((fd = socket (AF_INET, SOCK_DGRAM, 0)) == -1)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "socket failed\n");
+#endif
+ return -1;
+ }
+
+ ifc.ifc_len = sizeof (buff);
+ ifc.ifc_buf = buff;
+ if (ioctl (fd, SIOCGIFCONF, &ifc) != 0)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "SIOCGIFCONF failed\n");
+#endif
+ close (fd);
+ return -1;
+ }
+
+ ifr = ifc.ifc_req;
+
+ n = ifc.ifc_len / sizeof (struct ifreq);
+
+#ifdef DEBUG
+ fprintf (stderr, "%d interfaces - looking for %s\n", n, inet_ntoa (*ipaddr));
+#endif
+
+ /* Loop through interfaces, looking for given IP address */
+ for (i = n - 1; i >= 0; i--)
+ {
+ if (ioctl (fd, SIOCGIFADDR, &ifr[i]) != 0)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "SIOCGIFADDR failed\n");
+#endif
+ continue;
+ }
+
+#ifdef DEBUG
+ fprintf (stderr, "interface %s\n",
+ inet_ntoa ((*(struct sockaddr_in *) &ifr[i].ifr_addr).sin_addr));
+#endif
+ if (ipaddr->s_addr != (*(struct sockaddr_in *) &ifr[i].ifr_addr).sin_addr.s_addr)
+ {
+ continue;
+ }
+
+ if (ioctl (fd, SIOCGIFNETMASK, &ifr[i]) != 0)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "SIOCGIFNETMASK failed\n");
+#endif
+ close (fd);
+ return -1;
+ }
+ close (fd);
+ (*nmask) = ((struct sockaddr_in *) &ifr[i].ifr_addr)->sin_addr;
+#ifdef DEBUG
+ fprintf (stderr, "netmask %s\n", inet_ntoa (*nmask));
+#endif
+ return 0;
+ }
+
+#ifdef DEBUG
+ fprintf (stderr, "interface not found\n");
+#endif
+
+ close (fd);
+ return -1;
+}
+
+#elif defined(HAVE_NETMASK_IFREQ)
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+
+#ifndef SIOCGIFCONF
+#include <sys/sockio.h>
+#endif
+
+#ifndef I_STR
+#include <sys/stropts.h>
+#endif
+
+
+/****************************************************************************
+this should cover most of the rest of systems
+****************************************************************************/
+int
+get_netmask (struct in_addr *ipaddr, struct in_addr *nmask)
+{
+ struct ifreq ifreq;
+ struct strioctl strioctl;
+ struct ifconf *ifc;
+ char buff[2048];
+ int fd, i, n;
+ struct ifreq *ifr = NULL;
+
+ if ((fd = socket (AF_INET, SOCK_DGRAM, 0)) == -1)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "socket failed\n");
+#endif
+ return -1;
+ }
+
+ ifc = (struct ifconf *) buff;
+ ifc->ifc_len = BUFSIZ - sizeof (struct ifconf);
+ strioctl.ic_cmd = SIOCGIFCONF;
+ strioctl.ic_dp = (char *) ifc;
+ strioctl.ic_len = sizeof (buff);
+ if (ioctl (fd, I_STR, &strioctl) < 0)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "SIOCGIFCONF failed\n");
+#endif
+ close (fd);
+ return -1;
+ }
+
+ ifr = (struct ifreq *) ifc->ifc_req;
+
+ /* Loop through interfaces, looking for given IP address */
+ n = ifc->ifc_len / sizeof (struct ifreq);
+
+ for (i = 0; i < n; i++, ifr++)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "interface %s\n",
+ inet_ntoa ((*(struct sockaddr_in *) &ifr->ifr_addr).sin_addr.s_addr));
+#endif
+ if (ipaddr->s_addr == (*(struct sockaddr_in *) &ifr->ifr_addr).sin_addr.s_addr)
+ {
+ break;
+ }
+ }
+
+#ifdef DEBUG
+ if (i == n)
+ {
+ fprintf (stderr, "interface not found\n");
+ close (fd);
+ return -1;
+ }
+#endif
+
+ ifreq = *ifr;
+
+ strioctl.ic_cmd = SIOCGIFNETMASK;
+ strioctl.ic_dp = (char *) &ifreq;
+ strioctl.ic_len = sizeof (struct ifreq);
+ if (ioctl (fd, I_STR, &strioctl) != 0)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "Failed SIOCGIFNETMASK\n");
+#endif
+ close (fd);
+ return -1;
+ }
+
+ close (fd);
+ *nmask = ((struct sockaddr_in *) &ifreq.ifr_addr)->sin_addr;
+#ifdef DEBUG
+ fprintf (stderr, "netmask %s\n", inet_ntoa (*nmask));
+#endif
+ return 0;
+}
+
+#elif defined(HAVE_NETMASK_AIX)
+
+#include <stdio.h>
+#include <unistd.h> /* close() declaration for gcc in fussy mode */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+
+#ifndef SIOCGIFCONF
+#include <sys/sockio.h>
+#endif
+
+/*
+ * Prototype for gcc in fussy mode.
+ */
+
+int get_netmask (struct in_addr *ipaddr, struct in_addr *nmask);
+
+/****************************************************************************
+this one is for AIX
+****************************************************************************/
+
+int
+get_netmask (struct in_addr *ipaddr, struct in_addr *nmask)
+{
+ char buff[2048];
+ int fd, i;
+ struct ifconf ifc;
+ struct ifreq *ifr = NULL;
+
+ if ((fd = socket (AF_INET, SOCK_DGRAM, 0)) == -1)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "socket failed\n");
+#endif
+ return -1;
+ }
+
+
+ ifc.ifc_len = sizeof (buff);
+ ifc.ifc_buf = buff;
+
+ if (ioctl (fd, SIOCGIFCONF, &ifc) != 0)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "SIOCGIFCONF failed\n");
+#endif
+ close (fd);
+ return -1;
+ }
+
+ ifr = ifc.ifc_req;
+ /* Loop through interfaces, looking for given IP address */
+ i = ifc.ifc_len;
+ while (i > 0)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "interface %s\n",
+ inet_ntoa ((*(struct sockaddr_in *) &ifr->ifr_addr).sin_addr));
+#endif
+ if (ipaddr->s_addr == (*(struct sockaddr_in *) &ifr->ifr_addr).sin_addr.s_addr)
+ {
+ break;
+ }
+ i -= ifr->ifr_addr.sa_len + IFNAMSIZ;
+ ifr = (struct ifreq *) ((char *) ifr + ifr->ifr_addr.sa_len + IFNAMSIZ);
+ }
+
+
+#ifdef DEBUG
+ if (i <= 0)
+ {
+ fprintf (stderr, "interface not found\n");
+ close (fd);
+ return -1;
+ }
+#endif
+
+ if (ioctl (fd, SIOCGIFNETMASK, ifr) != 0)
+ {
+#ifdef DEBUG
+ fprintf (stderr, "SIOCGIFNETMASK failed\n");
+#endif
+ close (fd);
+ return -1;
+ }
+
+ close (fd);
+
+ (*nmask) = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr;
+#ifdef DEBUG
+ fprintf (stderr, "netmask %s\n", inet_ntoa (*nmask));
+#endif
+ return 0;
+}
+
+#else /* a dummy version */
+struct in_addr; /* it may not have been declared before */
+int get_netmask (struct in_addr *ipaddr, struct in_addr *nmask);
+int
+get_netmask (struct in_addr *ipaddr, struct in_addr *nmask)
+{
+ return -1;
+}
+#endif
+
+
+#ifdef AUTOCONF
+/* this is the autoconf driver to test get_netmask() */
+
+int main ()
+{
+ char buf[1024];
+ struct hostent *hp;
+ struct in_addr ip, nmask;
+
+ if (gethostname (buf, sizeof (buf) - 1) != 0)
+ {
+ fprintf (stderr, "gethostname failed\n");
+ exit (1);
+ }
+
+ hp = gethostbyname (buf);
+
+ if (!hp)
+ {
+ fprintf (stderr, "gethostbyname failed\n");
+ exit (1);
+ }
+
+ memcpy ((char *) &ip, (char *) hp->h_addr, hp->h_length);
+
+ if (get_netmask (&ip, &nmask) == 0)
+ exit (0);
+
+ fprintf (stderr, "get_netmask failed\n");
+ exit (1);
+}
+#endif
Index: cross/tests/lib
===================================================================
--- cross/tests/lib (nonexistent)
+++ cross/tests/lib (revision 5)
Property changes on: cross/tests/lib
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: cross/tests/netmask_aix/main.c
===================================================================
--- cross/tests/netmask_aix/main.c (nonexistent)
+++ cross/tests/netmask_aix/main.c (revision 5)
@@ -0,0 +1,3 @@
+#define HAVE_NETMASK_AIX 1
+#define AUTOCONF 1
+#include "../lib/netmask.c"
Index: cross/tests/netmask_aix
===================================================================
--- cross/tests/netmask_aix (nonexistent)
+++ cross/tests/netmask_aix (revision 5)
Property changes on: cross/tests/netmask_aix
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: cross/tests/netmask_ifconf/main.c
===================================================================
--- cross/tests/netmask_ifconf/main.c (nonexistent)
+++ cross/tests/netmask_ifconf/main.c (revision 5)
@@ -0,0 +1,3 @@
+#define HAVE_NETMASK_IFCONF 1
+#define AUTOCONF 1
+#include "../lib/netmask.c"
Index: cross/tests/netmask_ifconf
===================================================================
--- cross/tests/netmask_ifconf (nonexistent)
+++ cross/tests/netmask_ifconf (revision 5)
Property changes on: cross/tests/netmask_ifconf
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: cross/tests/netmask_ifreq/main.c
===================================================================
--- cross/tests/netmask_ifreq/main.c (nonexistent)
+++ cross/tests/netmask_ifreq/main.c (revision 5)
@@ -0,0 +1,3 @@
+#define HAVE_NETMASK_IFREQ 1
+#define AUTOCONF 1
+#include "../lib/netmask.c"
Index: cross/tests/netmask_ifreq
===================================================================
--- cross/tests/netmask_ifreq (nonexistent)
+++ cross/tests/netmask_ifreq (revision 5)
Property changes on: cross/tests/netmask_ifreq
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: cross/tests
===================================================================
--- cross/tests (nonexistent)
+++ cross/tests (revision 5)
Property changes on: cross/tests
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: cross
===================================================================
--- cross (nonexistent)
+++ cross (revision 5)
Property changes on: cross
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: mc-pkg-description.in
===================================================================
--- mc-pkg-description.in (nonexistent)
+++ mc-pkg-description.in (revision 5)
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+mc: mc @VERSION@ (Midnight Commander file manager)
+mc:
+mc: The Midnight Commander is a Norton Commander clone, a program
+mc: that manipulates and manages files and directories. Useful, fast,
+mc: and has color displays on the Linux console. Mouse support is
+mc: provided through the gpm mouse server.
+mc:
+mc: mc was written by Miguel de Icaza and Mauricio Plaza.
+mc:
+mc: Homepage: https://midnight-commander.org
+mc:
Index: mc-pkg-install.sh
===================================================================
--- mc-pkg-install.sh (nonexistent)
+++ mc-pkg-install.sh (revision 5)
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Preserve new files
+install_file() {
+ NEW="$1"
+ OLD="`dirname $NEW`/`basename $NEW .new`"
+ # If there's no file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+
+# arg 1: the new package version
+pre_install() {
+ /bin/true
+}
+
+# arg 1: the new package version
+post_install() {
+ /bin/true
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+pre_update() {
+ /bin/true
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_update() {
+ post_install
+}
+
+# arg 1: the old package version
+pre_remove() {
+ /bin/true
+}
+
+# arg 1: the old package version
+post_remove() {
+ /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
Property changes on: mc-pkg-install.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: profile.d/mc-wrapper.csh
===================================================================
--- profile.d/mc-wrapper.csh (nonexistent)
+++ profile.d/mc-wrapper.csh (revision 5)
@@ -0,0 +1,20 @@
+set MC_USER="`id | sed 's/[^(]*(//;s/).*//'`"
+
+if ($?TMPDIR) then
+ setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$
+else
+ setenv MC_PWD_FILE /tmp/mc-$MC_USER/mc.pwd.$$
+endif
+
+/usr/bin/mc -P "$MC_PWD_FILE" $*
+
+if (-r "$MC_PWD_FILE") then
+ setenv MC_PWD "`cat '$MC_PWD_FILE'`"
+ if ( -d "$MC_PWD" ) then
+ cd "$MC_PWD"
+ endif
+ unsetenv MC_PWD
+endif
+
+rm -f "$MC_PWD_FILE"
+unsetenv MC_PWD_FILE
Index: profile.d/mc-wrapper.sh
===================================================================
--- profile.d/mc-wrapper.sh (nonexistent)
+++ profile.d/mc-wrapper.sh (revision 5)
@@ -0,0 +1,14 @@
+MC_USER=`id | sed 's/[^(]*(//;s/).*//'`
+MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"
+/usr/bin/mc -P "$MC_PWD_FILE" "$@"
+
+if test -r "$MC_PWD_FILE"; then
+ MC_PWD="`cat "$MC_PWD_FILE"`"
+ if test -n "$MC_PWD" && test -d "$MC_PWD"; then
+ cd "$MC_PWD"
+ fi
+ unset MC_PWD
+fi
+
+rm -f "$MC_PWD_FILE"
+unset MC_PWD_FILE
Index: profile.d/mc.csh
===================================================================
--- profile.d/mc.csh (nonexistent)
+++ profile.d/mc.csh (revision 5)
@@ -0,0 +1 @@
+alias mc 'source /usr/share/mc/bin/mc-wrapper.csh'
Index: profile.d/mc.sh
===================================================================
--- profile.d/mc.sh (nonexistent)
+++ profile.d/mc.sh (revision 5)
@@ -0,0 +1 @@
+alias mc='. /usr/share/mc/bin/mc-wrapper.sh'
Index: profile.d
===================================================================
--- profile.d (nonexistent)
+++ profile.d (revision 5)
Property changes on: profile.d
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~
Index: .
===================================================================
--- . (nonexistent)
+++ . (revision 5)
Property changes on: .
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,73 ##
+
+# install dir
+dist
+
+# Target build dirs
+.a1x-newlib
+.a2x-newlib
+.at91sam7s-newlib
+
+.build-machine
+
+.a1x-glibc
+.a2x-glibc
+.h3-glibc
+.h5-glibc
+.i586-glibc
+.i686-glibc
+.imx6-glibc
+.jz47xx-glibc
+.makefile
+.am335x-glibc
+.omap543x-glibc
+.p5600-glibc
+.power8-glibc
+.power8le-glibc
+.power9-glibc
+.power9le-glibc
+.m1000-glibc
+.riscv64-glibc
+.rk328x-glibc
+.rk33xx-glibc
+.rk339x-glibc
+.s8xx-glibc
+.s9xx-glibc
+.x86_64-glibc
+
+# Hidden files (each file)
+.makefile
+.dist
+.rootfs
+
+# src & hw requires
+.src_requires
+.src_requires_depend
+.requires
+.requires_depend
+
+# Tarballs
+*.gz
+*.bz2
+*.lz
+*.xz
+*.tgz
+*.txz
+
+# Signatures
+*.asc
+*.sig
+*.sign
+*.sha1sum
+
+# Patches
+*.patch
+
+# Descriptions
+*.dsc
+*.txt
+
+# Default linux config files
+*.defconfig
+
+# backup copies
+*~