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

[debian-devel:00020] Re: What we have now.



中原です。

 > From: kmori@xxxxxxxxxxxxxxxx (MORI Koichiro)
 > 
 > 森です。出遅れてしまいました。

 > 私もいま見てきました。本家の mirror もあるんですね。so-net からだと意
 > 外に速かったので嬉しい(nspixpは通ってないのかな)。

本家ではなく debian.crosslink.net のミラーです。

 > # とりあえず自分の kmyacc で deb 化の練習をしてみよう。

私の使っている debian.XX 雛型作り script を以下にのせます。
Maintainer を書きかえてご利用ください。

	mkdeb mule 2.3

とやると mule-2.3 という directory ができ、その下に
	debian.control
	debian.copyright (空ファイル)
	debian.rules
の雛型が出きます。

#!/bin/sh
#
# $Id: mkdeb,v 1.8 1996/08/30 11:09:21 nakahara Exp nakahara $
#
case $# in
2) ;;
*) echo $0 package-name version ;
   exit 0 ;;
esac
#
#
#
P=$1
V=$2
DIR=${P}-${V}
mkdir $DIR
cd $DIR
touch debian.copyright
#
# debian.control
#
cat > debian.control <<EOF
Package: $P
Version: =V
Section: misc
Depends: libc5
Suggests:
Architecture: =A
Maintainer: Hayao Nakahara <nakahara@xxxxxxxxxxxxxxxxxxxxx>
Description: 
EOF

#
# debian.rules
#
#set noglob
set noclobber
cat > debian.rules <<EOF
#!/usr/bin/make -f
# debian.rules file for the GNU packages
# Invoke each target with: debian.rules <target>
# All should be invoked with the package root as the current directory
.PHONY: build checkdir checkroot announce

# The name of the package (for example, \`emacs').
p = $P
# The version of the package (for example, \`19.28').
v = $V
# The Debian revision of the package (for example, \`2').
d = 1
# Binary architecture the package is built for.
a = \$(shell dpkg --print-architecture)


pv  = \$(p)-\$(v)
pvd = \$(p)_\$(v)-\$(d)

INST_BIN	=	install -g root -o root -m 755
INST_DIR	=	install -g root -o root -d -m 755
INST_DAT	=	install -g root -o root -m 644

deb-tmp		=	debian-tmp
DEBIAN		=	\$(deb-tmp)/DEBIAN
USR		=	\$(deb-tmp)/usr
ETC		=	\$(deb-tmp)/etc

build: checkdir
# Builds the binary package.
#	make
	touch stamp-build

clean: checkroot
# Undoes the effect of \`make -f debian.rules build'.
	make clean
	rm -f stamp-build
	rm -rf debian-tmp

debian.copyright:
#	make debian.copyright

binary: stamp-build checkroot debian.copyright
# Makes a binary package.
	test -f stamp-build || make -f debian.rules build
	\$(INST_DIR)			\$(deb-tmp)
	\$(INST_DIR)			\$(DEBIAN)
	sed -e '/^Version:/s/=V/\$(v)-\$(d)/' \\
	    -e '/^Architecture:/s/=A/\$(a)/' \\
	    debian.control > \$(DEBIAN)/control
	chmod 644 \$(DEBIAN)/control
	-\$(INST_BIN) debian.preinst	\$(DEBIAN)/preinst
	-\$(INST_BIN) debian.postinst	\$(DEBIAN)/postinst
	-\$(INST_BIN) debian.prerm	\$(DEBIAN)/prerm
	-\$(INST_BIN) debian.postrm	\$(DEBIAN)/postrm
	-\$(INST_DAT) debian.conffiles	\$(DEBIAN)/conffiles
	\$(INST_DIR)			\$(USR)
	\$(INST_DIR)			\$(USR)/doc
	\$(INST_DIR)			\$(USR)/doc/copyright
	-\$(INST_DAT) debian.copyright	\$(USR)/doc/copyright/\$(p)

	dpkg --build \`pwd\`/\$(deb-tmp)
	mv \$(deb-tmp).deb ../\$(pvd)_\$(a).deb

source: checkdir
# Makes a source package.
	-test -f stamp-build && make -f debian.rules clean
	( cd .. && tar cf \$(pvd).tar \$(pv) && gzip -9f \$(pvd).tar )

diff:	checkdir
	-test -f stamp-build && make -f debian.rules clean
	cd .. && \\
	(diff -ruN \$(pv).orig \$(pv) \\
	 >\$(pvd).diff; [ \$\$? = 1 ]) && \\
	gzip -9vf \$(pvd).diff

dist: binary source diff
# Prepares the package for distribution.

checkdir:
	test -d ../\$(pv)

checkroot: checkdir
	test root = "\`whoami\`"
 
stamp-build:
	make -f debian.rules build

# Local Variables:
#   mode: makefile
# End:
EOF
#
chmod +x debian.rules