nasty MakeMaker conversion for perl library support
authorJoey Hess <joey@kitenet.net>
Sat, 24 Jul 2010 00:19:18 +0000 (20:19 -0400)
committerJoey Hess <joey@kitenet.net>
Sat, 24 Jul 2010 00:19:18 +0000 (20:19 -0400)
Had to move zgz.pod to subdir because MakeMaker insisted in installing it
otherwise.

INSTALL [new file with mode: 0644]
Makefile [deleted file]
Makefile.PL [new file with mode: 0755]
debian/changelog
debian/rules
pristine-tar.spec
zgz.pod [deleted file]
zgz/zgz.pod [new file with mode: 0644]

diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..bd3fb49
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1 @@
+Run ./Makefile.PL to generate a Makefile, then run `make` and `make install`.
diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 9c9d805..0000000
--- a/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-build: zgz/zgz pristine-tar.spec
-       pod2man -c pristine-tar pristine-tar > pristine-tar.1
-       pod2man -c pristine-gz  pristine-gz  > pristine-gz.1
-       pod2man -c pristine-bz2 pristine-bz2 > pristine-bz2.1
-       pod2man -c zgz zgz.pod > zgz.1
-
-ZGZ_SOURCES = zgz/zgz.c zgz/bits.c zgz/deflate.c zgz/gzip.c zgz/trees.c zgz/util.c \
-             zgz/old-bzip2/*.c
-zgz/zgz: $(ZGZ_SOURCES) zgz/gzip.h
-       gcc -Wall -O2 -lz -o $@ $(ZGZ_SOURCES)
-
-install:
-       install -d $(DESTDIR)/usr/bin
-       install -d $(DESTDIR)/usr/share/man/man1
-       install pristine-tar pristine-gz pristine-bz2 zgz/zgz $(DESTDIR)/usr/bin
-       install -m 0644 *.1 $(DESTDIR)/usr/share/man/man1
-
-clean: pristine-tar.spec
-       rm -f zgz/zgz *.1
-
-pristine-tar.spec:
-       sed -i "s/Version:.*/Version: $$(perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)/" pristine-tar.spec
-
-.PHONY: pristine-tar.spec
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100755 (executable)
index 0000000..e1958a1
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use ExtUtils::MakeMaker;
+
+# Add a few more targets.
+sub MY::postamble {
+q{
+all:: extra_build
+clean:: extra_clean
+install:: extra_install
+pure_install:: extra_install
+
+extra_build: zgz/zgz pristine-tar.spec
+       pod2man -c pristine-tar pristine-tar > pristine-tar.1
+       pod2man -c pristine-gz  pristine-gz  > pristine-gz.1
+       pod2man -c pristine-bz2 pristine-bz2 > pristine-bz2.1
+       pod2man -c zgz zgz/zgz.pod > zgz.1
+
+ZGZ_SOURCES = zgz/zgz.c zgz/bits.c zgz/deflate.c zgz/gzip.c zgz/trees.c zgz/util.c \
+             zgz/old-bzip2/*.c
+zgz/zgz: $(ZGZ_SOURCES) zgz/gzip.h
+       gcc -Wall -O2 -lz -o $@ $(ZGZ_SOURCES)
+
+extra_install:
+       install -d $(DESTDIR)/usr/bin
+       install -d $(DESTDIR)/usr/share/man/man1
+       install pristine-tar pristine-gz pristine-bz2 zgz/zgz $(DESTDIR)/usr/bin
+       install -m 0644 *.1 $(DESTDIR)/usr/share/man/man1
+
+extra_clean: pristine-tar.spec
+       rm -f zgz/zgz *.1
+
+pristine-tar.spec:
+       sed -i "s/Version:.*/Version: $$(perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)/" pristine-tar.spec
+
+.PHONY: pristine-tar.spec
+}
+}
+
+WriteMakefile(
+       NAME            => 'Pristine::Tar',
+       PREFIX          => "/usr/local",
+       MAN1PODS        => {},
+       MAN3PODS        => {},
+       PMLIBDIRS       => ["Pristine"],
+);
index 0c8f09604a859a26e5f82b5eae9144f370b3d31b..d231a014e889ec2722976cc3a80618b4ec1f8638 100644 (file)
@@ -1,6 +1,7 @@
 pristine-tar (1.04) UNRELEASED; urgency=low
 
   * pristine-gz gengz: Bugfix: Always remove uncompressed input file.
