diff --git a/infrastructure/build/find-build-order b/infrastructure/build/find-build-order new file mode 100755 index 00000000000..6bd0e2bda12 --- /dev/null +++ b/infrastructure/build/find-build-order @@ -0,0 +1,45 @@ +#!/bin/sh +# $OpenBSD: find-build-order,v 1.1.1.1 1999/05/18 16:39:05 espie Exp $ +# Copyright (c) 1999 Marc Espie. All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Neither the name of OpenBSD nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY ITS AUTHOR AND THE OpenBSD project ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +# This is a simple filter that takes a set of package and outputs a full +# dependency list, so that you may build things in order. +# input is of the form: dir/package BUILD_PARAM1=something... +# and output is a list of dir/package +case "$1" in +"build") + type=depends-list;; +"run") + type=package-depends;; +"all"|*) + type="depends-list package-depends";; +esac + +(while read i j +do + case $i in + \#);; # comments + *) + cd /usr/ports/$i && make FULL_PACKAGE_NAME=yes $j $type;; + esac +done)|tsort|tail -r diff --git a/infrastructure/build/out-of-date b/infrastructure/build/out-of-date new file mode 100755 index 00000000000..01253d85b10 --- /dev/null +++ b/infrastructure/build/out-of-date @@ -0,0 +1,55 @@ +#!/bin/sh +# $OpenBSD: out-of-date,v 1.1.1.1 1999/05/18 16:39:05 espie Exp $ +# Copyright (c) 1999 +# Marc Espie. All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Neither the name of OpenBSD nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY ITS AUTHOR AND THE OpenBSD project ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +# Check for simple discrepancies between installed packages and the +# /usr/ports INDEX + +FILE=/usr/ports/INDEX + +cat <>> Is /usr/ports/INDEX up-to-date ? +>>> Otherwise, this script will find out outdated flavors of packages +>>> compared to your installed packages... +EOF +pkg_info |while read fullname rest +do + grep "^$fullname" $FILE >/dev/null || { + basename=`echo $fullname |sed -e 's/^\(.*\)-.*/\1/'` + newname=`grep "^$basename-" $file |cut -f1 -d\|` + # some packages exist in several distinct flavors + if [ `echo $new| wc -l` -ge 2 ] + then + echo -n "Update $fullname to one of" + echo $newname|while read item + do + echo -n "$item " + done + echo "" + else + echo "Update $fullname to $newname" + fi + } +done + diff --git a/infrastructure/db/essentials b/infrastructure/db/essentials new file mode 100644 index 00000000000..48f07122bb0 --- /dev/null +++ b/infrastructure/db/essentials @@ -0,0 +1,46 @@ +# This is the list of packages that will be on the CD +# there can be some omissions, as long as build-depends/run-depends work +archivers/bzip2 +archivers/gshar+gunshar +archivers/gtar +archivers/unzip +benchmarks/iozone +devel/autoconf +devel/bison +devel/gettext +devel/glib +devel/gmake +devel/id-utils +devel/m4 +devel/mm +editors/emacs +graphics/aalib +graphics/compface +graphics/gimp +graphics/jpeg +graphics/mpeg-lib +graphics/png +graphics/tiff34 +lang/egcs-stable +lang/tcl80 +mail/fetchmail +mail/mm +mail/nmh +mail/pine +math/gnuplot +misc/screen +net/ethereal +net/ircii-epic +net/netpipe +net/sniffit +net/wget +print/enscript +print/ghostscript5 +print/gv +shells/bash2 +shells/tcsh +sysutils/xntpd +x11/Xaw3d +x11/gtk+ +x11/tk80 +x11/xcolors diff --git a/infrastructure/db/full-list b/infrastructure/db/full-list new file mode 100644 index 00000000000..b9f8fd9bf52 --- /dev/null +++ b/infrastructure/db/full-list @@ -0,0 +1,85 @@ +# This is a full list of everything that should currently build okay, +# and be built routinely by ports/packages people +archivers/bzip2 +archivers/gshar+gunshar +archivers/gtar +archivers/unzip +astro/xphoon +audio/mpg123 +benchmarks/iozone +devel/autoconf +devel/bison +devel/ddd +devel/dejagnu +devel/gettext +devel/glib +devel/gmake +devel/id-utils +devel/libslang +devel/m4 +editors/emacs +editors/jove +editors/vim +graphics/ImageMagick +graphics/aalib +graphics/compface +graphics/gimp +graphics/jpeg +graphics/mpeg-lib +graphics/mpeg_play +graphics/netpbm +graphics/png +graphics/tiff34 +graphics/xfig +graphics/xpaint +graphics/xv +lang/egcs-stable +lang/expect +lang/tcl80 +mail/cucipop +mail/fetchmail +mail/metamail +mail/mutt +mail/nmh +mail/pine +math/gnuplot +math/xspread +misc/screen +misc/gnuls +net/dxpc +net/ethereal +net/ircii-epic +net/netpipe +net/rsync +net/wget +print/a2ps PAPERSIZE=A4 +print/a2ps PAPERSIZE=Letter +print/afm +print/enscript +print/freetype +print/ghostscript5 +print/gv +print/psutils +print/teTeX +print/transfig +security/pgp USA_RESIDENT=YES +security/pgp USA_RESIDENT=NO +security/ssh USA_RESIDENT=YES +security/ssh USA_RESIDENT=NO +shells/bash2 +shells/tcsh +shells/zsh +sysutils/idled +sysutils/xntpd +textproc/catdoc +textproc/glimpse +textproc/ispell +textproc/latex2html +textproc/xpdf +x11/Xaw3d +x11/gtk+ +x11/lesstif +x11/rxvt +x11/tk81 +x11/viewfax +x11/xcolors diff --git a/infrastructure/db/user.db b/infrastructure/db/user.db new file mode 100644 index 00000000000..2d495749524 --- /dev/null +++ b/infrastructure/db/user.db @@ -0,0 +1,39 @@ +#!/usr/bin/perl + +# $OpenBSD: user.db,v 1.1.1.1 1999/05/18 16:39:03 espie Exp $ + +# Used by install/createuser +# fields for a user: +# user: user name (default: key value) +# fullname: description of the id (mandatory, include port path along) +# group: group name (default: same as user) +# uid: user id (mandatory) +# gid: group id (default: uid) +# mandatory: do we want THIS uid/gid, or the first one available ? +# shell: (default: /sbin/nologin) +# home: (default: /root) + +%users = + ( pgsql => + { + fullname => 'PostgresQL pseudo user (created by postgresql port)', + uid => 70, + home => "$ENV{'PREFIX'}/pgsql", + shell => '/bin/sh' + }, + nfr => + { + fullname => 'Network Flight Recorder (created by nfr port)', + uid => 42, + home => $ENV{'NFRHOME'} + }, + wnn => + { + fullname => 'Wnn4 (created by ja-Wnn4)', + uid => 69, + group => 'bin', + mandatory=> 'uid' + } + ); + +1; diff --git a/infrastructure/fetch/check-distfiles b/infrastructure/fetch/check-distfiles new file mode 100755 index 00000000000..4b7de99fcd3 --- /dev/null +++ b/infrastructure/fetch/check-distfiles @@ -0,0 +1,31 @@ +#!/bin/sh +#$OpenBSD: check-distfiles,v 1.1.1.1 1999/05/18 16:39:05 espie Exp $ + +# This does a full-scale check of everything that lives under +# /usr/ports/distfiles +PORTS=/usr/ports +ALLSUMS=`mktemp /usr/ports/checksums.XXXXXX` || exit 1 +GREP_RESULT=`mktemp /usr/ports/grep.XXXXXX` || exit 1 +# assume that INDEX is up-to-date +touch $ALLSUMS +cut -d\| -f2 >$ALLSUMS + else + echo "Port $i does not seem to have a checksum file" + fi +done + +cd $PORTS/distfiles +find . -type f|sed -e 's|^\./||'|while read name +do + if grep "^SHA1 ($name) = " $ALLSUMS >$GREP_RESULT + then + sha1 $name >>$GREP_RESULT + uniq -u <$GREP_RESULT + else + echo "no checksum recorded for $name" + fi +done diff --git a/infrastructure/fetch/check-license b/infrastructure/fetch/check-license new file mode 100755 index 00000000000..41de7f590b4 --- /dev/null +++ b/infrastructure/fetch/check-license @@ -0,0 +1,160 @@ +#! /bin/sh +# +# $OpenBSD: check-license,v 1.1.1.1 1999/05/18 16:39:05 espie Exp $ +# +# This script verifies that all files in a given directory are +# mentioned in the ports LICENSE file as Distribution allowed. +# Output is three lists: +# +# Missing files: files that should be in the directory (if the +# intent is to obtain all files that can be +# re-distributed) but are not. +# +# Bad files: files that must NOT be in a distribution +# directory. These are listed in the form +# of a shell `mv -f xxx ../licensed' command so +# they can be fed to the shell (after manual +# verification) to move them into a directory +# that will not be copied to any CD-ROM. +# +# Unknown files: files that are noted in the LICENSE file but +# do not have a distribution flag of either Y or N. +# +# Extra files: Files that are in the given directory that are +# not mentioned in the ports LICENSE file. +# + +# The ports base directory. Note: this may be supplied from the environment +# using the standard bsd.port.mk name of PORTSDIR +# +LICENCE=${PORTSDIR:-/usr/ports}/LICENSE + +# Our name and a function to spit out the usage. Exit. +# +prog=`basename $0` +usage () { + if [ ! -z "$1" ]; then + echo "$prog: $1" + fi + echo "usage: $prog distribution-directory" + exit 1 +} + +# Verify we have one param and that it is the name of a directory. +# If not spit out our usage and exit +# +if [ $# -eq 1 ]; then + if [ -d $1 ]; then + DIST=$1 + else + usage "$1 is not a directory" + fi +else + usage +fi + +# This awk script matches the license file agains an `ls' of of the given +# distribution directory and spits instructions out to stdout. +# +/bin/ls $DIST | +awk -v L=$LICENCE ' +BEGIN { + # Process license file + # + while ( getline 0 ) { + print "The following files/dirs are extra and " \ + "should probably be removed:" + print + for ( i = 0; i < extra_count; i += 1 ) { + print "/bin/rm -rf", extra_files[ i ] + } + print + } +} +' +exit 0 diff --git a/infrastructure/install/createuser b/infrastructure/install/createuser new file mode 100644 index 00000000000..b0b1a21cb14 --- /dev/null +++ b/infrastructure/install/createuser @@ -0,0 +1,94 @@ +#!/usr/bin/perl +# $OpenBSD: createuser,v 1.1.1.1 1999/05/18 16:39:02 espie Exp $ + +# user creation script. +# All ports that need to create new users should defer to this script +# If specific capabilities are needed they should be added HERE as well. + +require '/usr/ports/infrastructure/db/user.db'; + +use Fcntl ':flock'; # import LOCK_* constants + +sub check_root + { + if ($>) + { die "Only root can run this script\n"; } + if ($<) + { die "There is something fishy going on, I'd better quit\n"; } + } + +sub fill_user + { + my ($key) = shift; + unless (defined $users{$key}) + {die "Sorry, no such user: $key, maybe you need to upgrade your createuser database ?\n"; } + my ($r) = $users{$key}; + unless (defined $r->{fullname} && defined $r->{uid}) + { die "Incompletely defined user: $key\n"; } + $r->{user} = $key unless defined $r->{user}; + $r->{group} = $r->{user} unless defined $r->{group}; + $r->{gid} = $r->{uid} unless defined $r->{gid}; + $r->{shell} = '/sbin/nologin' unless defined $r->{shell}; + $r->{home} = '/root' unless defined $r->{home}; + # avoid characters such as + or : in password entries... + + my $k; + local $_; + while (($k, $_) = each %$r) + { die "Bad chpass field $_\n" unless m/^[\d\w ()\-/.]+$/; } + return $r; + } + +sub atomic_append + { + my ($file,@list) = @_; + + open F, ">> $file" or die "$file: $!\n"; + unless (flock(F, LOCK_EX | LOCK_NB)) + { die "Cannot lock $file\n"; } + # prevent the rare case where someone is already appending to that file + seek F, 0, 2; + print F join( "\n", @list) . "\n"; + close F; + flock F, LOCK_UN ; + } + + +# the main routine + +check_root(); +if ($#ARGV < 0) + { die "Must supply one argument\n"; } + + +my $r = fill_user($ARGV[0]); + +my ($uid, $gid); + +# find matching uid/gids. +unless ( $uid = (getpwnam $r->{user})[2]) + { + $uid = $r->{uid}; + $uid++ while getpwuid $uid; + } + +unless ( $gid = (getgrnam $r->{group})[2]) + { + $gid = $r->{gid}; + $gid++ while getgrgid $gid; + } + +# check mandatory ids +if ($r->{mandatory} =~ m/uid/ && $uid != $r->{uid}) + { die "Uid mismatch for $r->{user}\n"; } +if ($r->{mandatory} =~ m/gid/ && $gid != $r->{gid}) + { die "Gid mismatch for $r->{user}\n"; } + +atomic_append( '/etc/group', "$r->{group}:*:$gid:" ); + +print "$r->{user} with uid $uid, of group $r->{group} with gid $gid\n"; + +$passargs = join(':', + ($r->{user}, '*', $uid, $gid, '', '', '', $r->{fullname}, $r->{home}, $r->{shell})); +print "/usr/bin/chpass -a $passargs\n"; +system('/usr/bin/chpass', '-a', $passargs); diff --git a/infrastructure/package/check-dependencies b/infrastructure/package/check-dependencies new file mode 100755 index 00000000000..32174664cd8 --- /dev/null +++ b/infrastructure/package/check-dependencies @@ -0,0 +1,47 @@ +#!/usr/bin/perl +$cache=1; + +print "Dependency list\n"; +print "---------------\n"; +for $file (<*.tgz>) + { + $name = $file; + $name =~ s/\.tgz$//; + unless ($cache && -f "t/CONTENTS.$name") + { + system("tar zxf $file +CONTENTS"); + rename("+CONTENTS", "t/CONTENTS.$name"); + } + open(FILE, "t/CONTENTS.$name") or die "No contents"; + $deps{$name}=[]; + while () + { + chomp; + if (m/^\@pkgdep\s+/) + { + push(@{$deps{$name}}, $'); + } + } + close(FILE); + print $name, ": ", join(',', @{$deps{$name}}), "\n"; + } + +print "Checking topological order\n"; +print "--------------------------\n"; +# check recursive brokeness +while (($key, $value) = each %deps) + { + %pulled=(); + for $np (@$value) + { + for $rec (@{$deps{$np}}) + { + unless (defined $pulled{$rec}) + { + print "Error: $key depends on $np which depends on $rec\n"; + print "(", join(",", @$value), ")\n"; + } + } + $pulled{$np} = 1; + } + } diff --git a/infrastructure/templates/Makefile.template b/infrastructure/templates/Makefile.template new file mode 100644 index 00000000000..21c00b79848 --- /dev/null +++ b/infrastructure/templates/Makefile.template @@ -0,0 +1,121 @@ +# $OpenBSD: Makefile.template,v 1.1.1.1 1999/05/18 16:39:05 espie Exp $ +# $FreeBSD/NetBSD: credit FreeBSD/NetBSD if thats where the port came from $ +# Original from: credit the original author here +# +# Replace ??? with appropriate values +# Remove extraneous comments before commit. + +# +# What port/package will be created +# +DISTNAME= ??? +#DIST_SUBDIR= ??? +#PKGNAME= ??? +CATEGORIES= ??? + +# Reasons why the port/package shouldn't be built +# +#NEED_VERSION= ?.?? +#COMES_WITH= ??? +#ONLY_FOR_ARCHS= ??? +#BROKEN= "reason" +#NO_CDROM= "reason" +#RESTRICTED= "reason" +#MIRROR_DISTFILE= no + +# where to send bitches about this port +# +MAINTAINER= ports@openbsd.org + +# where the source files and patches can be fetched +# +MASTER_SITES= ??? +#MASTER_SITE_SUBDIR= ??? +#DISTFILES= ??? +#PATCH_SITES= ??? +#PATCHFILES= ??? +#PATCH_DIST_STRIP= -p0 +#EXTRACT_SUFX= .tar.Z +#EXTRACT_CMD= ??? +#EXTRACT_BEFORE_ARGS= ??? +#EXTRACT_AFTER_ARGS= ??? + +# don't forget to list supplementary files here (arch-dependent stuff, +# or files that only get used with specific options. Otherwise, +# make checksum/addsum WON'T WORK. +#SUPDISTFILES= +#SUPPATCHFILES= + +# Dependencies +# +#FETCH_DEPENDS= ??? +#BUILD_DEPENDS= ??? +#RUN_DEPENDS= ??? +#LIB_DEPENDS= ??? + +# Is the build automagic or is it interactive +# +#IS_INTERACTIVE= yes + +# build/configuration variables +# +# requires bsd.port.mk 1.71 or later +#SEPARATE_BUILD= concurrent (build simultaneously on all arches) +#SEPARATE_BUILD= simple (configure/build still recreates files in source) +#USE_EGCC= yes +#USE_EGXX= yes +#USE_GMAKE= yes +#USE_IMAKE= yes +#USE_X11= yes (assumed if USE_IMAKE is yes) +#USE_AUTOCONF= yes +#GNU_CONFIGURE= yes (assumed if USE_AUTOCONF is yes) +#HAS_CONFIGURE= yes (assumed if GNU_CONFIGURE is yes) +#CONFIGURE_SCRIPT= ??? (if other than configure) +#CONFIGURE_ARGS+= ${CONFIGURE_SHARED} +#CONFIGURE_ENV= ??? + +# Things that we don't want to do for this port/package +# +#NO_DEPENDS= yes +#NO_WRKDIR= yes +#NO_WRKSUBDIR= yes +#NO_CHECKSUM= yes +#NO_EXTRACT= yes +#NO_PATCH= yes +#NO_CONFIGURE= yes +#NO_BUILD= yes +#NO_INSTALL= yes +#NO_MTREE= yes +#NO_PACKAGE= yes +#NO_PKG_REGISTER= yes + +# This section is only needed if man pages are distributed in compressed +# form. Define MANCOMPRESSED and the man pages by section. The pages +# will be uncompressed after being installed. +# +#MANCOMPRESSED= yes +#MAN1= ??? +#MAN3= ??? +#MAN4= ??? +#MAN5= ??? +#MAN8= ??? + +# Overrides for default values +# +#MAKEFILE= ??? +#MAKE_FLAGS= ??? +#MAKE_ENV= ??? +#SCRIPTS_ENV= ??? +#LDFLAGS= ??? +#WRKDIR= ??? if other than work +#WRKSRC= ??? if other than ${WRKDIR}/$DISTNAME + +#ALL_TARGET= ??? +#INSTALL_TARGET= ??? + +# This target may be necessary if a shared library may have been created +# +#post-install: +# ${LDCONFIG} -m ${PREFIX}/lib + +.include diff --git a/infrastructure/templates/README.category b/infrastructure/templates/README.category new file mode 100644 index 00000000000..7c038fbe2c2 --- /dev/null +++ b/infrastructure/templates/README.category @@ -0,0 +1,9 @@ +

Ports in Category %%CATEGORY%%

+ +

Description

+%%DESCR%% + +

Sub directories

+
+%%SUBDIR%% +
diff --git a/infrastructure/templates/README.port b/infrastructure/templates/README.port new file mode 100644 index 00000000000..168e1257f65 --- /dev/null +++ b/infrastructure/templates/README.port @@ -0,0 +1,22 @@ +

The %%PORT%% port

+ +

+%%PKG%% +-- +%%COMMENT%% +

+

Description

+ +
+%%DESCR%%
+
+ +

Build dependencies

+
    +%%BUILD_DEPENDS%% +
+ +

Run dependencies

+
    +%%RUN_DEPENDS%% +
diff --git a/infrastructure/templates/README.top b/infrastructure/templates/README.top new file mode 100644 index 00000000000..17f95790fcd --- /dev/null +++ b/infrastructure/templates/README.top @@ -0,0 +1,9 @@ +

OpenBSD ports collection

+ +

Description

+%%DESCR%% + +

Sub directories

+
+%%SUBDIR%% +