Skip to content

Commit

Permalink
nasty MakeMaker conversion for perl library support
Browse files Browse the repository at this point in the history
Had to move zgz.pod to subdir because MakeMaker insisted in installing it
otherwise.
  • Loading branch information
joeyh committed Jul 24, 2010
1 parent 54d83a1 commit 10f8619
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
1 change: 1 addition & 0 deletions INSTALL
@@ -0,0 +1 @@
Run ./Makefile.PL to generate a Makefile, then run `make` and `make install`.
31 changes: 27 additions & 4 deletions Makefile → Makefile.PL 100644 → 100755
@@ -1,24 +1,47 @@
build: zgz/zgz pristine-tar.spec
#!/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.pod > zgz.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)
install:
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
clean: pristine-tar.spec
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"],
);
1 change: 1 addition & 0 deletions debian/changelog
@@ -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

Expand Down
8 changes: 8 additions & 0 deletions debian/rules
@@ -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
3 changes: 2 additions & 1 deletion pristine-tar.spec
@@ -1,5 +1,5 @@
Name: pristine-tar
Version: 1.03
Version: 1.04
Release: 2%{?dist}
Summary: regenerate pristine tarballs

Expand Down Expand Up @@ -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}


Expand Down
File renamed without changes.

0 comments on commit 10f8619

Please sign in to comment.