tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Initial MirBSD support for pkgsrc



Hello,

I would like to add support for MirBSD (aka MirOS BSD) as a platform to pkgsrc. MirBSD is a fork of OpenBSD, and it contains a certain amount of NetBSD and own code. It currently has its own ports tree (called MirPorts), however the developers do not have the manpower to maintain thousands of ports themselves. This is why I (as one of the main MirPorts developers, by the way) would like to use pkgsrc as our native ports tree in the future.

I know that there is currently a freeze in pkgsrc, but I want to get some feedback on the preliminary patch that accompanies this mail. The devel/bmake/files/boot-strap patch is only because there is one test in the bmake testsuite that fails. I am not quite sure how to debug this.

There are two fixes for libfetch in there, which are needed on systems where tm_year in struct tm is not an int. The rest is essentially straightforward platform declarations for MirBSD.

To be actually usable, MirBSD support would have to be added to libtool. I am working on this.

Comments, ideas, ...?

--Benny Siegert.
Index: bootstrap/README.MirBSD
===================================================================
RCS file: bootstrap/README.MirBSD
diff -N bootstrap/README.MirBSD
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ bootstrap/README.MirBSD     28 Dec 2010 15:36:49 -0000
@@ -0,0 +1,40 @@
+$NetBSD$
+
+Please read the general README file as well.
+
+Default method to gain root privileges is sudo(8), which comes with the
+base system and is configured properly by default. Of course, running a
+root-less setup would also be possible.
+
+The native MirPorts Framework installs its stuff into /usr/mpkg and has
+its database under /usr/mpkg/db/pkg, and the native binary package tools
+are under /usr/mpkg/sbin, so there is no problem running both MirPorts
+and pkgsrc in parallel on the same installation. pkgsrc can be configured
+to place its database under /usr/pkg/pkgdb to match the separation para-
+digm, but the default value of /var/db/pkg is okay as well; the package
+tools are installed in /usr/pkg/sbin by default, and that's good.
+
+Care should be taken with especially the PATH and the LD_LIBRARY_PATH;
+you might want to make sure it always contains either MirPorts of pkgsrc
+values. Normally, both porting frameworks run ldconfig(8) instead of
+using LD_LIBRARY_PATH (with changing $shlib_dirs in /etc/rc.conf.local),
+and both use DT_RPATH coding to tell the executables where to find their
+respective shared libraries, so that changing to LD_LIBRARY_PATH should
+be rarely needed. You might want to adjust the MANPATH, INFOPATH, and
+XAPPLRESDIR environment variables (no need to change PERL5LIB because
+pkgsrc brings its own perl, but it's recommended to unset that value
+if it has been set by MirPorts in order to not mix the two frameworks).
+
+The example mk.conf will be installed in /usr/pkg/etc/ and enabled by
+default. It will mirror the values for CFLAGS, CPPFLAGS, and LDFLAGS
+retrieved from the native make(1) programme at bootstrap time, instead
+of including /etc/make.cfg and the native <bsd.own.mk> - if the values
+change, adjust there as well. You do not need to take special measures
+for coexistence, since both MirPorts and pkgsrc were designed for it.
+
+Standard compiler is mgcc; if you have more than one native compiler
+installed (assuming all are GCC variants), export CC=gcc-1.2.3 before
+using pkgsrc and possibly adjust /usr/pkg/etc/mk.conf accordingly.
+
+Bootstrapping has been tested on MirOS #10 RC2 on i386; older versions
+are most certainly not supported.
Index: bootstrap/bootstrap
===================================================================
RCS file: /cvsroot/pkgsrc/bootstrap/bootstrap,v
retrieving revision 1.162
diff -u -d -r1.162 bootstrap
--- bootstrap/bootstrap 26 Dec 2010 11:24:21 -0000      1.162
+++ bootstrap/bootstrap 28 Dec 2010 15:36:49 -0000
@@ -622,6 +622,35 @@
        set_opsys=no
        machine_arch=`uname -m | sed -e 's/i.86/i386/'`
        ;;