+  * Large refactoring and modularization.
 
  -- Joey Hess <joeyh@debian.org>  Fri, 23 Jul 2010 19:16:33 -0400
 
index cbe925d7587131c8ec8761915930894c60c096fd..5f3257a2d316847cb9b0cf006135a4faefb73d0f 100755 (executable)
@@ -1,3 +1,11 @@
 #!/usr/bin/make -f
 %:
        dh $@
+
+override_dh_auto_configure:
+       # keeps it out of /usr/local
+       dh_auto_configure -- PREFIX=/usr
+
+override_dh_auto_clean:
+       # distclean moans about MANIFEST, this is quieter
+       if [ -e Makefile ]; then $(MAKE) realclean; fi
index 24c353c57289b6114dbdf23cbda278b8ef1b4488..a0df3e11c6de624aaa623ac36bed52a9ab3d543d 100644 (file)
@@ -1,5 +1,5 @@
 Name: pristine-tar
-Version: 1.03
+Version: 1.04
 Release: 2%{?dist}
 Summary: regenerate pristine tarballs
 
@@ -31,6 +31,7 @@ pristine-tar is available in git at git://git.kitenet.net/pristine-tar/
 
 
 %build
+perl Makefile.PL INSTALLDIRS=vendor PREFIX=%{_prefix}
 make %{?_smp_mflags}
 
 
diff --git a/zgz.pod b/zgz.pod
deleted file mode 100644 (file)
index 0f49aaf..0000000
--- a/zgz.pod
+++ /dev/null
@@ -1,33 +0,0 @@
-=head1 NAME
-
-zgz - Frankenstein's compressor
-
-=head1 SYNOPSIS
-
-B<zgz> [options] < file > file.gz
-
-=head1 DESCRIPTION
-
-This program is an unholy combination of the BSD gzip program, a modified
-GNU gzip that supports setting an arbitrary file name and timestamp,
-and an old, rotting version of bzip2 that we dug up somewhere at midnight.
-Only the bits to do with file compression were kept.
-
-There are many arcane options which aid L<pristine-gz>(1) in re-animating
-files. Use --help to see all the gory details.
-
-=head1 AUTHOR
-
-Matthew R. Green,
-Jean-loup Gailly,
-Julian R Seward,
-Faidon Liambotis,
-Josh Triplett,
-Joey Hess
-
-Note that several of the above donors would be very suprised at finding
-parts of themselves ... er, their work ... shambling around here. Please
-direct correspondance and/or flaming pitchforks to the pristine-tar
-maintainers.
-
-=cut
diff --git a/zgz/zgz.pod b/zgz/zgz.pod
new file mode 100644 (file)
index 0000000..0f49aaf
--- /dev/null
@@ -0,0 +1,33 @@
+=head1 NAME
+
+zgz - Frankenstein's compressor
+
+=head1 SYNOPSIS
+
+B<zgz> [options] < file > file.gz
+
+=head1 DESCRIPTION
+
+This program is an unholy combination of the BSD gzip program, a modified
+GNU gzip that supports setting an arbitrary file name and timestamp,
+and an old, rotting version of bzip2 that we dug up somewhere at midnight.
+Only the bits to do with file compression were kept.
+
+There are many arcane options which aid L<pristine-gz>(1) in re-animating
+files. Use --help to see all the gory details.
+
+=head1 AUTHOR
+
+Matthew R. Green,
+Jean-loup Gailly,
+Julian R Seward,
+Faidon Liambotis,
+Josh Triplett,
+Joey Hess
+
+Note that several of the above donors would be very suprised at finding
+parts of themselves ... er, their work ... shambling around here. Please
+direct correspondance and/or flaming pitchforks to the pristine-tar
+maintainers.
+
+=cut