jablicator-1.0.1/0000755000175000017500000000000011145475474012245 5ustar jeffjeffjablicator-1.0.1/jablicator0000755000175000017500000002051411145474617014305 0ustar jeffjeff#!/bin/sh ################################################ # # This script generates an "apt-get"-able package. # The package is empty and has a dependency for # everything that's on the machine. # # Only include packages that are both installed # and available from the apt sources. Do not # include anything from Priority: required # ################################################ set -e BOX=`hostname --fqdn | tr '[:upper:]' '[:lower:]'` ARCH=`dpkg-architecture -qDEB_BUILD_ARCH` VER=`date +%Y%m%d` HUMANDATE=`date +%m/%d/%Y` PKGNAME=`echo jablicate-${BOX} | sed 's/\\./-/g'` PKGDIR=${PKGNAME}-${VER} LETTER=`echo ${PKGNAME} | cut -b-1` DISTRO=debian-custom DEB=${PKGNAME}_${VER}_all.deb POOLDIR=pool/contrib/${LETTER}/${PKGNAME} SRCDIR=dists/${DISTRO}/contrib/source DISTDIR=dists/${DISTRO}/contrib/binary-${ARCH} ####################################### # # # Basic program flow # # # ####################################### # Handle command line arguments parse_command_line() { while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --root) ROOT=$2 shift ;; *) echo "Usage: jablicator [--root ]" exit 1 ;; esac shift done } # Guess at maintainer email set_bang_maintainer() { FIRST_PART=${USER} SECOND_PART=`hostname --domain` if [ "$SECOND_PART" = "" ] then SECOND_PART=`hostname` fi MAINTAINER="Collection Maintainer <${FIRST_PART}@${SECOND_PART}>" } # Make sure system is not completely broken sanity_check() { if [ "`hostname --fqdn`" = "" ] then echo "Error: hostname command is failing." exit fi } clean () { rm -rf ${PKGDIR} rm -f ${PKGNAME}_${VER}_${ARCH}.build } ####################################### # # # Figure out the dependencies # # # ####################################### # Record apt-get sources sources () { cat $ROOT/etc/apt/sources.list | sed 's/\#.*$//g' | grep deb } # Packages that are installed install_list () { # It has been suggested that dpkg --getselections may be better than # grepping through files with grep-dctrl. I haven't yet investigated # this in detail, but I think grep-dctrl is at the right abstraction # level. grep-dctrl -v --field Priority required --exact-match \ $ROOT/var/lib/dpkg/status |\ grep-dctrl --field Status "install ok installed" --exact-match |\ grep-dctrl -v --field Package xfonts \ --no-field-names --show-field $1 } # Packages available from apt sources available_list () { # Very annoying workaround for Debian bug #234657; I want to say -r . grep-dctrl --no-field-names --show-field Package . \ $ROOT/var/lib/apt/lists/*Packages | sort -u } # Packages installed + packages available monster_list () { install_list "Package" available_list } # Golden list of packages list () { monster_list | sort | uniq --repeated | grep -v ${PKGNAME} | sed 's/$/,/g' } ####################################### # # # Creating the Debian package # # # ####################################### control () { PACKAGES=`list` echo Source: ${PKGNAME} echo Section: admin echo Priority: optional echo "Maintainer: ${MAINTAINER}" echo "Build-Depends: debhelper (>> 3.0.0)" echo Standards-Version: 3.8.0 echo echo Package: ${PKGNAME} echo Architecture: all echo Depends: ${PACKAGES} echo Description: Replicate software collection on ${BOX} echo " Replicate the software collection from ${BOX}" echo " A software collection is simply the group of packages" echo " installed on a particular machine." echo " ." echo " This package contains dependencies that may be " echo " fulfilled from the following sources. Check to see if " echo " they are present in your /etc/apt/sources.list." echo " ." sources | sed 's/^/ /g' } changelog () { DATE=`date -R` echo "${PKGNAME} (${VER}) unstable; urgency=low" echo echo " * This package was generated by a computer progam which" echo " does not keep track of historical data." echo echo " -- ${MAINTAINER} ${DATE}" } copyright () { echo This package contains a list of the debian software that echo was on ${BOX} on ${DATE}. echo echo You are welcome to call an army of lawyers and philosphers echo to decide on the exact copyright status and/or ownership echo of this package. If I had to guess, this package is just echo a collection of facts and therefore public domain. echo echo This package in no way affects the copyright status of echo its dependencies. } rules () { echo "#!/usr/bin/make -f" echo "" echo "configure: configure-stamp" echo "configure-stamp:" echo " dh_testdir" echo " touch configure-stamp" echo "" echo "build: configure-stamp build-stamp" echo "build-stamp:" echo " dh_testdir" echo " touch build-stamp" echo "" echo "clean:" echo " dh_testdir" echo " dh_testroot" echo " rm -f build-stamp configure-stamp" echo " dh_clean" echo "" echo "install: build" echo " dh_testdir" echo " dh_testroot" echo " dh_clean -k" echo " dh_installdirs" echo "" echo "binary-arch:" echo "" echo "binary-indep: build install" echo " dh_testdir -i" echo " dh_testroot -i" echo " dh_installdocs -i" echo " dh_installchangelogs -i" echo " dh_link -i" echo " dh_compress -i" echo " dh_fixperms -i" echo " dh_installdeb -i" echo " dh_shlibdeps -i" echo " dh_gencontrol -i" echo " dh_md5sums -i" echo " dh_builddeb -i" echo "" echo "binary: binary-indep" echo ".PHONY: build clean binary-indep binary install configure" echo "" } build_package() { mkdir -p ${PKGDIR}/debian control > ${PKGDIR}/debian/control control changelog > ${PKGDIR}/debian/changelog copyright > ${PKGDIR}/debian/copyright rules > ${PKGDIR}/debian/rules echo 4 > ${PKGDIR}/debian/compat chmod +x ${PKGDIR}/debian/rules cd ${PKGDIR} debuild -us -uc if [ "$?" != 0 ] then echo "Aborting due to error." exit fi cd - } ####################################### # # # Apt-get publication functions # # # ####################################### serve () { mkdir -p ${DISTDIR} mkdir -p ${SRCDIR} mkdir -p ${POOLDIR} mv ${DEB} ${POOLDIR} mv ${PKGNAME}_${VER}.dsc ${POOLDIR} mv ${PKGNAME}_${VER}.tar.gz ${POOLDIR} mv ${PKGNAME}_${VER}_${ARCH}.changes ${POOLDIR} dpkg-scanpackages pool /dev/null | gzip -9c > ${DISTDIR}/Packages.gz dpkg-scansources pool /dev/null | gzip -9c > ${SRCDIR}/Sources.gz } instructions () { echo echo " =============== SUCCESS ===================" echo echo "First, read the man page for security implications. If you wish to share" echo "your software collection, copy the newly created dists and pool directories " echo "to a web accessable location. Others may then replicate your software" echo "collection by adding the following line to their /etc/apt/sources.list:" echo echo " deb http:// ${DISTRO} contrib" echo echo "For example, if you are running a webserver on this machine you could " echo "copy the directories to /var/www/dists and /var/www/pool. Then people could " echo "access it via the following line in /etc/apt/sources.list:" echo echo " deb http://${BOX} ${DISTRO} contrib" echo echo "Your followers can then use their favorite apt front end, for example:" echo echo " apt-get update && apt-get install ${PKGNAME}" echo } ####################################### # # # ACTION # # # ####################################### set_bang_maintainer parse_command_line $@ sanity_check build_package serve clean instructions jablicator-1.0.1/debian/0000755000175000017500000000000011145475474013467 5ustar jeffjeffjablicator-1.0.1/debian/changelog0000644000175000017500000000317611145474512015340 0ustar jeffjeffjablicator (1.0.1) unstable; urgency=low * Fix a bunch of lintian warnings * Fix some dependencies (closes: #395607) * Fix problem wth uppercase hostnames (closes: #447787) * Fix problem with package description (closes: #496689) * Add ability to act as recovery tool (closes: #150111) * Remove busted --versions command line flag. Sorry. -- Jeff Breidenbach Fri, 13 Feb 2009 23:33:01 -0800 jablicator (1.0-7) unstable; urgency=low * Workaround for non-internet machines (closes #245530) -- Jeff Breidenbach Mon, 10 May 2004 00:21:32 -0700 jablicator (1.0-6) unstable; urgency=low * Add some comments to code * Work around grep-dctrl bug (closes #222684) * Clarify user instruction (closes #170884) -- Jeff Breidenbach Mon, 1 Mar 2004 00:29:10 -0800 jablicator (1.0-5) unstable; urgency=low * Added optional versioning (closes #128744) * Made lintian happy. -- Jeff Breidenbach Sat, 19 Jan 2002 21:29:47 -0800 jablicator (1.0-4) unstable; urgency=low * Add security warnings * Fix documentation typos * Put sources.list in package description -- Jeff Breidenbach Tue, 11 Sep 2001 03:21:56 -0700 jablicator (1.0-3) unstable; urgency=low * More stupid bugs -- Jeff Breidenbach Tue, 4 Sep 2001 03:21:56 -0700 jablicator (1.0-2) unstable; urgency=low * Better cross checking with apt -- Jeff Breidenbach Tue, 4 Sep 2001 03:21:55 -0700 jablicator (1.0-1) unstable; urgency=low * Initial version -- Jeff Breidenbach Mon, 3 Sep 2001 03:21:55 -0700 jablicator-1.0.1/debian/control0000644000175000017500000000106411145471324015061 0ustar jeffjeffSource: jablicator Section: admin Priority: optional Maintainer: Jeff Breidenbach Build-Depends: debhelper (>> 3.0.0) Build-Depends-Indep: devscripts, fakeroot, lintian Standards-Version: 3.8.0 Package: jablicator Architecture: all Depends: grep-dctrl, devscripts, debhelper (>> 3.0.0), dpkg-dev, fakeroot, lintian, apt, gawk Description: Share a set of package choices Allows others to easily replicate your package choices via Debian's apt-get utility. Generating an apt-gettable, custom Debian package, with the appropriate dependencies. jablicator-1.0.1/debian/copyright0000644000175000017500000000072707345226713015425 0ustar jeffjeffThis package was first debianized by Jeff Breidenbach jab@debian.org on Mon, 3 Sep 2001 02:45:54 -0700 As this is a very Debian specific program, the canonical source is the one uploaded to Debian. This software is copyright (c) 2001 Jeff Breidenbach You are free to distribute this software under the terms of the GNU General Public License. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL file. jablicator-1.0.1/debian/rules0000755000175000017500000000233611145470654014546 0ustar jeffjeff#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 configure: configure-stamp configure-stamp: dh_testdir touch configure-stamp build: configure-stamp build-stamp build-stamp: dh_testdir touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs mkdir -p debian/tmp/usr/bin install jablicator debian/tmp/usr/bin dh_movefiles binary-arch: # Build architecture-independent files here. binary-indep: build install dh_testdir -i dh_testroot -i # dh_installdebconf -i dh_installdocs -i # dh_installexamples -i # dh_installmenu -i # dh_installlogrotate -i # dh_installemacsen -i # dh_installpam -i # dh_installmime -i # dh_installinit -i # dh_installcron -i dh_installman -i jablicator.1 # dh_installinfo -i # dh_undocumented -i dh_installchangelogs -i dh_link -i # dh_strip -i dh_compress -i dh_fixperms -i # dh_makeshlibs -i dh_installdeb -i # dh_perl -i dh_shlibdeps -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i binary: binary-indep .PHONY: build clean binary-indep binary install configure jablicator-1.0.1/debian/jablicator.files0000644000175000017500000000002207345226713016614 0ustar jeffjeffusr/bin/jablicatorjablicator-1.0.1/debian/compat0000644000175000017500000000000111145470511014647 0ustar jeffjeff4jablicator-1.0.1/jablicator.10000644000175000017500000000623411145474346014443 0ustar jeffjeff.\" Hey, Emacs! This is an -*- nroff -*- source file. .\" .\" Copyright (C) 1996 Erick Branderhorst .\" Modified by Jeff Breidenbach for use as a real manpage rather .\" than a template. .\" .\" This 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 2, or (at your option) any later .\" version. .\" .\" This 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 with .\" your Debian GNU/Linux system, in /usr/share/common-licenses/GPL, or with .\" the dpkg source package as the file COPYING. If not, write to the Free .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .\" .\" This manpage is created thanks to: .\" Kai Henningsen , .\" Ian Jackson , .\" David H. Silber & .\" Carl Streeter . .\" .TH JABLICATOR 1 "September 2001" "Debian/GNU Linux" .SH NAME jablicator \- Share package collection choice across machines .SH SYNOPSIS .B jablicator [--root ] .SH DESCRIPTION .B jablicator generates an "apt-get"-able package. The package itself is empty. However it has a dependency for every non-required Debian package that is on the machine. This program will create and populate two directories .B dists and .B pool in your working directory. You can then move them to a web accessible location. This utility is designed to reduce software distribution and maintenance costs by reducing redundant system administration. For example, I have spent a lot of time finding and vetting image processing software from Debian's large package collection. With this utility, my image processing colleague down the hall can easily benefit from the fruit of my labor. There are many replication techniques in Debian. This one has the advantage of using the apt and dpkg infrastructure. A disadvantage is the possibility of packages changing out from under you in the Debian distribution (especially in testing or unstable). That means that jablicator output can grow stale over time if it is not regenerated. .SH SECURITY The packages produced by this program contain a lot of information, including a list of the Debian packages installed on the machine and a listing of .B apt-get sources. Some system administrators consider sharing such information a security risk. .SH FILES /etc/apt/sources.list .SH OPTIONS .TP .I --root Being able to pull in package selections from another install can be helpful, in the cases of a non-functional system, or reading from a hard drive install under Knoppix. In other words, source from a root filesystem that is not mounted at the root. This is a rare situation and most users should not use this option. .SH SEE ALSO .BR dpkg (8) .BR apt-get (8). .SH AUTHOR Jeff Breidenbach . .SH THANKS Tom Parks, Cliff Weinstein, Burkhard Perkens-Golomb. jablicator-1.0.1/Makefile0000644000175000017500000000014307345257056013704 0ustar jeffjeffall: test: ./jablicator clean: -debclean rm -rf jablicate* rm -rf dists pool rm -rf *~ */*~