* Use DESTDIR and not PREFIX to specify installation prefix for packaging.

* Support running "perl Makefile.PL PREFIX=foo" to build ikiwiki to run
  from a different directory.
master
joey 2006-08-25 02:12:43 +00:00
parent 347a756e38
commit f4d99ac1ca
8 changed files with 46 additions and 26 deletions

View File

@ -15,6 +15,8 @@ memoize("pagespec_translate");
use vars qw{%config %links %oldlinks %oldpagemtime %pagectime %pagecase use vars qw{%config %links %oldlinks %oldpagemtime %pagectime %pagecase
%renderedfiles %pagesources %depends %hooks %forcerebuild}; %renderedfiles %pagesources %depends %hooks %forcerebuild};
my $installdir=''; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE
sub defaultconfig () { #{{{ sub defaultconfig () { #{{{
wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.x?html?$|\.rss$)}, wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.x?html?$|\.rss$)},
wiki_link_regexp => qr/\[\[(?:([^\]\|]+)\|)?([^\s\]]+)\]\]/, wiki_link_regexp => qr/\[\[(?:([^\]\|]+)\|)?([^\s\]]+)\]\]/,
@ -44,8 +46,8 @@ sub defaultconfig () { #{{{
srcdir => undef, srcdir => undef,
destdir => undef, destdir => undef,
pingurl => [], pingurl => [],
templatedir => "/usr/share/ikiwiki/templates", templatedir => "$installdir/share/ikiwiki/templates",
underlaydir => "/usr/share/ikiwiki/basewiki", underlaydir => "$installdir/share/ikiwiki/basewiki",
setup => undef, setup => undef,
adminuser => undef, adminuser => undef,
adminemail => undef, adminemail => undef,

View File

@ -14,7 +14,7 @@ pure_install:: extra_install
VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog) VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)
ikiwiki: ikiwiki.pl ikiwiki: ikiwiki.pl
perl -pe '$$_="" if /use lib/; $$_="our \$$version=\"$(VER)\";\n" if /VERSION_AUTOREPLACE/' ikiwiki.pl > ikiwiki ./pm_filter $(PREFIX) $(VER) < ikiwiki.pl > ikiwiki
extra_build: extra_build:
./ikiwiki.pl doc html --templatedir=templates --underlaydir=basewiki \ ./ikiwiki.pl doc html --templatedir=templates --underlaydir=basewiki \
@ -33,29 +33,30 @@ extra_clean:
rm -f ikiwiki.man ikiwiki-mass-rebuild.man rm -f ikiwiki.man ikiwiki-mass-rebuild.man
extra_install: extra_install:
install -d $(PREFIX)/share/ikiwiki/templates install -d $(DESTDIR)/usr/share/ikiwiki/templates
cp templates/* $(PREFIX)/share/ikiwiki/templates cp templates/* $(DESTDIR)/usr/share/ikiwiki/templates
install -d $(PREFIX)/share/ikiwiki/basewiki install -d $(DESTDIR)/usr/share/ikiwiki/basewiki
cp -a basewiki/* $(PREFIX)/share/ikiwiki/basewiki cp -a basewiki/* $(DESTDIR)/usr/share/ikiwiki/basewiki
install -d $(PREFIX)/share/man/man1 install -d $(DESTDIR)/usr/share/man/man1
install ikiwiki.man $(PREFIX)/share/man/man1/ikiwiki.1 install ikiwiki.man $(DESTDIR)/usr/share/man/man1/ikiwiki.1
install -d $(PREFIX)/share/man/man8 install -d $(DESTDIR)/usr/share/man/man8
install ikiwiki-mass-rebuild.man $(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8 install ikiwiki-mass-rebuild.man $(DESTDIR)/usr/share/man/man8/ikiwiki-mass-rebuild.8
install -d $(PREFIX)/sbin install -d $(DESTDIR)/usr/sbin
install ikiwiki-mass-rebuild $(PREFIX)/sbin install ikiwiki-mass-rebuild $(DESTDIR)/usr/sbin
install -d $(PREFIX)/lib/w3m/cgi-bin install -d $(DESTDIR)/usr/lib/w3m/cgi-bin
install ikiwiki-w3m.cgi $(PREFIX)/lib/w3m/cgi-bin install ikiwiki-w3m.cgi $(DESTDIR)/usr/lib/w3m/cgi-bin
} }
} }
WriteMakefile( WriteMakefile(
'NAME' => 'IkiWiki', 'NAME' => 'IkiWiki',
'PM_FILTER' => 'grep -v "removed by Makefile"', 'PM_FILTER' => './pm_filter $(PREFIX) $(VER)',
'EXE_FILES' => ['ikiwiki'], 'EXE_FILES' => ['ikiwiki'],
'MAN1PODS' => {},
'clean' => {FILES => 'ikiwiki'}, 'clean' => {FILES => 'ikiwiki'},
); );

5
debian/changelog vendored
View File

@ -27,8 +27,11 @@ ikiwiki (1.22) UNRELEASED; urgency=low
* Make all pages pull in a local.css style sheet, if present. This won't * Make all pages pull in a local.css style sheet, if present. This won't
be included in ikiwiki, but can be created to make local styling changes be included in ikiwiki, but can be created to make local styling changes
w/o needing to merge in every new change to the distributed style.css. w/o needing to merge in every new change to the distributed style.css.
* Use DESTDIR and not PREFIX to specify installation prefix for packaging.
* Support running "perl Makefile.PL PREFIX=foo" to build ikiwiki to run
from a different directory.
-- Joey Hess <joeyh@debian.org> Thu, 24 Aug 2006 16:29:24 -0400 -- Joey Hess <joeyh@debian.org> Thu, 24 Aug 2006 21:28:45 -0400
ikiwiki (1.21) unstable; urgency=low ikiwiki (1.21) unstable; urgency=low

2
debian/copyright vendored
View File

@ -11,7 +11,7 @@ The smiley icons were copied from Moin Moin, which has these copyrights:
Copyright (C) 1999, 2000 Martin Pool <mbp@humbug.org.au> Copyright (C) 1999, 2000 Martin Pool <mbp@humbug.org.au>
Moin Moin is licensed under the terms of GPL version 2 or later. Moin Moin is licensed under the terms of GPL version 2 or later.
The basewiki and templates are licensed using a varient of the BSD license: The basewiki and templates are licensed using a variant of the BSD license:
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions modification, are permitted provided that the following conditions

2
debian/rules vendored
View File

@ -23,7 +23,7 @@ binary-indep: build
dh_testroot dh_testroot
dh_clean -k dh_clean -k
$(MAKE) pure_install INSTALLDIRS=vendor \ $(MAKE) pure_install INSTALLDIRS=vendor \
PREFIX=$(shell pwd)/debian/ikiwiki/$(shell perl -MConfig -e 'print $$Config{prefix}') DESTDIR=$(shell pwd)/debian/ikiwiki
dh_install wikilist etc/ikiwiki dh_install wikilist etc/ikiwiki
dh_installdocs html dh_installdocs html
dh_link usr/share/common-licenses/GPL usr/share/doc/ikiwiki/html/GPL dh_link usr/share/common-licenses/GPL usr/share/doc/ikiwiki/html/GPL

View File

@ -41,8 +41,4 @@ isn't entirely clear (perhaps because ordinary Perl modules do not need to be
configured at build time depending on the installation directory). It does mention configured at build time depending on the installation directory). It does mention
that DESTDIR is the thing used by packaging tools. that DESTDIR is the thing used by packaging tools.
It would probably be nice if ikiwiki offered a separate build-time Thanks for clarifying that. [[bugs/done]] --[[Joey]]
setting to control where it looked for its data files, though it already
offers a way to do it at runtime (--underlaydir and --templatedir).
--[[Joey]]

View File

@ -91,13 +91,15 @@ configuration options of their own.
* --templatedir * --templatedir
Specify the directory that the page [[templates]] are stored in. Specify the directory that the page [[templates]] are stored in.
Default is `/usr/share/ikiwiki/templates`. Default is `/usr/share/ikiwiki/templates`, or another location as
configured at build time.
* --underlaydir * --underlaydir
Specify the directory that is used to underlay the source directory. Specify the directory that is used to underlay the source directory.
Source files will be taken from here unless overridden by a file in the Source files will be taken from here unless overridden by a file in the
source directory. Default is `/usr/share/ikiwiki/basewiki`. source directory. Default is `/usr/share/ikiwiki/basewiki` or another
location as configured at build time.
* --wrappermode mode * --wrappermode mode

16
pm_filter 100755
View File

@ -0,0 +1,16 @@
#!/usr/bin/perl -i -p
BEGIN {
$prefix=shift;
$ver=shift;
}
if (/INSTALLDIR_AUTOREPLACE/) {
$_=qq{my \$installdir="$prefix";};
}
elsif (/VERSION_AUTOREPLACE/) {
$_=qq{our \$version="$ver";};
}
elsif (/^use lib/) {
$_="";
}