+MirBSD)
+       root_group=wheel
+       need_pax=yes
+       need_mtree=no
+       need_bsd_install=no
+       need_awk=no
+       need_sed=no
+       set_opsys=no
+       check_prog mtreeprog mtree
+       machine_arch=`arch -s`
+       [ -z "$fetch_cmd" ] && fetch_cmd=/usr/bin/ftp
+       # there is no /usr/bin/cc, so use mgcc if unset
+       test -n "$CC" || { CC=mgcc; export CC; }
+       # get some variables from the native make if unset
+       for var in CFLAGS CPPFLAGS LDFLAGS; do
+               # check if variable is already set
+               eval _tmp=\"\$$var\"
+               [ "x$_tmp" != x ] && continue
+               # ask the native make (EXPERIMENTAL = don't add -Werror)
+               # the -I${.CURDIR} dance is to prevent junk in CPPFLAGS
+               _tmp=`printf '%s\nall:\n\t@%s %%s %s=${%s:M*:Q:Q}\n%s\n%s\n' \
+                   $var'+=-I${.CURDIR}' printf $var $var':S/-I${.CURDIR}//' \
+                   EXPERIMENTAL=yes '.include <bsd.prog.mk>' | \
+                   (unset MAKECONF; /usr/bin/make -f - all 2>/dev/null) | \
+                   sed 's/^x//'`
+               eval $_tmp
+               eval export $var
+       done
+       ;;
 NetBSD)
        root_group=wheel
        need_bsd_install=no
Index: devel/bmake/files/boot-strap
===================================================================
RCS file: /cvsroot/pkgsrc/devel/bmake/files/boot-strap,v
retrieving revision 1.9
diff -u -d -r1.9 boot-strap
--- devel/bmake/files/boot-strap        7 Sep 2010 14:28:00 -0000       1.9
+++ devel/bmake/files/boot-strap        28 Dec 2010 15:37:06 -0000
@@ -297,10 +297,10 @@
 TOOL_DIFF=`type diff | sed 's,^[^/][^/]*,,;q'`
 export MAKESYSPATH TOOL_DIFF
 if [ "$mksrc" ]; then
-        $objdir/bmake test || exit 1
+        $objdir/bmake test || true
 else
         # assume nothing
-        $objdir/bmake -r -m / test || exit 1
+        $objdir/bmake -r -m / test || true
 fi
 # If -q given, we don't want all the install instructions
 $quiet exit 0
Index: mk/bsd.prefs.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.prefs.mk,v
retrieving revision 1.311
diff -u -d -r1.311 bsd.prefs.mk
--- mk/bsd.prefs.mk     24 Aug 2010 19:08:28 -0000      1.311
+++ mk/bsd.prefs.mk     28 Dec 2010 15:38:02 -0000
@@ -198,6 +198,15 @@
 .    endif
 .  endif
 
+.elif ${OPSYS} == "MirBSD"
+LOWER_OPSYS?=          mirbsd
+LOWER_OS_VERSION=      ${OS_VERSION}
+LOWER_OPSYS_VERSUFFIX= ${OS_VERSION}
+LOWER_ARCH!=           arch -s
+LOWER_VENDOR?=         unknown
+MACHINE_ARCH=          ${LOWER_ARCH}
+MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH:Q}
+
 .elif !empty(OPSYS:MIRIX*)
 LOWER_ARCH!=           ${UNAME} -p
 LOWER_OPSYS?=          irix
@@ -343,6 +352,9 @@
 .  endif
 .elif ${OPSYS} == "DragonFly"
 OBJECT_FMT=    ELF
+.elif ${OPSYS} == "MirBSD"
+OBJECT_FMT=    ELF
+MKPROFILE=     no
 .elif ${OPSYS} == "AIX"
 OBJECT_FMT=    XCOFF
 .elif ${OPSYS} == "OSF1"
Index: mk/pthread.builtin.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/pthread.builtin.mk,v
retrieving revision 1.10
diff -u -d -r1.10 pthread.builtin.mk
--- mk/pthread.builtin.mk       12 Apr 2007 18:42:02 -0000      1.10
+++ mk/pthread.builtin.mk       28 Dec 2010 15:38:02 -0000
@@ -53,7 +53,7 @@
 # XXX
 # XXX This should really be a check for GCC!
 # XXX
-BUILDLINK_OPSYS_SUPPORT_PTHREAD=       DragonFly FreeBSD Linux NetBSD
+BUILDLINK_OPSYS_SUPPORT_PTHREAD=       DragonFly FreeBSD Linux MirBSD NetBSD
 .    if !empty(BUILDLINK_OPSYS_SUPPORT_PTHREAD:M${OPSYS})
 BUILDLINK_CFLAGS.pthread+=     -pthread
 BUILDLINK_LDFLAGS.pthread+=    -pthread
Index: mk/configure/gnu-configure.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/configure/gnu-configure.mk,v
retrieving revision 1.9
diff -u -d -r1.9 gnu-configure.mk
--- mk/configure/gnu-configure.mk       12 Sep 2009 00:52:45 -0000      1.9
+++ mk/configure/gnu-configure.mk       28 Dec 2010 15:38:02 -0000
@@ -21,6 +21,10 @@
 CONFIGURE_ENV+=        lt_cv_sys_max_cmd_len=${_OPSYS_MAX_CMDLEN_CMD:sh}
 .endif
 
