Release 1.19.6
[dpkg.git] / cpan.am
blob7c30f1f3f2ba9e58a04cccd2b81b919f0d35362f
1 CPAN_DIST_NAME = $(PACKAGE_CPAN_NAME)
2 CPAN_DIST_VERSION = $(PACKAGE_VERSION)
3 if !PACKAGE_DIST_IS_RELEASE
4 CPAN_DIST_SUFFIX = -TRIAL
5 endif
6 CPAN_DIST = $(CPAN_DIST_NAME)-$(CPAN_DIST_VERSION)$(CPAN_DIST_SUFFIX)
7 CPAN_DIST_ARCHIVE = $(CPAN_DIST).tar.gz
9 dist-cpan:
10         : # Create the CPAN source tree.
11         mkdir -p $(CPAN_DIST)
12         mkdir -p $(CPAN_DIST)/lib
13         mkdir -p $(CPAN_DIST)/t
14         cp -fpR $(top_srcdir)/COPYING $(CPAN_DIST)/LICENSE
15         cp -fpR $(top_srcdir)/data $(CPAN_DIST)
16         cp -fpR $(top_srcdir)/t/* \
17                  $(top_srcdir)/scripts/t/Dpkg* \
18                  $(top_srcdir)/scripts/t/origins \
19                  $(CPAN_DIST)/t
20         cp -fpR $(top_srcdir)/scripts/Dpkg.pm $(CPAN_DIST)/lib/
21         cp -fpR $(top_srcdir)/scripts/Dpkg $(CPAN_DIST)/lib/
22         cp -fpR $(top_srcdir)/scripts/Test $(CPAN_DIST)/lib/
23         cp -fpR $(top_builddir)/scripts/Build.PL $(CPAN_DIST)
25         : # Fix permissions of the distributed files.
26         find $(CPAN_DIST) \
27                -type d ! -perm 755 -exec chmod u+rwx,go+rx {} ';' -o \
28              ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
29              ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
30              ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; || \
31           chmod -R a+r $(CPAN_DIST)
33         : # Prepare the CPAN distribution.
34         cd $(CPAN_DIST) && $(PERL) Build.PL
35         cd $(CPAN_DIST) && ./Build manifest
36         cd $(CPAN_DIST) && ./Build distdir
38         : # Pack the CPAN distribution.
39         $(TAR) -caf $(CPAN_DIST_ARCHIVE) -C $(CPAN_DIST) -Hustar \
40           --sort=name --owner=root:0 --group=root:0 $(CPAN_DIST)
42         : # Cleanup the CPAN source tree.
43         find $(CPAN_DIST) -type d ! -perm -200 -exec chmod u+w {} ';'
44         rm -rf $(CPAN_DIST)
46 # Ignore the CPAN archive for distcleancheck.
47 distcleancheck_listfiles = \
48         find -type f \( -name $(CPAN_DIST_ARCHIVE) -o -print \)