/* * cook - file construction tool * Copyright (C) 2002, 2006-2008, 2010 Peter Miller * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see * . */ /* * Integration builds also make the files for distribution. */ if [not [defined baseline]] then { all += integration-build-targets; /* * Adjust the mtime of recipe targets to be exactly 1 second * younger than the youngest ingredient. This helps aeipass * compress the mtimes. */ set time-adjust-back; } #if 0 if [in [fromto %1.D%2 %2 [version]] 001 002 003] then if [find_command rpmbuild] then all += RPM; #endif integration-build-targets = ; integration-build-targets: [integration-build-targets]; integration-build-targets += archive/[project_minus].tar.gz [fromto etc/%.html archive/%.html [match_mask etc/%.html [source_files]] ] archive/[project_short].png archive/[project_short].64.png archive/[project_minus].ug.pdf archive/[project_minus].rm.pdf archive/[project_minus].tut.pdf /* archive/[project_minus].faq */ archive/[project_minus].spec archive/[project_minus].README archive/[project_minus].ae /* * This next file is for the benefit of the Translation Project's * email robot. (Yes, that's right, a bloody robot.) * * See http://www.iro.umontreal.ca/contrib/po/HTML/maintainers.html * for more information. * * I particularly dislike this approach, because it is incredibly * short sighted. This approach fails to take into account that * you may want to have translations of manual pages and other * documentation, AS WELL AS translations of error messages. * * Would it make sense to ask authors to catenate all of * ther man pages together, and have a po/PACKAGE.man file? * No, of course not. Would it make sense to ask authors to * catenate all of their other documentation together, and * have a po/PACKAGE.latex file? No, of course not. Well then, * why on Earth does it make sense to catenate together all of * the messages into a po/PACKAGE.pot file? Betch. * * And then, to add insult to injury, it wastes space in the tarball. * * My project uses a directory tree * lib/ * / * LC_MESSAGES/ * all of the various .po files go here * man/ * all of the man pages go here * user-guide/ * all of the files which make the * user guide go here. * / * and so on... * * As you can see, this can accomodate translated .po files, * AND ALSO any other documentation, once it is translated. */ po/[project_short].pot ; #if [find_command png2ico] integration-build-targets += archive/[project_short].ico ; #endif /* * These recipes build a Makefile for a user. They do not build a * Makefile useful for a development build, because no arch * information is included in the Makefile. */ Makefile.in: [source_files] { aemakegen -p [project] -c [change] | [awk] -f [resolve etc/Makefile.awk] > [target]; } CHANGES = etc/CHANGES.[version_short]; source_file_order = README [sort [stringset [CHANGES] [source_files] install-sh BUILDING LICENSE Makefile.in etc/version.so common/config.h.in common/patchlevel.h configure [project_short].spec [project_short].png - README ] ] /* * This next file is for the benefit of the Translation Project's * email robot. (Yes, that's right, a bloody robot.) * * See http://www.iro.umontreal.ca/contrib/po/HTML/maintainers.html * for more information. * * I particularly dislike this approach, because it is incredibly * short sighted. This approach fails to take into account that * you may want to have translations of manual pages and other * documentation, AS WELL AS translations of error messages. * * Would it make sense to ask authors to catenate all of * ther man pages together, and have a po/PACKAGE.man file? * No, of course not. Would it make sense to ask authors to * catenate all of their other documentation together, and * have a po/PACKAGE.latex file? No, of course not. Well then, * why on Earth does it make sense to catenate together all of * the messages into a po/PACKAGE.pot file? Betch. * * And then, to add insult to injury, it wastes space in the tarball. * * My project uses a directory tree * lib/ * / * LC_MESSAGES/ * all of the various .po files go here * man/ * all of the man pages go here * user-guide/ * all of the files which make the * user guide go here. * / * and so on... * * As you can see, this can accomodate translated .po files, * AND ALSO any other documentation, once it is translated. */ po/[project_short].pot ; archive/[project_minus].tar.gz: [source_file_order] debian/control /* at al */ set shallow { tar cf - [resolve [source_file_order]] debian/changelog debian/compat debian/control debian/rules debian/cook.install | tardy -unu 0 -gnu 0 -una Peter -gna Miller -p [project_minus] -ms 0644 -mc 07022 -now [prepost "-rp=" "" [search_list]] > archive/[project_minus].tar; gzip -9 -v archive/[project_minus].tar; } archive/[project_minus].ae: [source_files] set shallow { if [find_command aedist] then { /* * must be *system* aedist, not just built aedist, * since it uses the existing project, which may * not even be readable by the newly built aedist */ aedist --send --entire-source -ndh -naa -p\=[project] -c\=[change] -o [target]; } else [print Skipping [target], since no aedist(1) found]; } [CHANGES]: etc/CHANGES.sh [vs_file] { sh [resolve etc/CHANGES.sh] [project] > [target]; } archive/[project_minus].ug.pdf: lib/en/user-guide/user-guide.pdf set shallow { cp [resolve [need]] [target]; } archive/[project_minus].rm.pdf: lib/en/refman/refman.pdf set shallow { cp [resolve [need]] [target]; } archive/[project_minus].tut.pdf: lib/en/tutorial/tutorial.pdf set shallow { cp [resolve [need]] [target]; } archive/[project_minus].faq: lib/en/faq/faq.txt set shallow { cp [resolve [need]] [target]; } README: lib/en/readme/readme.txt { cp [resolve [need]] [target]; } BUILDING: lib/en/building/building.txt { cp [resolve [need]] [target]; } archive/[project_minus].README: lib/en/readme/readme.txt set shallow { cp [resolve [need]] [target]; } etc/%.html.d: etc/%.html set nocascade { c_incl -nc -ns -eia -r -nrec [cc_include_flags] -prefix "'cascade etc/"%".html ='" -suffix "';'" [resolve etc/%.html] [prepost "-rlp=" "" [search_list]] /* remove leading path */ -slp [arch] "'[arch]'" /* substitute leading path */ -o [target]; } #include-cooked-nowarn [addsuffix ".d" [match_mask etc/%.html [source_files]]] archive/%.html: etc/%.html: etc/ssp.awk etc/version.so set shallow { roffpp [cc_include_flags] [resolve etc/%.html] | groff -Tascii -t -P-hub -man | [awk] -f [resolve etc/ssp.awk] > [target]; } [project_short].spec: etc/spec.sh [source_files] { version\=[version_short] sh [resolve etc/spec.sh] [source_files] > [target]; } archive/[project_minus].spec: [project_short].spec set shallow { cat [need] > [target]; } archive/%: etc/%.uue set shallow { uudecode [resolve [need]] -o [target]; } %: etc/%.uue set shallow { uudecode [resolve [need]] -o [target]; } /* * This is not in the integration build taregs because it takes far too * long to do. */ RPM: archive/[project_minus]-1.i386.rpm; archive/[project_minus]-1.i386.rpm archive/[project_minus]-1.src.rpm: archive/[project_minus].tar.gz etc/rpm-build.sh archive/[project_short].png set shallow { sh [resolve etc/rpm-build.sh] RPM-temporary [resolve archive/[project_minus].tar.gz] ; mv RPM-temporary/RPMS/i386/[project_minus]-1.i386.rpm archive/[project_minus]-1.i386.rpm ; mv RPM-temporary/SRPMS/[project_minus]-1.src.rpm archive/[project_minus]-1.src.rpm ; rm -r RPM-temporary; } archive/%.ico archive/%-64.png archive/%-48.png archive/%-32.png archive/%-16.png: archive/%.png { convert [resolve archive/%.png] -scale 64 archive/%-64.png; convert [resolve archive/%.png] -scale 48 archive/%-48.png; convert [resolve archive/%.png] -scale 32 archive/%-32.png; convert [resolve archive/%.png] -scale 16 archive/%-16.png; png2ico [target] archive/%-64.png archive/%-48.png archive/%-32.png archive/%-16.png ; } check-tarball: archive/[project_minus].tar.gz { rm -rf [project_minus]; tar xzf [resolve archive/[project_minus].tar.gz]; cd [project_minus] && ./configure && make; rm -rf [project_minus]; } debian/control debian/changelog debian/cook.install: [source_files] set shallow { /* This actually makes more files than just debian/control */ aemakegen -p [project] -c [change] --target\=debian ; cat debian/cook.install; } if [in [fromto %1D%2 %2 [version]] 001 002 003 004] then { integration-build-targets += debian-package; } debian-package: archive/[project_minus].tar.gz debian/changelog { local vsn = [collect head -1 [resolve debian/changelog] | sed "'s|.*(\\([^()]*\\).*|\\1|'" ]; vsn = [fromto %-1 % [vsn]]; function print "vsn = '"[vsn]"'"; if [not [in [count [vsn]] 1]] then fail "debian version not right"; local tarball = [project_short]_[vsn].orig.tar.gz; local user = [collect id -un]; local key = ; if [in [user] archives] then key = -k19CEC7D5; else key = -us -uc; /* * We fake the .orig.tar.gz file to not have a debian/ directory, * by filtering it out with tardy. This silences a PITA lintian * warning, for no real benefit. */ unset GPG_AGENT_INFO && rm -rf archive/debian && mkdir -p archive/debian && cd archive/debian && echo Options Indexes > .htaccess && gunzip < ../[project_minus].tar.gz | tardy -exclude "'"[project_minus]"/debian/*'" | gzip -9 > [tarball] && tar xzf ../[project_minus].tar.gz && cd [project_minus] && #if 0 dpkg-buildpackage -sgpg [key] -sa && #else debuild [key] -sa && #endif cd .. && rm -rf [project_minus] && lintian -iIv --pedantic *.changes ; } archive/%1.%2.png: archive/%1.png set shallow { convert archive/%1.png -scale %2x%2 [target]; }