[Pkg-shadow-devel] Last issues with switch to SVN solved, and quilt power
Martin Quinson
martin.quinson@loria.fr
Thu, 12 May 2005 23:21:44 +0200
--D6z0c4W1rkZNF4Vu
Content-Type: multipart/mixed; boundary="Yia77v5a8fyVHJSl"
Content-Disposition: inline
--Yia77v5a8fyVHJSl
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Thu, May 12, 2005 at 10:29:17PM +0200, Nicolas Fran=E7ois wrote:
> On Thu, May 12, 2005 at 07:09:17PM +0000, Martin Quinson wrote:
>
> > Recommit this (with a dummy spacing change) to use the version we had in
> > cvs with dos line-ending since the cvs2svn generated version (with unix
> > line ending) doesn't apply=20
>=20
> So, svn is trying to be intelligent and change the end-of-line to the
> native system.
> You can change this behaviour with:
> svn propdel svn:eol-style <file>
>=20
> This will indicate that end-of-lines should not be touched.
>=20
> svn propset svn:eol-style CRLF patches/205_it-manpages.dpatch
>=20
> may work here (it indicates that all end-of-lines must be changed to CRLF)
> but this won't work if one file inside this patch do not use DOS eol.
> So propdel is preferable.
>=20
> Properties are not versioned. That's a pitty:(
>=20
> I will try this on 205.
I did propset svn:eol-style CRLF on 205 and it works for me. But of course,
I shouldn't do so, and your fix is better (as usual). Please proceed.
That being said, I now can apply all the patches and remove them without a
fuzz. I did refresh some of them before the log mails were is position (I
though they were, but the post-commit hook script of svn wasn't executable).
I will soon upload a new version of quilt, which ships the attached makefile
chunck. It is something I use in the other package I participate to. It
completely automatize the package building.
Save the attachement as /usr/share/quilt/quilt.debbuild.mk and create this
Makefile in the trunk/ directory, along the debian/ dir:
>>>>
PKG=3Dshadow
SITE=3Dhttp://ftp.pld-linux.org/software/shadow/
include /usr/share/quilt/quilt.debbuild.mk
<<<<
Then type "make" and it will get the tarball, open it, put a copy of the
debian dir in position, build the package and cook some coffee for you.
Enjoy, Mt.
--Yia77v5a8fyVHJSl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="quilt.debbuild.mk"
Content-Transfer-Encoding: quoted-printable
#
# This makefile chunk is intended to ease my work on packages. I hope it can
# reveal useful to other people too. But if you see some cruft here and
# there, you'll know why ;)
#
# Several of the package I work on (shadow, most of the pkg-grid alioth
# project) use quilt to manage diff onto upstream tarball.
#
# We only store the debian directory in the SCM since all changes must be
# done as patch managed by quilt.
#
# This makefile is intended to be copied in the directory containing the
# debian/ tree. It can:
#
# - Download the upstream tarball and open it on need
# * Define the SITE variable to tell it where to search for it (with wge=
t)=20
# * The package name is guessed from the current directory, but can be
# explicitely given as the PKG variable.
# * The verion number must be given as VER variable
#
# - Copy the debian directory onto the working directory
# (yeah, cp debian/ $(PKG)-$(VER)/debian. I see you're following)
#
# - Build the package, capturing the output with script
#
# - Ensure that just after the package build, we have such a link:
# $(PKG)-$(VER)/debian/patches -> debian/patches
# So, changes to the patches with quilt gets saved out of the
# $(PKG)-$(VER) tree, which can be erased at any time without loss.
# Of course, just before the build, the makefile ensures that this link
# is replaced by a copy of the debian/patches directory to make
# dpkg-buildpackage happy
# TARGETS:
#
# deb: Do what's documented above.
#
# debsign: don't add -us -uc to dpkg-buildpackage invocation
# check-complet: for multi-binary packages, make sure that all the content
# of debian/tmp gets moved away [to the right place] by dh_install
# check-lintian:
# check-linda:
# check: all of the check-* above
# scan or watch: watch for new upstream tarballs
# VARIABLES which you can use to configure stuff:
#
# PKG: package name (defaults to the current directory name)
# VER: package version (defaults to the changelog entry in debian/changelo=
g)
# UP_TAR: name of the tarfile, as called upstream=20
# Defaults to $(PKG)-$(UP_VER).tar.gz where UP_VER is VER without -nn p=
art
# Useful to get it downloaded and/or opened automatically
# EXTRA_OPEN_CMD: what to do after untarring upstream tarball.=20
# When upstream tarball doesn't contain a gentle $(PKG)-$(UP_VER) as
# expected by dpkg-buildpackage, do this:
# EXTRA_OPEN_CMD=3Dmv the_funky_dir_name_given_upstream $(PKG)-$(UP_VER)
# SITE: where to get the upstream tarball (we do "wget $(SITE)/$(UP_TAR)")
# =20
# CAVEATS:
# =20
# - $(PKG)-$(VER) is not considered as precious at all. Don't change
# anything in it. In particular, don't change $(PKG)-$(VER)/debian file=
s.
##############
### That's it.
### The actual makefile chunk follows, but you shouldn't need to dig into i=
t=20
##############
PKG?=3D$(shell pwd |sed 's|.*/||')
VER?=3D$(shell dpkg-parsechangelog -ldebian/changelog|grep '^Version'|sed =
-e 's/[^ ]* //' -e 's/[^:]://')
UP_VER=3D$(shell echo $(VER)|sed 's/-.*$$//')
UP_TAR?=3D$(PKG)-$(UP_VER).tar.gz
########################################################
##################### BUILD TARGET #####################
########################################################
deb:: $(PKG)-$(UP_VER) stamp-debdir $(PKG)_$(UP_VER).orig.tar.gz
@echo XXXXXXXXXXX Build the deb
rm -rf $(PKG)-$(UP_VER)/debian/patches
@if [ -e debian/patches ] ; then \
echo "cp -r debian/patches $(PKG)-$(UP_VER)/debian"; \
cp -r debian/patches $(PKG)-$(UP_VER)/debian; \
fi
-cd $(PKG)-$(UP_VER) && script -c "dpkg-buildpackage -rfakeroot -uc -us" .=
=2E/build.log
@if [ -e debian/patches ] ; then \
rm -rf $(PKG)-$(UP_VER)/debian/patches ; \
echo "Link patches/ to ../debian/patches" ; \
cd $(PKG)-$(UP_VER)/debian ; \
ln -s ../../debian/patches .; \
fi
debsign:: $(PKG)-$(UP_VER) stamp-debdir $(PKG)_$(UP_VER).orig.tar.gz
@echo XXXXXXXXXXX Build the deb
rm -rf $(PKG)-$(UP_VER)/debian/patches
@if [ -e debian/patches ] ; then \
echo "cp -r debian/patches $(PKG)-$(UP_VER)/debian"; \
cp -r debian/patches $(PKG)-$(UP_VER)/debian; \
fi
cd $(PKG)-$(UP_VER) && script -c "dpkg-buildpackage -rfakeroot" ../build.l=
og
@if [ -e debian/patches ] ; then \
rm -rf $(PKG)-$(UP_VER)/debian/patches ; \
echo "Link patches/ to ../debian/patches" ; \
cd $(PKG)-$(UP_VER)/debian ; \
ln -s ../../debian/patches .; \
fi
$(PKG)-$(UP_VER):: $(UP_TAR)
@echo XXXXXXXXXXX Open the tarball
rm -rf $(PKG)-$(UP_VER)
tar xfz $(UP_TAR)
$(EXTRA_OPEN_CMD)
$(UP_TAR)::
@echo XXXXXXXXXXX Download the tarball
@if test -e $(UP_TAR) ; then \
echo "Tarball found; no download needed."; \
else \
if test "x$(SITE)" =3D x ; then \
echo "Unable to download $(UP_TAR) since no SITE is provided";\
echo "Either edit Makefile or download the tarball yourself";\
exit 1;\
else \
wget $(SITE)/$(UP_TAR);\
fi\
fi
=09
stamp-debdir: FORCE
@echo XXXXXXXXXXX Put the debian dir in position
rm -rf $(PKG)-$(UP_VER)/debian
cp -Lr debian $(PKG)-$(UP_VER)/debian
find $(PKG)-$(UP_VER)/debian -name CVS -type d |xargs rm -fr
find $(PKG)-$(UP_VER)/debian -name .cvsignore -type f |xargs rm -fr
touch stamp-debdir
=09
$(PKG)_$(UP_VER).orig.tar.gz: $(UP_TAR)
@echo XXXXXXXXXXX Copy the orig.tar.gz
cp $(UP_TAR) $(PKG)_$(UP_VER).orig.tar.gz
FORCE:
########################################################
##################### CHECK TARGET #####################
########################################################
check-complet: FORCE
@echo XXXXXXXXXXX Check the package for completness
@for file in `find $(PKG)-$(UP_VER)/debian/tmp -type f|\
sed 's|$(PKG)-$(UP_VER)/debian/tmp/||'` ; do \
where=3D`find $(PKG)-$(UP_VER)/debian/*|\
grep -v '$(PKG)-$(UP_VER)/debian/tmp'|\
grep $$file|\
sed -e "s|$(PKG)-$(UP_VER)/debian/||" \
-e 's|\([^/]*\)/.*|\1|' `; \
if [ "x$$where" =3D x ] ; then \
base=3D`basename $$file`; \
where=3D`find $(PKG)-$(UP_VER)/debian/*|\
grep -v '$(PKG)-$(UP_VER)/debian/tmp'|\
grep $$base|\
sed -e "s|$(PKG)-$(UP_VER)/debian/||" `; \
if [ "x$$where" =3D x ] ; then \
echo "Not Found $$file"; \
else \
echo "NOT FOUND $$file (beside $$where)"; \
fi \
else \
echo Found $$file in $$where >/dev/null; \
fi;\
done
check-relocation: FORCE
@echo XXXXXXXXXXX Check the relocation of the package
@for pkg in `grep Package $(PKG)-$(UP_VER)/debian/control|\
sed 's|Package: ||'` ; do \
echo "XXX check $$pkg"; \
LC_ALL=3DC grep -r $(PWD) $(PKG)-$(UP_VER)/debian/$$pkg |\
while read line ; do \
if echo $$line|grep -q 'Binary file' >/dev/null ; then \
name=3D`echo $$line|sed 's/Binary file \([^ ]*\) .*$$/\1/'`; \
echo " Binary $$name =3D>";\
strings $$name |grep $(PWD)|\
grep -v '.c$$'|sed 's/^/ /';\
else \
echo " $$line"; \
fi; \
done; \
done
check-relocation-old: FORCE
@echo XXXXXXXXXXX Check the relocation of the package
@for pkg in `grep Package $(PKG)-$(UP_VER)/debian/control|\
sed 's|Package: ||'` ; do \
echo "XXX check $$pkg"; \
LC_ALL=3DC grep -r $(PWD) $(PKG)-$(UP_VER)/debian/$$pkg|\
sed 's/^/ /';\
done
check-lintian: FORCE
@echo XXXXXXXXXXX Check the package with lintian
lintian -i *.deb
lintian -i *.dsc
check-linda: FORCE
@echo XXXXXXXXXXX Check the package with linda
linda -i *.deb
linda -i *.dsc
check: check-complet check-linda check-lintian=20
##########################################################
##################### REMOTE TARGETS #####################
##########################################################
HOST ?=3D veloce.inria.fr
remote-real: FORCE
@echo XXXXXXXXXXX Build on $(HOST)
@if [ `ls *.dsc |wc -l` -gt 1 ] ; then \
echo "There is several dsc files. Please cleanup"; \
exit 1; \
fi
files=3D`cat *.dsc| \
grep-dctrl -s Files -e -FSource . -n| \
sed 's/^.*[^ ] *[^ ]* *\([^ ]*\)$$/\1/'`" "`ls *.dsc` ;\
ssh $(HOST) "rm -rf ~/remotebuild;mkdir ~/remotebuild" ; \
scp $$files $(HOST):~/remotebuild; \
ssh $(HOST) "cd remotebuild;dpkg-source -x *.dsc; cd $(PKG)-*; dpkg-build=
package -rfakeroot -us -uc -B"; \
scp $(HOST):~/remotebuild/*.deb .; \
scp $(HOST):~/remotebuild/*.changes .;=20
# dput local `ssh $(HOST) "cd ~/remotebuild; ls *.changes"`
@echo ok;
# gpg --decrypt - 2>/dev/null |\
=20
alpha: FORCE
HOST=3Dveloce.inria.fr $(MAKE) remote-real
ppc: FORCE
HOST=3Dvalnure.cs.ucsb.edu $(MAKE) remote-real
sparc: FORCE
HOST=3Dsperm.cs.ucsb.edu $(MAKE) remote-real
sync: FORCE
make -C ~/public_html publish
remote: alpha ppc sparc sync
########################################################
##################### CLEAN TARGET #####################
########################################################
clean-dsc: FORCE
@echo XXXXXXXXXXX Clean the old versions
@while [ `ls *.dsc |wc -l` -gt 1 -o `ls *.changes |wc -l` -gt 1 ] ; do \
if [ `ls *.changes |wc -l` -gt 1 ] ; then \
echo "XXX Cleanup binaries";ls;\
changes=3D`ls *.changes|head -1`; \
list=3D`grep-dctrl -s Files -n . $$changes|\
sed 's/^ *//'|\
cut -d' ' -f5|\
egrep -v '\.dsc$$'`;\
rm -i $$list $$changes; \
fi; \
\
if [ `ls *.dsc |wc -l` -gt 1 ] ; then \
echo "XXX Cleanup source";ls;\
dsc=3D`ls *.dsc|head -1`; \
list=3D`grep-dctrl -s Files -n . $$dsc|\
sed 's/^ *//'|\
cut -d' ' -f3|\
egrep -v '\.orig.tar.gz$$'`; \
rm -i $$list $$dsc; \
fi; \
done
clean: clean-dsc
@echo XXXXXXXXXXX Clean the stamps
rm -rf stamp-*
maintainerclean: clean
rm -rf *.deb *.diff.gz *.dsc *.changes *.upload
rm -rf $(PKG)_$(UP_VER).orig.tar.gz $(PKG)-$(UP_VER)=20
scan watch:
uscan --check-dirname-regex 'PACKAGE' --check-dirname-level 2 --report
=2EPHONY: FORCE scan watch clean clean-dsc=20
ifneq (,$(wildcard makefile.override))
include makefile.override
endif
--Yia77v5a8fyVHJSl--
--D6z0c4W1rkZNF4Vu
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQFCg8jmIiC/MeFF8zQRAovKAKDYiFUdU/OWCCzlDEXOMuDmABE5zQCeI/iq
t621HRYx0mOTOTBMu3Dnno0=
=foNL
-----END PGP SIGNATURE-----
--D6z0c4W1rkZNF4Vu--