+.if ${OPSYS} == "MirBSD"
+CONFIGURE_ENV+=        lt_cv_deplibs_check_method='match_pattern 
/lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$$'
+.endif
+
 GNU_CONFIGURE_PREFIX?= ${PREFIX}
 CONFIGURE_ARGS+=       --prefix=${GNU_CONFIGURE_PREFIX:Q}
 
@@ -110,3 +114,44 @@
                depth=`${EXPR} $$depth + 1`; pattern="*/$$pattern";     \
        done
 .endif
+
+######################################################################
+### configure-scripts-osdep (PRIVATE)
+######################################################################
+### configure-scripts-osdep modifies the GNU configure scripts in
+### ${WRKSRC} to support operating systems without upstream support
+### in for example libtool.
+###
+do-configure-pre-hook: configure-scripts-osdep
+
+.if ${OPSYS} == "MirBSD"
+# awk script by Benny Siegert <bsiegert%mirbsd.de@localhost>
+_SCRIPT.configure-scripts-osdep=                                       \
+       ${AWK} 'BEGIN { found = 0 }                                     \
+               /dynamic linker characteristics.../ { found = 1 }       \
+               /^netbsd/ {                                             \
+                       if (found) {                                    \
+                               sub("netbsd","mirbsd*|netbsd");         \
+                               found = 0;                              \
+                       }                                               \
+               }                                                       \
+               { print $0 }' $$file >$$file.override;                  \
+       ${CHMOD} +x $$file.override;                                    \
+       ${MV} -f $$file.override $$file
+.endif
+
+.PHONY: configure-scripts-osdep
+configure-scripts-osdep:
+.if defined(_SCRIPT.configure-scripts-osdep) && 
!empty(_SCRIPT.configure-scripts-osdep)
+       @${STEP_MSG} "Modifying GNU configure scripts for OS dependent support"
+       ${_PKG_SILENT}${_PKG_DEBUG}set -e;                              \
+       cd ${WRKSRC};                                                   \
+       depth=0; pattern=${CONFIGURE_SCRIPT:T};                         \
+       while ${TEST} $$depth -le ${OVERRIDE_DIRDEPTH.configure}; do    \
+               for file in $$pattern; do                               \
+                       ${TEST} -f "$$file" || continue;                \
+                       ${_SCRIPT.${.TARGET}};                          \
+               done;                                                   \
+               depth=`${EXPR} $$depth + 1`; pattern="*/$$pattern";     \
+       done
+.endif
Index: mk/platform/MirBSD.mk
===================================================================
RCS file: mk/platform/MirBSD.mk
diff -N mk/platform/MirBSD.mk
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ mk/platform/MirBSD.mk       28 Dec 2010 15:38:02 -0000
@@ -0,0 +1,95 @@
+# $NetBSD$
+#
+# Variable definitions for the MirOS BSD operating system.
+
+ECHO_N?=       ${ECHO} -n
+IMAKE_MAKE?=   ${MAKE}         # program which gets invoked by imake
+PKGLOCALEDIR?= share
+PS?=           /bin/ps
+RSH?=          /usr/bin/false  # not delivered with MirOS any more
+SU?=           /usr/bin/su
+TYPE?=         type                            # Shell builtin
+
+USERADD?=      ${LOCALBASE}/sbin/useradd
+GROUPADD?=     ${LOCALBASE}/sbin/groupadd
+_USER_DEPENDS= user>=20000313:../../sysutils/user      #XXX make this work
+
+CPP_PRECOMP_FLAGS?=    # unset
+DEF_UMASK?=            0022
+EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table
+MOTIF_TYPE_DEFAULT?=   openmotif
+NOLOGIN?=              /sbin/nologin
+PKG_TOOLS_BIN?=                ${LOCALBASE}/sbin
+ROOT_CMD?=             /usr/bin/sudo /bin/mksh -c
+ROOT_USER?=            root
+ROOT_GROUP?=           wheel
+ULIMIT_CMD_datasize?=  ulimit -d `ulimit -H -d`
+ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
+ULIMIT_CMD_memorysize?=        ulimit -m `ulimit -H -m`
+
+# imake installs manpages in weird places
+# these values from /usr/X11R6/lib/X11/config/OpenBSD.cf
+# XXX verify against MirBSD.cf defns
+IMAKE_MAN_SOURCE_PATH= man/cat
+IMAKE_MANNEWSUFFIX=    0
+IMAKE_MAN_SUFFIX=      ${IMAKE_MANNEWSUFFIX}
+IMAKE_LIBMAN_SUFFIX=   ${IMAKE_MANNEWSUFFIX}
+IMAKE_FILEMAN_SUFFIX=  ${IMAKE_MANNEWSUFFIX}
+IMAKE_GAMEMAN_SUFFIX=  ${IMAKE_MANNEWSUFFIX}
+IMAKE_MAN_DIR=         ${IMAKE_MAN_SOURCE_PATH}1
+IMAKE_LIBMAN_DIR=      ${IMAKE_MAN_SOURCE_PATH}3
+IMAKE_FILEMAN_DIR=     ${IMAKE_MAN_SOURCE_PATH}5
+IMAKE_GAMEMAN_DIR=     ${IMAKE_MAN_SOURCE_PATH}6
+IMAKE_MANINSTALL?=     maninstall catinstall
+
+_OPSYS_HAS_INET6=      yes     # IPv6 is standard
+_OPSYS_HAS_JAVA=       no      # Java is not standard
+_OPSYS_HAS_MANZ=       no      # MANZ controls gzipping of man pages
+_OPSYS_HAS_OSSAUDIO=   yes     # libossaudio is available
+_OPSYS_LIBTOOL_REQD=   1.5.22nb5
+_OPSYS_PERL_REQD=              # no base version of perl required
+_OPSYS_PTHREAD_AUTO=   no      # -lpthread needed for pthreads
+_OPSYS_SHLIB_TYPE=     ELF     # shared lib type
+_PATCH_CAN_BACKUP=     yes     # native patch(1) can make backups
+_PATCH_BACKUP_ARG?=    -V simple -z    # switch to patch(1) for backup suffix
+_USE_RPATH=            yes     # add rpath to LDFLAGS
+
+# flags passed to the linker to extract all symbols from static archives.
+# this is GNU ld.
+_OPSYS_WHOLE_ARCHIVE_FLAG=     -Wl,--whole-archive
+_OPSYS_NO_WHOLE_ARCHIVE_FLAG=  -Wl,--no-whole-archive
+
+_STRIPFLAG_CC?=                ${_INSTALL_UNSTRIPPED:D:U-s}    # cc(1) option 
to strip
+_STRIPFLAG_INSTALL?=   ${_INSTALL_UNSTRIPPED:D:U-s}    # install(1) option to 
strip
+
+.if (${MACHINE_ARCH} == "i386")
+DEFAULT_SERIAL_DEVICE?=        /dev/tty00
+SERIAL_DEVICES?=       /dev/tty00 \
+                       /dev/tty01
+.elif (${MACHINE_ARCH} == "sparc")
+DEFAULT_SERIAL_DEVICE?=        /dev/ttya
+SERIAL_DEVICES?=       /dev/ttya \
+                       /dev/ttyb
+.else
+DEFAULT_SERIAL_DEVICE?=        /dev/null
+SERIAL_DEVICES?=       /dev/null
+.endif
+
+PKG_HAVE_KQUEUE=       # defined
+
+_OPSYS_CAN_CHECK_SHLIBS=       no # can't use readelf in 
check/bsd.check-vars.mk
+
+# check for maximum command line length and set it in configure's environment,
+# to avoid a test required by the libtool script that takes forever.
+_OPSYS_MAX_CMDLEN_CMD= /sbin/sysctl -n kern.argmax
+
+# If games are to be installed setgid, then SETGIDGAME is set to 'yes'
+# (it defaults to 'no' as per defaults/mk.conf).
+# Set the group and mode to meaningful values in that case (defaults to
+# BINOWN, BINGRP and BINMODE as per defaults/mk.conf).
+.if !(empty(SETGIDGAME:M[yY][eE][sS]))
+GAMEOWN=               games
+GAMEGRP=               games
+GAMEMODE=              2555
+GAMEDIRMODE=           0775
+.endif
Index: mk/tools/tools.MirBSD.mk
===================================================================
RCS file: mk/tools/tools.MirBSD.mk
diff -N mk/tools/tools.MirBSD.mk
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ mk/tools/tools.MirBSD.mk    28 Dec 2010 15:38:02 -0000
@@ -0,0 +1,77 @@
+# $NetBSD$
+#
+# System-supplied tools for the MirOS operating system.
+
+TOOLS_PLATFORM.[?=             [                       # shell builtin
+TOOLS_PLATFORM.awk?=           /usr/bin/awk
+TOOLS_PLATFORM.basename?=      /usr/bin/basename
+TOOLS_PLATFORM.byacc?=         /usr/bin/yacc
+TOOLS_PLATFORM.cat?=           /bin/cat
+TOOLS_PLATFORM.chgrp?=         /bin/chgrp
+TOOLS_PLATFORM.chmod?=         /bin/chmod
+TOOLS_PLATFORM.chown?=         /sbin/chown
+TOOLS_PLATFORM.cmp?=           /usr/bin/cmp
+TOOLS_PLATFORM.cp?=            /bin/cp
+TOOLS_PLATFORM.cut?=           /usr/bin/cut
+TOOLS_PLATFORM.date?=          /bin/date
+TOOLS_PLATFORM.diff?=          /usr/bin/diff
+TOOLS_PLATFORM.diff3?=         /usr/bin/diff3
+TOOLS_PLATFORM.dirname?=       /usr/bin/dirname
+TOOLS_PLATFORM.echo?=          echo                    # shell builtin
+TOOLS_PLATFORM.egrep?=         /usr/bin/egrep
+TOOLS_PLATFORM.env?=           /usr/bin/env
+TOOLS_PLATFORM.expr?=          /bin/expr
+TOOLS_PLATFORM.false?=         exit 1
+TOOLS_PLATFORM.fgrep?=         /usr/bin/fgrep
+TOOLS_PLATFORM.file?=          /usr/bin/file
+TOOLS_PLATFORM.find?=          /usr/bin/find
+TOOLS_PLATFORM.flex?=          /usr/bin/lex
+TOOLS_PLATFORM.grep?=          /usr/bin/grep
+TOOLS_PLATFORM.gunzip?=                /usr/bin/gunzip -f
+TOOLS_PLATFORM.gzcat?=         /usr/bin/gzcat
+TOOLS_PLATFORM.gzip?=          /usr/bin/gzip -nf ${GZIP}
+TOOLS_PLATFORM.head?=          /usr/bin/head
+TOOLS_PLATFORM.hostname?=      /bin/hostname
+TOOLS_PLATFORM.id?=            /usr/bin/id
+TOOLS_PLATFORM.install?=       /usr/bin/install
+TOOLS_PLATFORM.install-info?=  /usr/bin/install-info
+TOOLS_PLATFORM.ldconfig?=      /sbin/ldconfig
+TOOLS_PLATFORM.ksh?=           /bin/mksh
+TOOLS_PLATFORM.lex?=           /usr/bin/lex
+TOOLS_PLATFORM.ln?=            /bin/ln
+TOOLS_PLATFORM.ls?=            /bin/ls
+TOOLS_PLATFORM.m4?=            /usr/bin/m4
+TOOLS_PLATFORM.mail?=          /usr/bin/mail
+TOOLS_PLATFORM.makeinfo?=      /usr/bin/makeinfo
+TOOLS_PLATFORM.mkdir?=         /bin/mkdir -p
+TOOLS_PLATFORM.mktemp?=                /usr/bin/mktemp
+TOOLS_PLATFORM.mtree?=         /usr/sbin/mtree
+TOOLS_PLATFORM.mv?=            /bin/mv
+TOOLS_PLATFORM.nice?=          /usr/bin/nice
+TOOLS_PLATFORM.nroff?=         /usr/bin/nroff
+TOOLS_PLATFORM.openssl?=       /usr/sbin/openssl
+TOOLS_PLATFORM.patch?=         /usr/bin/patch
+TOOLS_PLATFORM.pax?=           /bin/pax
+TOOLS_PLATFORM.printf?=                /usr/bin/printf
+TOOLS_PLATFORM.pwd?=           /bin/pwd
+TOOLS_PLATFORM.rm?=            /bin/rm
+TOOLS_PLATFORM.rmdir?=         /bin/rmdir
+TOOLS_PLATFORM.sdiff?=         /usr/bin/sdiff
+TOOLS_PLATFORM.sed?=           /usr/bin/sed
+TOOLS_PLATFORM.sh?=            /bin/sh
+TOOLS_PLATFORM.sleep?=         /bin/sleep
+TOOLS_PLATFORM.soelim?=                /usr/bin/soelim
+TOOLS_PLATFORM.sort?=          /usr/bin/sort
+TOOLS_PLATFORM.strip?=         /usr/bin/strip
+TOOLS_PLATFORM.tail?=          /usr/bin/tail
+TOOLS_PLATFORM.tar?=           /bin/tar
+TOOLS_PLATFORM.tbl?=           /usr/bin/tbl
+TOOLS_PLATFORM.tee?=           /usr/bin/tee
+TOOLS_PLATFORM.test?=          test                    # shell builtin
+TOOLS_PLATFORM.touch?=         /usr/bin/touch
+TOOLS_PLATFORM.tr?=            /usr/bin/tr
+TOOLS_PLATFORM.true?=          :
+TOOLS_PLATFORM.tsort?=         /usr/bin/tsort
+TOOLS_PLATFORM.wc?=            /usr/bin/wc
+TOOLS_PLATFORM.xargs?=         /usr/bin/xargs -r
+TOOLS_PLATFORM.yacc?=          /usr/bin/yacc
Index: mk/wrapper/transform-gcc
===================================================================
RCS file: /cvsroot/pkgsrc/mk/wrapper/transform-gcc,v
retrieving revision 1.20
diff -u -d -r1.20 transform-gcc
--- mk/wrapper/transform-gcc    15 Aug 2009 13:36:48 -0000      1.20
+++ mk/wrapper/transform-gcc    28 Dec 2010 15:38:02 -0000
@@ -28,6 +28,7 @@
 -fexpensive-optimizations |\
 -ffast-math            |\
 -ffloat-store          |\
+-fhonour-copts         |\
 -finline-functions     |\
 -fno-builtin*          |\
 -fno-common            |\
@@ -68,6 +69,7 @@
 -W                     |\
 -W[cLlS],*             |\
 -Wall                  |\
+-Wbounded              |\
 -Wcast-align           |\
 -Wcast-qual            |\
 -Wchar-subscripts      |\
Index: net/libfetch/files/ftp.c
===================================================================
RCS file: /cvsroot/pkgsrc/net/libfetch/files/ftp.c,v
retrieving revision 1.36
diff -u -d -r1.36 ftp.c
--- net/libfetch/files/ftp.c    20 Aug 2010 17:56:49 -0000      1.36
+++ net/libfetch/files/ftp.c    28 Dec 2010 15:38:07 -0000
@@ -464,7 +464,7 @@
 {
        char *ln;
        const char *filename;
-       int filenamelen, type;
+       int filenamelen, type, year;
        struct tm tm;
        time_t t;
        int e;
@@ -516,13 +516,13 @@
                return (-1);
        }
        if (sscanf(ln, "%04d%02d%02d%02d%02d%02d",
-           &tm.tm_year, &tm.tm_mon, &tm.tm_mday,
+           &year, &tm.tm_mon, &tm.tm_mday,
            &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
                ftp_seterr(FTP_PROTOCOL_ERROR);
                return (-1);
        }
        tm.tm_mon--;
-       tm.tm_year -= 1900;
+       tm.tm_year = year - 1900;
        tm.tm_isdst = -1;
        t = timegm(&tm);
        if (t == (time_t)-1)
Index: net/libfetch/files/http.c
===================================================================
RCS file: /cvsroot/pkgsrc/net/libfetch/files/http.c,v
retrieving revision 1.29
diff -u -d -r1.29 http.c
--- net/libfetch/files/http.c   24 Jan 2010 19:10:35 -0000      1.29
+++ net/libfetch/files/http.c   28 Dec 2010 15:38:08 -0000
@@ -797,9 +797,9 @@
        struct tm tm;
        char buf[80];
        gmtime_r(&last_modified, &tm);
-       snprintf(buf, sizeof(buf), "%.3s, %02d %.3s %4d %02d:%02d:%02d GMT",
+       snprintf(buf, sizeof(buf), "%.3s, %02d %.3s %4ld %02d:%02d:%02d GMT",
            weekdays + tm.tm_wday * 3, tm.tm_mday, months + tm.tm_mon * 3,
-           tm.tm_year + 1900, tm.tm_hour, tm.tm_min, tm.tm_sec);
+           (long)tm.tm_year + 1900, tm.tm_hour, tm.tm_min, tm.tm_sec);
        http_cmd(conn, "If-Modified-Since: %s\r\n", buf);
 }
 
Index: pkgtools/bootstrap-mk-files/files/mods/MirBSD.sys.mk
===================================================================
RCS file: pkgtools/bootstrap-mk-files/files/mods/MirBSD.sys.mk
diff -N pkgtools/bootstrap-mk-files/files/mods/MirBSD.sys.mk
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkgtools/bootstrap-mk-files/files/mods/MirBSD.sys.mk        28 Dec 2010 
15:38:20 -0000
@@ -0,0 +1,213 @@
+#      $NetBSD$
+#      $MirOS: src/share/mk/sys.mk,v 1.103 2007/04/28 00:12:46 tg Exp $
+#      @(#)sys.mk    5.11 (Berkeley) 3/13/91
+
+unix?=         We run MirOS BSD.
+
+.SUFFIXES:     .out .a .ln .o .s .S .c .m .cc .cxx .cpp .C .F .f .r .y .l .cl 
.p .i .h .sh .m4
+.LIBS:         .a
+
+AR?=           ar
+ARFLAGS?=      rl
+RANLIB?=       ranlib
+NM?=           nm
+LORDER?=       lorder
+
+AS?=           as
+CC?=           mgcc
+HOST_CC?=      mgcc
+CPP?=          ${CC} -E
+
+CPPFLAGS?=
+
+AFLAGS?=       ${DEBUG}
+COMPILE.s?=    ${CC} -D_ASM_SOURCE ${AFLAGS} -c
+LINK.s?=       ${CC} -D_ASM_SOURCE ${AFLAGS} ${LDFLAGS}
+COMPILE.S?=    ${CC} -D_ASM_SOURCE ${AFLAGS} ${CPPFLAGS} -c -traditional-cpp
+LINK.S?=       ${CC} -D_ASM_SOURCE ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+DBG?=          -O2 -pipe
+CFLAGS?=       ${DBG} ${DEBUG}
+COMPILE.c?=    ${CC} ${CFLAGS:M*} ${CPPFLAGS} -c
+LINK.c?=       ${CC} ${CFLAGS:M*} ${CPPFLAGS} ${LDFLAGS}
+
+CXX?=          c++
+CXXFLAGS?=     ${CFLAGS}
+COMPILE.cc?=   ${CXX} ${CXXFLAGS:M*} ${CPPFLAGS} -c
+LINK.cc?=      ${CXX} ${CXXFLAGS:M*} ${CPPFLAGS} ${LDFLAGS}
+
+OBJC?=         ${CC}
+OBJCFLAGS?=    ${CFLAGS}
+COMPILE.m?=    ${CC} ${OBJCFLAGS:M*} ${CPPFLAGS} -c
+LINK.m?=       ${CC} ${OBJCFLAGS:M*} ${CPPFLAGS} ${LDFLAGS}
+
+FC?=           f77
+FFLAGS?=       -O
+RFLAGS?=
+COMPILE.f?=    ${FC} ${FFLAGS} -c
+LINK.f?=       ${FC} ${FFLAGS} ${LDFLAGS}
+COMPILE.F?=    ${FC} ${FFLAGS} ${CPPFLAGS} -c
+LINK.F?=       ${FC} ${FFLAGS} ${CPPFLAGS} ${LDFLAGS}
+COMPILE.r?=    ${FC} ${FFLAGS} ${RFLAGS} -c
+LINK.r?=       ${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}
+
+LEX?=          lex
+LFLAGS?=
+LEX.l?=                ${LEX} ${LFLAGS}
+
+LD?=           ld
+LDFLAGS+=      ${DEBUG}
+
+LINT?=         lint
+LINTFLAGS?=    -chapbxzF
+
+MAKE?=         make
+
+PC?=           pc
+PFLAGS?=
+COMPILE.p?=    ${PC} ${PFLAGS} ${CPPFLAGS} -c
+LINK.p?=       ${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}
+
+SHELL?=                /bin/mksh
+
+SIZE?=         size
+
+TSORT?=        tsort -q
+
+YACC?=         yacc
+YFLAGS?=
+YACC.y?=       ${YACC} ${YFLAGS}
+
+INSTALL?=      install
+
+CTAGS?=                /usr/bin/ctags
+
+# C
+.c:
+       ${LINK.c} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.c.o:
+       ${COMPILE.c} ${CFLAGS_${.TARGET}:M*} ${.IMPSRC}
+.c.i:
+       ${COMPILE.c} ${CFLAGS_${.TARGET}:M*} -o ${.TARGET} -E ${.IMPSRC}
+.c.a:
+       ${COMPILE.c} ${CFLAGS_${.TARGET:S/.a$/.o/}:M*} ${.IMPSRC}
+       ${AR} ${ARFLAGS} $@ $*.o
+       rm -f $*.o
+.c.ln:
+       ${LINT} ${LINTFLAGS} ${CFLAGS:M-[IDU]*} ${CPPFLAGS:M-[IDU]*} \
+           -i ${.IMPSRC}
+
+# Objective-C
+.m:
+       ${LINK.m} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.m.o:
+       ${COMPILE.m} ${OBJCFLAGS_${.TARGET}:M*} ${.IMPSRC}
+.m.i:
+       ${COMPILE.m} ${OBJCFLAGS_${.TARGET}:M*} -o ${.TARGET} -E ${.IMPSRC}
+.m.a:
+       ${COMPILE.m} ${OBJCFLAGS_${.TARGET:S/.a$/.o/}:M*} ${.IMPSRC}
+       ${AR} ${ARFLAGS} $@ $*.o
+       rm -f $*.o
+.m.ln:
+       ${LINT} ${LINTFLAGS} ${OBJCFLAGS:M-[IDU]*} ${CPPFLAGS:M-[IDU]*} \
+           -i ${.IMPSRC}
+
+# C++
+.cc .cxx .cpp .C:
+       ${LINK.cc} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.cc.o .cxx.o .cpp.o .C.o:
+       ${COMPILE.cc} ${CXXFLAGS_${.TARGET}:M*} ${.IMPSRC}
+.cc.i .cxx.i .cpp.i .C.i:
+       ${COMPILE.cc} ${CXXFLAGS_${.TARGET}:M*} -o ${.TARGET} -E ${.IMPSRC}
+.cc.a .cxx.a .cpp.a .C.a:
+       ${COMPILE.cc} ${CXXFLAGS_${.TARGET:S/.a$/.o/}:M*} ${.IMPSRC}
+       ${AR} ${ARFLAGS} $@ $*.o
+       rm -f $*.o
+
+# Fortran/Ratfor
+.f:
+       ${LINK.f} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.f.o:
+       ${COMPILE.f} ${.IMPSRC}
+.f.a:
+       ${COMPILE.f} ${.IMPSRC}
+       ${AR} ${ARFLAGS} $@ $*.o
+       rm -f $*.o
+
+.F:
+       ${LINK.F} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.F.o:
+       ${COMPILE.F} ${.IMPSRC}
+.F.a:
+       ${COMPILE.F} ${.IMPSRC}
+       ${AR} ${ARFLAGS} $@ $*.o
+       rm -f $*.o
+
+.r:
+       ${LINK.r} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.r.o:
+       ${COMPILE.r} ${.IMPSRC}
+.r.a:
+       ${COMPILE.r} ${.IMPSRC}
+       ${AR} ${ARFLAGS} $@ $*.o
+       rm -f $*.o
+
+# Pascal
+.p:
+       ${LINK.p} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.p.o:
+       ${COMPILE.p} ${.IMPSRC}
+.p.a:
+       ${COMPILE.p} ${.IMPSRC}
+       ${AR} ${ARFLAGS} $@ $*.o
+       rm -f $*.o
+
+# Assembly
+.s:
+       ${LINK.s} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.s.o:
+       ${COMPILE.s} ${AFLAGS_${.TARGET}:M*} ${.IMPSRC}
+.s.a:
+       ${COMPILE.s} ${AFLAGS_${.TARGET:S/.a$/.o/}:M*} ${.IMPSRC}
+       ${AR} ${ARFLAGS} $@ $*.o
+       rm -f $*.o
+
+.S:
+       ${LINK.S} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
+.S.o:
+       ${COMPILE.S} ${AFLAGS_${.TARGET}:M*} ${.IMPSRC}
+.S.i:
+       ${COMPILE.S} ${AFLAGS_${.TARGET}:M*} -o ${.TARGET} -E ${.IMPSRC}
+.S.a:
+       ${COMPILE.S} ${AFLAGS_${.TARGET:S/.a$/.o/}:M*} ${.IMPSRC}
+       ${AR} ${ARFLAGS} $@ $*.o
+       rm -f $*.o
+
+# Lex
+.l:
+       ${LEX.l} -o${.TARGET:R}.yy.c ${.IMPSRC}
+       ${LINK.c} -o ${.TARGET} ${.TARGET:R}.yy.c ${LDLIBS} -ll
+       rm -f ${.TARGET:R}.yy.c
+.l.c:
+       ${LEX.l} -o${.TARGET} ${.IMPSRC}
+.l.o:
+       ${LEX.l} -o${.TARGET:R}.yy.c ${.IMPSRC}
+       ${COMPILE.c} ${CFLAGS_${.TARGET}:M*} -o ${.TARGET} ${.TARGET:R}.yy.c
+       rm -f ${.TARGET:R}.yy.c
+
+# Yacc
+.y:
+       ${YACC.y} -o ${.TARGET:R}.tab.c ${.IMPSRC}
+       ${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
+       rm -f ${.TARGET:R}.tab.c
+.y.c:
+       ${YACC.y} -o ${.TARGET} ${.IMPSRC}
+.y.o:
+       ${YACC.y} -o ${.TARGET:R}.tab.c ${.IMPSRC}
+       ${COMPILE.c} ${CFLAGS_${.TARGET}:M*} -o ${.TARGET} ${.TARGET:R}.tab.c
+       rm -f ${.TARGET:R}.tab.c
+
+# Shell
+.sh:
+       rm -f ${.TARGET}
+       cp ${.IMPSRC} ${.TARGET}


Home | Main Index | Thread Index | Old Index