diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-08-25 02:12:43 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-08-25 02:12:43 +0000 |
commit | f4d99ac1ca03121255e545df89e7d841a02cc0bf (patch) | |
tree | bdabb182ecd4fb16e50d1a987de70440ec466349 | |
parent | 347a756e384ec6994d4fe7ffe82e384bb9a63057 (diff) | |
download | ikiwiki-f4d99ac1ca03121255e545df89e7d841a02cc0bf.tar ikiwiki-f4d99ac1ca03121255e545df89e7d841a02cc0bf.tar.gz |
* 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.
-rw-r--r-- | IkiWiki.pm | 6 | ||||
-rwxr-xr-x | Makefile.PL | 29 | ||||
-rw-r--r-- | debian/changelog | 5 | ||||
-rw-r--r-- | debian/copyright | 2 | ||||
-rwxr-xr-x | debian/rules | 2 | ||||
-rw-r--r-- | doc/bugs/PREFIX_not_honoured_for_underlaydir.mdwn | 6 | ||||
-rw-r--r-- | doc/usage.mdwn | 6 | ||||
-rwxr-xr-x | pm_filter | 16 |
8 files changed, 46 insertions, 26 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 5ebec5d0b..b6e160ab6 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -15,6 +15,8 @@ memoize("pagespec_translate"); use vars qw{%config %links %oldlinks %oldpagemtime %pagectime %pagecase %renderedfiles %pagesources %depends %hooks %forcerebuild}; +my $installdir=''; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE + sub defaultconfig () { #{{{ wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.x?html?$|\.rss$)}, wiki_link_regexp => qr/\[\[(?:([^\]\|]+)\|)?([^\s\]]+)\]\]/, @@ -44,8 +46,8 @@ sub defaultconfig () { #{{{ srcdir => undef, destdir => undef, pingurl => [], - templatedir => "/usr/share/ikiwiki/templates", - underlaydir => "/usr/share/ikiwiki/basewiki", + templatedir => "$installdir/share/ikiwiki/templates", + underlaydir => "$installdir/share/ikiwiki/basewiki", setup => undef, adminuser => undef, adminemail => undef, diff --git a/Makefile.PL b/Makefile.PL index f2f5ba4a1..7123aef89 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -14,7 +14,7 @@ pure_install:: extra_install VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog) 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: ./ikiwiki.pl doc html --templatedir=templates --underlaydir=basewiki \ @@ -33,29 +33,30 @@ extra_clean: rm -f ikiwiki.man ikiwiki-mass-rebuild.man extra_install: - install -d $(PREFIX)/share/ikiwiki/templates - cp templates/* $(PREFIX)/share/ikiwiki/templates + install -d $(DESTDIR)/usr/share/ikiwiki/templates + cp templates/* $(DESTDIR)/usr/share/ikiwiki/templates - install -d $(PREFIX)/share/ikiwiki/basewiki - cp -a basewiki/* $(PREFIX)/share/ikiwiki/basewiki + install -d $(DESTDIR)/usr/share/ikiwiki/basewiki + cp -a basewiki/* $(DESTDIR)/usr/share/ikiwiki/basewiki - install -d $(PREFIX)/share/man/man1 - install ikiwiki.man $(PREFIX)/share/man/man1/ikiwiki.1 + install -d $(DESTDIR)/usr/share/man/man1 + install ikiwiki.man $(DESTDIR)/usr/share/man/man1/ikiwiki.1 - install -d $(PREFIX)/share/man/man8 - install ikiwiki-mass-rebuild.man $(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8 + install -d $(DESTDIR)/usr/share/man/man8 + install ikiwiki-mass-rebuild.man $(DESTDIR)/usr/share/man/man8/ikiwiki-mass-rebuild.8 - install -d $(PREFIX)/sbin - install ikiwiki-mass-rebuild $(PREFIX)/sbin + install -d $(DESTDIR)/usr/sbin + install ikiwiki-mass-rebuild $(DESTDIR)/usr/sbin - install -d $(PREFIX)/lib/w3m/cgi-bin - install ikiwiki-w3m.cgi $(PREFIX)/lib/w3m/cgi-bin + install -d $(DESTDIR)/usr/lib/w3m/cgi-bin + install ikiwiki-w3m.cgi $(DESTDIR)/usr/lib/w3m/cgi-bin } } WriteMakefile( 'NAME' => 'IkiWiki', - 'PM_FILTER' => 'grep -v "removed by Makefile"', + 'PM_FILTER' => './pm_filter $(PREFIX) $(VER)', 'EXE_FILES' => ['ikiwiki'], + 'MAN1PODS' => {}, 'clean' => {FILES => 'ikiwiki'}, ); diff --git a/debian/changelog b/debian/changelog index cc6b286ef..0672428b1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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. + * 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 diff --git a/debian/copyright b/debian/copyright index 1b567623d..9b3639b35 100644 --- a/debian/copyright +++ b/debian/copyright @@ -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> 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 modification, are permitted provided that the following conditions diff --git a/debian/rules b/debian/rules index 48ce274db..3358db5d9 100755 --- a/debian/rules +++ b/debian/rules @@ -23,7 +23,7 @@ binary-indep: build dh_testroot dh_clean -k $(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_installdocs html dh_link usr/share/common-licenses/GPL usr/share/doc/ikiwiki/html/GPL diff --git a/doc/bugs/PREFIX_not_honoured_for_underlaydir.mdwn b/doc/bugs/PREFIX_not_honoured_for_underlaydir.mdwn index af2ee35cb..e66cad173 100644 --- a/doc/bugs/PREFIX_not_honoured_for_underlaydir.mdwn +++ b/doc/bugs/PREFIX_not_honoured_for_underlaydir.mdwn @@ -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 that DESTDIR is the thing used by packaging tools. - It would probably be nice if ikiwiki offered a separate build-time - 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]] + Thanks for clarifying that. [[bugs/done]] --[[Joey]] diff --git a/doc/usage.mdwn b/doc/usage.mdwn index e0c7800d5..daef18c1f 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -91,13 +91,15 @@ configuration options of their own. * --templatedir 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 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 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 diff --git a/pm_filter b/pm_filter new file mode 100755 index 000000000..89449bd91 --- /dev/null +++ b/pm_filter @@ -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/) { + $_=""; +} |