[Build-common-hackers] get-orig-source target in debian/rules
George Danchev
danchev at spnet.net
Fri Aug 26 06:41:40 UTC 2005
Hello CDBS hackers,
I would like to ask if it is a good idea to have some code in cdbs
implementing the get-orig-source target which could then be included in
debian/rules.
Rationale:
* Since it is a common target I think it could be provided by cdbs or
any similar package and should not be reinvented every now and then.
* This target is optional, but providing it if possible is a good idea as
said in Policy 4.8.
* Could be handy for the pkg-* projects keeping *only* their debian/
directories on a SCM to get the orig-source ... just a target away.
The bad thing is that it (cdbs) should depend on some fetching tool like wget
or probably http or ftp methods (/usr/lib/apt/methods) of apt could be used as
downloaders to fetch the tarballs ?
Here is a sample illustrating /*not tested and probably insane*/ code.
These variables should be set in debian/rules
( if any of these is not set we can stop ?:
# debuild expects to find orig tarball in ../
UDIR = ..
UPATH=url://host/dir
UFILE=file1.tar.gz
UFILE_ORIG=file1.orig.tar.gz
MD5TRU=af8f830baf081e3a1cf39e9299cf1b86
MD5CUR=`md5sum $(UDIR)/$(UFILE) | awk '{print $$1}'`
This target could be provided by some cdbs file and included in debian/rules:
get-orig-source:
if [ ! -f $(UDIR)/$(UFILE_ORIG) ] ; then \
wget -O $(UDIR)/$(UFILE_ORIG) $(UPATH)/$(UFILE) ; \
else \
echo "Upstream source tarball have been already downloaded" ; \
fi
if [ "$(MD5CUR)" != "$(MD5TRU)" ] ; then \
echo "md5sum mismatch!" ; \
false ; \
else \
echo "md5sum is ok!" ; \
fi
Again, I'm not sure if cdbs is the best place to provide this target, and if
not which other package could be considered as well.
P.S. I'm not subscribed to the list, please CC me.
--
pub 4096R/0E4BD0AB 2003-03-18 <people.fccf.net/danchev/key pgp.mit.edu>
fingerprint 1AE7 7C66 0A26 5BFF DF22 5D55 1C57 0C89 0E4B D0AB
More information about the Build-common-hackers
mailing list