From a5cadd30425ae0956f21e84b6519de47c6ca6338 Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 4 Feb 1996 20:47:30 +0000 Subject: [PATCH] imported from findutils-4.1-4 Debian package --- cron.find | 7 +++ debian.README | 34 ++++++++++++++ debian.conffiles | 1 + debian.control | 5 ++ debian.postinst | 3 ++ debian.postrm | 2 + debian.rules | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++++ find/defs.h | 2 + find/util.c | 2 + locate/updatedb.1 | 3 +- locate/updatedb.sh | 2 +- 11 files changed, 195 insertions(+), 2 deletions(-) create mode 100644 cron.find create mode 100644 debian.README create mode 100644 debian.conffiles create mode 100644 debian.control create mode 100755 debian.postinst create mode 100755 debian.postrm create mode 100755 debian.rules diff --git a/cron.find b/cron.find new file mode 100644 index 0000000..fd023c6 --- /dev/null +++ b/cron.find @@ -0,0 +1,7 @@ +#! /bin/sh +# +# cron script to update the `find.codes' database. +# +# Written by Ian A. Murdock . + +su nobody -c updatedb 2>/dev/null diff --git a/debian.README b/debian.README new file mode 100644 index 0000000..d11791e --- /dev/null +++ b/debian.README @@ -0,0 +1,34 @@ +This is the Debian GNU/Linux prepackaged version of GNU find, xargs +and locate. GNU find was originally written by Eric Decker, with +enhancements by David MacKenzie, Jay Plett and Tim Wood. GNU xargs +was originally written by Mike Rendell, with enhancements by David +MacKenzie. GNU locate and its associated utilities were originally +written by James Woods, with enhancements by David MacKenzie. The +idea for `find -print0' and `xargs -0' came from Dan Bernstein. + +This package was put together by Ian Murdock , +from sources obtained from: + prep.ai.mit.edu:/pub/gnu/findutils-4.1.tar.gz + +Changes: + * added Debian GNU/Linux package maintenance system files + * added cron script to update `find.codes' database daily + +GNU findutils are Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software +Foundation, Inc. + + This program 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; version 2 dated June, 1991. + + This program 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, write to the Free Software + Foundation, Inc., 675 Mass Ave., Cambridge, MA 02139, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/doc/copyright/GPL'. diff --git a/debian.conffiles b/debian.conffiles new file mode 100644 index 0000000..881d6af --- /dev/null +++ b/debian.conffiles @@ -0,0 +1 @@ +/etc/cron.daily/find diff --git a/debian.control b/debian.control new file mode 100644 index 0000000..72efaab --- /dev/null +++ b/debian.control @@ -0,0 +1,5 @@ +PACKAGE: findutils +DESCRIPTION: GNU find, xargs and locate. +MAINTAINER: Ian Murdock +VERSION: =V +PACKAGE_REVISION: =D diff --git a/debian.postinst b/debian.postinst new file mode 100755 index 0000000..095845a --- /dev/null +++ b/debian.postinst @@ -0,0 +1,3 @@ +#! /bin/sh +install-info --quiet --section "General commands" "General commands" \ + /usr/info/find.info.gz diff --git a/debian.postrm b/debian.postrm new file mode 100755 index 0000000..9f8b3e2 --- /dev/null +++ b/debian.postrm @@ -0,0 +1,2 @@ +#! /bin/sh +install-info --quiet --remove find diff --git a/debian.rules b/debian.rules new file mode 100755 index 0000000..4745f97 --- /dev/null +++ b/debian.rules @@ -0,0 +1,136 @@ +#! /usr/bin/make -f +# +# Last updated: Sat Dec 17 10:52:20 EST 1994 by imurdock. +# +# To make the binary distribution package, the ``Debianized'' source package +# and the context diff to the original package, type `./debian.rules dist'. +# Make sure that `debian.rules' is executable before the final distribution +# is made. +# +# Invoke each target with `./debian.rules '. All targets should be +# invoked with the package root as the current directory. +# +# The `binary' target must be run as root, as it needs to install files with +# specific ownerships. The `diff' target assumes that you have the original +# source package available, unpacked, in ../$(p)-$(v).orig, or that you have +# the previous revision of the ``Debianized'' source package and context diff +# in the parent directory. + +CC = gcc +CFLAGS = -O2 +LDFLAGS = -s + +# The name of the package (for example, `emacs'). +p = findutils +# The version of the package (for example, `19.28'). +v = 4.1 +# The Debian revision of the package (for example, `2'). +d = 4 + +build: +# Builds the binary package. + ./configure --prefix=/usr + make CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + libexecdir=/usr/lib/locate localstatedir=/var/lib/locate + ( cd doc ; makeinfo find.texi ) + touch stamp-build + +clean: +# Undoes the effect of `make -f debian.rules build'. + make distclean + rm -f doc/find.info* + rm -f stamp-build + rm -rf debian-tmp + +binary: +# Makes a binary package. + test -f stamp-build || make -f debian.rules build + install -d -g root -m 755 -o root debian-tmp + chmod g-s debian-tmp + install -d -g root -m 755 -o root debian-tmp/DEBIAN + install -d -g root -m 755 -o root debian-tmp/etc/cron.daily + install -g root -m 755 -o root cron.find \ + debian-tmp/etc/cron.daily/find + install -d -g root -m 755 -o root debian-tmp/usr/bin + install -g root -m 755 -o root find/find \ + debian-tmp/usr/bin/find + install -g root -m 755 -o root locate/locate \ + debian-tmp/usr/bin/locate + install -g root -m 755 -o root locate/updatedb \ + debian-tmp/usr/bin/updatedb + install -g root -m 755 -o root xargs/xargs \ + debian-tmp/usr/bin/xargs + install -d -g root -m 755 -o root debian-tmp/usr/info + install -g root -m 644 -o root doc/find.info* \ + debian-tmp/usr/info + install -d -g root -m 755 -o root debian-tmp/usr/lib/locate + install -g root -m 755 -o root locate/bigram locate/code locate/frcode \ + debian-tmp/usr/lib/locate + install -d -g root -m 755 -o root debian-tmp/usr/man/man1 + install -g root -m 644 -o root find/find.1 \ + debian-tmp/usr/man/man1/find.1 + install -g root -m 644 -o root locate/locate.1 \ + debian-tmp/usr/man/man1/locate.1 + install -g root -m 644 -o root locate/updatedb.1 \ + debian-tmp/usr/man/man1/updatedb.1 + install -g root -m 644 -o root xargs/xargs.1 \ + debian-tmp/usr/man/man1/xargs.1 + install -d -g root -m 755 -o root debian-tmp/usr/man/man5 + install -d -g root -m 755 -o root debian-tmp/usr/lib/locate + install -d -g root -m 755 -o root debian-tmp/var/lib + install -d -g nogroup -m 2755 -o nobody debian-tmp/var/lib/locate + install -g root -m 644 -o root locate/locatedb.5 \ + debian-tmp/usr/man/man5/locatedb.5 + install -d -g root -m 755 -o root debian-tmp/usr/doc/copyright + install -g root -m 644 -o root debian.README \ + debian-tmp/usr/doc/copyright/$(p) + rm -f debian-tmp/usr/info/find.info*.gz + gzip -9f debian-tmp/usr/info/find.info* + sed -e '4s/=V/$(v)/' -e '5s/=D/$(d)/' debian.control \ + > debian-tmp/DEBIAN/control + chmod 644 debian-tmp/DEBIAN/control + install -g root -m 644 -o root debian.conffiles \ + debian-tmp/DEBIAN/conffiles + install -g root -m 755 -o root debian.postinst \ + debian-tmp/DEBIAN/postinst + install -g root -m 755 -o root debian.postrm \ + debian-tmp/DEBIAN/postrm + dpkg --build debian-tmp + mv debian-tmp.deb ../$(p)-$(v)-$(d).deb + +source: +# Makes a source package. + -test -f stamp-build && make -f debian.rules clean + ( cd .. && tar cf - $(p)-$(v) | gzip -9f > $(p)-$(v)-$(d).tar.gz ) + +diff: +# Makes a context diff. + -test -f stamp-build && make -f debian.rules clean + -test -d ../$(p)-$(v).orig -o -f ../$(p)-$(v)-`expr $(d) - 1`.diff.gz \ + || ( echo "Original source package is not available." ; false ) + -test -d ../$(p)-$(v).orig || make -f debian.rules orig + #cp -a ../$(p)-$(v).orig/doc/find.info* doc + ( cd .. && diff -cNr $(p)-$(v).orig $(p)-$(v) | gzip -9f \ + > $(p)-$(v)-$(d).diff.gz ) + -test -f stamp-orig \ + && rm -rf ../$(p)-$(v).orig && rm -f stamp-orig + +dist: binary source diff +# Prepares the package for distribution. + +orig: +# Prepares the original package from the previous +# Debian revision source package and context diff. + ( cd .. \ + && mkdir $(p).orig \ + && cd $(p).orig \ + && tar xzf ../$(p)-$(v)-`expr $(d) - 1`.tar.gz \ + && cd $(p)-$(v) \ + && ( zcat ../../$(p)-$(v)-`expr $(d) - 1`.diff.gz \ + | patch -sER -p1 ) \ + && find . -name "*.orig" -exec rm -f {} \; \ + && cd .. \ + && mv $(p)-$(v) ../$(p)-$(v).orig \ + && cd .. \ + && rmdir $(p).orig ) + touch stamp-orig diff --git a/find/defs.h b/find/defs.h index ec029de..074cbdd 100644 --- a/find/defs.h +++ b/find/defs.h @@ -301,7 +301,9 @@ boolean opt_expr P_((struct predicate **eval_treep)); boolean mark_stat P_((struct predicate *tree)); /* util.c */ +#ifndef __linux__ char *basename P_((char *fname)); +#endif /* not __linux__ */ struct predicate *get_new_pred P_((void)); struct predicate *get_new_pred_chk_op P_((void)); struct predicate *insert_primary P_((boolean (*pred_func )())); diff --git a/find/util.c b/find/util.c index 95ce57e..c8565fb 100644 --- a/find/util.c +++ b/find/util.c @@ -24,6 +24,7 @@ /* Return the last component of pathname FNAME, with leading slashes compressed into one slash. */ +#ifndef __linux__ char * basename (fname) char *fname; @@ -38,6 +39,7 @@ basename (fname) p = strrchr (fname, '/'); return (p == NULL ? fname : p + 1); } +#endif /* not __linux__ */ /* Return a pointer to a new predicate structure, which has been linked in as the last one in the predicates list. diff --git a/locate/updatedb.1 b/locate/updatedb.1 index 7672626..19bedb3 100644 --- a/locate/updatedb.1 +++ b/locate/updatedb.1 @@ -55,7 +55,8 @@ Default is /tmp /usr/tmp /var/tmp /afs. .TP .B \-\-output=\fIdbfile\fP The database file to build. -Default is system-dependent, but typically /usr/local/var/locatedb. +Default is system-dependent. In Debian GNU/Linux, the default +is /var/lib/locate/locatedb. .TP .B \-\-netuser=\fIuser\fP The user to search network directories as, using \fBsu\fP(1). diff --git a/locate/updatedb.sh b/locate/updatedb.sh index 944791a..5b6b69a 100644 --- a/locate/updatedb.sh +++ b/locate/updatedb.sh @@ -53,7 +53,7 @@ done : ${NETPATHS=} # Directories to not put in the database, which would otherwise be. -: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs"} +: ${PRUNEPATHS="/proc /tmp /usr/tmp /var/tmp /afs /amd /net"} # The same, in the form of a regex that find can use. test -z "$PRUNEREGEX" && -- 2.11.4.GIT