Mercurial > hg > chronicle
annotate Makefile @ 226:37668661af76
Install all themese without hardwiring their names.
author | Steve Kemp <steve@steve.org.uk> |
---|---|
date | Fri, 02 May 2008 21:01:03 +0100 |
parents | f9446e440ff1 |
children | dfb2cf5a5882 |
rev | line source |
---|---|
1 | 1 # |
2 # Utility makefile for people working with chronicle | |
3 # | |
4 # The targets are intended to be useful for people who are using | |
65
88f87687b36e
Removed references to the CVS repository and replaced them with Mercurial.
Steve Kemp <steve@steve.org.uk>
parents:
64
diff
changeset
|
5 # the remote repository - but it also contains other useful targets. |
1 | 6 # |
7 # Steve | |
8 # -- | |
9 # http://www.steve.org.uk/ | |
10 # | |
11 | |
12 # | |
13 # Only used to build distribution tarballs. | |
14 # | |
15 DIST_PREFIX = ${TMP} | |
206 | 16 VERSION = 2.6 |
1 | 17 BASE = chronicle |
18 | |
19 | |
20 # | |
21 # Installation prefix, useful for the Debian package. | |
22 # | |
23 prefix= | |
24 | |
25 | |
26 nop: | |
27 @echo "Valid targets are (alphabetically) :" | |
28 @echo " " | |
29 @echo " clean = Remove bogus files and any local output." | |
65
88f87687b36e
Removed references to the CVS repository and replaced them with Mercurial.
Steve Kemp <steve@steve.org.uk>
parents:
64
diff
changeset
|
30 @echo " diff = See the local changes." |
1 | 31 @echo " test = Run our simple test cases." |
32 @echo " test-verbose = Run our simple test cases, verbosely." | |
65
88f87687b36e
Removed references to the CVS repository and replaced them with Mercurial.
Steve Kemp <steve@steve.org.uk>
parents:
64
diff
changeset
|
33 @echo " update = Update from the remote repository." |
1 | 34 @echo " " |
35 | |
36 | |
37 # | |
38 # Delete all temporary files, recursively. | |
39 # | |
40 clean: | |
41 @find . -name '.*~' -exec rm \{\} \; | |
42 @find . -name '.#*' -exec rm \{\} \; | |
43 @find . -name '*~' -exec rm \{\} \; | |
44 @find . -name '*.bak' -exec rm \{\} \; | |
45 @find . -name '*.tmp' -exec rm \{\} \; | |
97 | 46 @if [ -d comments ]; then rm -rf comments; fi |
90 | 47 @if [ -d output ]; then rm -rf output; fi |
52 | 48 @if [ -e build-stamp ]; then rm -f build-stamp; fi |
49 @if [ -e chronicle.1 ]; then rm -f chronicle.1 ; fi | |
50 | |
1 | 51 # |
65
88f87687b36e
Removed references to the CVS repository and replaced them with Mercurial.
Steve Kemp <steve@steve.org.uk>
parents:
64
diff
changeset
|
52 # Show what has been changed in the local copy vs. the remote repository. |
1 | 53 # |
54 diff: | |
65
88f87687b36e
Removed references to the CVS repository and replaced them with Mercurial.
Steve Kemp <steve@steve.org.uk>
parents:
64
diff
changeset
|
55 hg diff |
1 | 56 |
57 | |
58 # | |
10 | 59 # Install to /usr/local/bin |
60 # | |
226
37668661af76
Install all themese without hardwiring their names.
Steve Kemp <steve@steve.org.uk>
parents:
210
diff
changeset
|
61 # Install the themes without hardwiring a list of them. |
37668661af76
Install all themese without hardwiring their names.
Steve Kemp <steve@steve.org.uk>
parents:
210
diff
changeset
|
62 # |
10 | 63 install: |
226
37668661af76
Install all themese without hardwiring their names.
Steve Kemp <steve@steve.org.uk>
parents:
210
diff
changeset
|
64 mkdir -p ${prefix}/etc |
10 | 65 cp ./etc/chroniclerc ${prefix}/etc/chroniclerc |
66 mkdir -p ${prefix}/usr/local/bin | |
67 cp ./bin/chronicle ${prefix}/usr/local/bin | |
210 | 68 cp ./bin/chronicle-spooler ${prefix}/usr/local/bin |
61 | 69 mkdir -p ${prefix}/usr/share/chronicle/themes/xml |
70 cp -r ./themes/xml/*.* ${prefix}/usr/share/chronicle/themes/xml | |
226
37668661af76
Install all themese without hardwiring their names.
Steve Kemp <steve@steve.org.uk>
parents:
210
diff
changeset
|
71 for i in themes/*/; do \ |
37668661af76
Install all themese without hardwiring their names.
Steve Kemp <steve@steve.org.uk>
parents:
210
diff
changeset
|
72 mkdir -p ${prefix}/usr/share/chronicle/themes/$$(basename $$i) ;\ |
37668661af76
Install all themese without hardwiring their names.
Steve Kemp <steve@steve.org.uk>
parents:
210
diff
changeset
|
73 cp -r ./themes/$$(basename $$i)/*.* ${prefix}/usr/share/chronicle/themes/$$(basename $$i)/ ;\ |
37668661af76
Install all themese without hardwiring their names.
Steve Kemp <steve@steve.org.uk>
parents:
210
diff
changeset
|
74 done |
10 | 75 |
76 | |
77 # | |
1 | 78 # Make a new release tarball, and make a GPG signature. |
79 # | |
174
4b0b1944e6bb
Make the code tidy with 'perltidy'
Steve Kemp <steve@steve.org.uk>
parents:
169
diff
changeset
|
80 release: tidy clean |
1 | 81 rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION) |
82 rm -f $(DIST_PREFIX)/$(BASE)-$(VERSION).tar.gz | |
83 cp -R . $(DIST_PREFIX)/$(BASE)-$(VERSION) | |
23 | 84 perl -pi.bak -e "s/UNRELEASED/$(VERSION)/g" $(DIST_PREFIX)/$(BASE)-$(VERSION)/bin/chronicle |
203
a032048557b6
Updated so that the spooler gets the version setup correctly.
Steve Kemp <steve@steve.org.uk>
parents:
196
diff
changeset
|
85 perl -pi.bak -e "s/UNRELEASED/$(VERSION)/g" $(DIST_PREFIX)/$(BASE)-$(VERSION)/bin/chronicle-spooler |
196
e2f01ce401c0
Update version in the -spooler script too
Steve Kemp <steve@steve.org.uk>
parents:
190
diff
changeset
|
86 rm $(DIST_PREFIX)/$(BASE)-$(VERSION)/bin/*.bak |
65
88f87687b36e
Removed references to the CVS repository and replaced them with Mercurial.
Steve Kemp <steve@steve.org.uk>
parents:
64
diff
changeset
|
87 find $(DIST_PREFIX)/$(BASE)-$(VERSION) -name ".hg*" -print | xargs rm -rf |
71
eeda758eccf6
Ignore *.txt in ./blog/ when making a release
Steve Kemp <steve@steve.org.uk>
parents:
65
diff
changeset
|
88 find $(DIST_PREFIX)/$(BASE)-$(VERSION)/blog -name "*.txt" -print | xargs rm -rf |
1 | 89 rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)/debian |
65
88f87687b36e
Removed references to the CVS repository and replaced them with Mercurial.
Steve Kemp <steve@steve.org.uk>
parents:
64
diff
changeset
|
90 cd $(DIST_PREFIX) && tar -cvf $(DIST_PREFIX)/$(BASE)-$(VERSION).tar $(BASE)-$(VERSION)/ |
1 | 91 gzip $(DIST_PREFIX)/$(BASE)-$(VERSION).tar |
92 mv $(DIST_PREFIX)/$(BASE)-$(VERSION).tar.gz . | |
93 rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION) | |
94 gpg --armour --detach-sign $(BASE)-$(VERSION).tar.gz | |
95 | |
96 | |
97 # | |
174
4b0b1944e6bb
Make the code tidy with 'perltidy'
Steve Kemp <steve@steve.org.uk>
parents:
169
diff
changeset
|
98 # Tidy the code |
4b0b1944e6bb
Make the code tidy with 'perltidy'
Steve Kemp <steve@steve.org.uk>
parents:
169
diff
changeset
|
99 # |
4b0b1944e6bb
Make the code tidy with 'perltidy'
Steve Kemp <steve@steve.org.uk>
parents:
169
diff
changeset
|
100 tidy: |
176
6e1fe18b30b7
Fixed to run perltidy correctly
Steve Kemp <steve@steve.org.uk>
parents:
174
diff
changeset
|
101 if [ -x /usr/bin/perltidy ]; then \ |
6e1fe18b30b7
Fixed to run perltidy correctly
Steve Kemp <steve@steve.org.uk>
parents:
174
diff
changeset
|
102 perltidy -b -nt -bt=2 -sbt=1 -bl -mbl=3 -sbl -bbs -bbb -anl -lp bin/chronicle ;\ |
6e1fe18b30b7
Fixed to run perltidy correctly
Steve Kemp <steve@steve.org.uk>
parents:
174
diff
changeset
|
103 perltidy -b -nt -bt=2 -sbt=1 -bl -mbl=3 -sbl -bbs -bbb -anl -lp cgi-bin/comments.cgi \ |
6e1fe18b30b7
Fixed to run perltidy correctly
Steve Kemp <steve@steve.org.uk>
parents:
174
diff
changeset
|
104 ; fi |
174
4b0b1944e6bb
Make the code tidy with 'perltidy'
Steve Kemp <steve@steve.org.uk>
parents:
169
diff
changeset
|
105 |
4b0b1944e6bb
Make the code tidy with 'perltidy'
Steve Kemp <steve@steve.org.uk>
parents:
169
diff
changeset
|
106 |
4b0b1944e6bb
Make the code tidy with 'perltidy'
Steve Kemp <steve@steve.org.uk>
parents:
169
diff
changeset
|
107 # |
1 | 108 # Run the test suite. |
109 # | |
110 test: | |
111 prove --shuffle tests/ | |
112 | |
113 | |
114 # | |
115 # Run the test suite verbosely. | |
116 # | |
117 test-verbose: | |
118 prove --shuffle --verbose tests/ | |
119 | |
120 | |
121 | |
122 # | |
65
88f87687b36e
Removed references to the CVS repository and replaced them with Mercurial.
Steve Kemp <steve@steve.org.uk>
parents:
64
diff
changeset
|
123 # Update the local copy from the remote repository. |
1 | 124 # |
125 # NOTE: Removes empty local directories. | |
126 # | |
166
df0201e39fed
Added 'cut' implementation.
Steve Kemp <steve@steve.org.uk>
parents:
165
diff
changeset
|
127 update: |
65
88f87687b36e
Removed references to the CVS repository and replaced them with Mercurial.
Steve Kemp <steve@steve.org.uk>
parents:
64
diff
changeset
|
128 hg pull --update |
26 | 129 |
130 | |
131 steve: | |
186
c078b940bf3b
Don't use memcached when building the demo blogs
Steve Kemp <steve@steve.org.uk>
parents:
176
diff
changeset
|
132 ./bin/chronicle --theme-dir=./themes --theme=default --url-prefix=http://www.steve.org.uk/Software/chronicle/demo/ --pre-build="/bin/rm -rf ./output" --post-build="rsync -v -r output/* steve@www.steve.org.uk:/home/www/www.steve.org.uk/htdocs/Software/chronicle/demo/" --no-comments --no-cache |
c078b940bf3b
Don't use memcached when building the demo blogs
Steve Kemp <steve@steve.org.uk>
parents:
176
diff
changeset
|
133 ./bin/chronicle --theme-dir=./themes --theme=copyrighteous --url-prefix=http://www.steve.org.uk/Software/chronicle/demo2/ --pre-build="/bin/rm -rf ./output" --post-build="rsync -v -r output/* steve@www.steve.org.uk:/home/www/www.steve.org.uk/htdocs/Software/chronicle/demo2/" --no-comments --no-cache |
c078b940bf3b
Don't use memcached when building the demo blogs
Steve Kemp <steve@steve.org.uk>
parents:
176
diff
changeset
|
134 ./bin/chronicle --theme-dir=./themes --theme=blocky --url-prefix=http://www.steve.org.uk/Software/chronicle/demo3/ --pre-build="/bin/rm -rf ./output" --post-build="rsync -v -r output/* steve@www.steve.org.uk:/home/www/www.steve.org.uk/htdocs/Software/chronicle/demo3/" --no-comments --no-cache |
226
37668661af76
Install all themese without hardwiring their names.
Steve Kemp <steve@steve.org.uk>
parents:
210
diff
changeset
|
135 ./bin/chronicle --theme-dir=./themes --theme=leftbar --url-prefix=http://www.steve.org.uk/Software/chronicle/demo4/ --pre-build="/bin/rm -rf ./output" --post-build="rsync -v -r output/* steve@www.steve.org.uk:/home/www/www.steve.org.uk/htdocs/Software/chronicle/demo4/" --no-comments --no-cache |