| 393 | | == Example == |
| 394 | | |
| 395 | | ...TODO... |
| | 393 | == Examples == |
| | 394 | |
| | 395 | === A simple example === |
| | 396 | |
| | 397 | This is the build recipe for `gawk`, which is rather generic. It provides two commands (one of which is just a symlink to the other) and it just requires Haiku for execution. |
| | 398 | |
| | 399 | {{{ |
| | 400 | SUMMARY="A pattern scanning and processing language" |
| | 401 | DESCRIPTION=" |
| | 402 | If you are like many computer users, you would frequently like to make |
| | 403 | changes in various text files wherever certain patterns appear, or |
| | 404 | extract data from parts of certain lines while discarding the rest. To |
| | 405 | write a program to do this in a language such as C or Pascal is a |
| | 406 | time-consuming inconvenience that may take many lines of code. The job |
| | 407 | is easy with awk, especially the GNU implementation: gawk. |
| | 408 | |
| | 409 | The awk utility interprets a special-purpose programming language that |
| | 410 | makes it possible to handle simple data-reformatting jobs with just a |
| | 411 | few lines of code. |
| | 412 | " |
| | 413 | HOMEPAGE="http://www.gnu.org/software/coreutils" |
| | 414 | SRC_URI="http://ftp.gnu.org/gnu/gawk/gawk-3.1.8.tar.bz2" |
| | 415 | CHECKSUM_MD5="52b41c6c4418b3226dfb8f82076193bb" |
| | 416 | LICENSE="GNU GPL v3" |
| | 417 | COPYRIGHT="1983-2010 Free Software Foundation, Inc." |
| | 418 | REVISION="2" |
| | 419 | ARCHITECTURES="x86_gcc2 ?x86" |
| | 420 | |
| | 421 | PROVIDES=" |
| | 422 | gawk = $portVersion compat >= 3 |
| | 423 | cmd:awk = $portVersion compat >= 3 |
| | 424 | cmd:gawk = $portVersion compat >= 3 |
| | 425 | " |
| | 426 | REQUIRES=" |
| | 427 | haiku >= $haikuVersion |
| | 428 | " |
| | 429 | BUILD_REQUIRES=" |
| | 430 | " |
| | 431 | BUILD_PREREQUIRES=" |
| | 432 | haiku_devel >= $haikuVersion |
| | 433 | cmd:gcc |
| | 434 | cmd:ld |
| | 435 | cmd:libtoolize |
| | 436 | cmd:make |
| | 437 | cmd:sed |
| | 438 | " |
| | 439 | |
| | 440 | SOURCE_DIR="$portVersionedName" |
| | 441 | |
| | 442 | BUILD() |
| | 443 | { |
| | 444 | libtoolize --force --copy --install |
| | 445 | ./configure $configureDirArgs |
| | 446 | make |
| | 447 | } |
| | 448 | |
| | 449 | INSTALL() |
| | 450 | { |
| | 451 | make install |
| | 452 | } |
| | 453 | |
| | 454 | TEST() |
| | 455 | { |
| | 456 | make check |
| | 457 | } |
| | 458 | }}} |
| | 459 | |
| | 460 | === An advanced example === |
| | 461 | |
| | 462 | This is the build recipe for `git`, which depends on a number of other packages at both build- and runtime. Additionally, git provides a number of general sibling packages. |
| | 463 | |
| | 464 | {{{ |
| | 465 | SUMMARY="Fast, scalable, distributed revision control system" |
| | 466 | DESCRIPTION=" |
| | 467 | Git is a free and open source distributed version control system designed |
| | 468 | to handle everything from small to very large projects with speed and |
| | 469 | efficiency. |
| | 470 | |
| | 471 | Git is easy to learn and has a tiny footprint with lightning fast |
| | 472 | performance. It outclasses SCM tools like Subversion, CVS, Perforce, |
| | 473 | and ClearCase with features like cheap local branching, convenient |
| | 474 | staging areas, and multiple workflows. |
| | 475 | " |
| | 476 | HOMEPAGE="http://git-scm.com/" |
| | 477 | LICENSE="GNU GPL v2" |
| | 478 | COPYRIGHT="2005-2012 Git Authors (see git web site for list)" |
| | 479 | |
| | 480 | SRC_URI="http://git-core.googlecode.com/files/git-1.7.10.2.tar.gz" |
| | 481 | CHECKSUM_MD5="2e2ee53243ab8e7cf10f15c5229c3fce" |
| | 482 | SOURCE_DIR="$portVersionedName" |
| | 483 | PATCHES="git-1.7.10.2.patch" |
| | 484 | |
| | 485 | SRC_URI_2="http://git-core.googlecode.com/files/git-manpages-1.7.10.2.tar.gz" |
| | 486 | CHECKSUM_MD5_2="79bae5456db8366803d28db867892d74" |
| | 487 | |
| | 488 | SRC_URI_3="http://git-core.googlecode.com/files/git-htmldocs-1.7.10.2.tar.gz" |
| | 489 | CHECKSUM_MD5_3="9c401a36aee40d68f5ca3513818e8f29" |
| | 490 | |
| | 491 | REVISION="2" |
| | 492 | |
| | 493 | ARCHITECTURES="x86_gcc2 ?x86" |
| | 494 | |
| | 495 | PROVIDES=" |
| | 496 | git = $portVersion compat >= 1.7 |
| | 497 | cmd:git = $portVersion compat >= 1.7 |
| | 498 | cmd:git_receive_pack = $portVersion compat >= 1.7 |
| | 499 | cmd:git_shell = $portVersion compat >= 1.7 |
| | 500 | cmd:git_upload_archive = $portVersion compat >= 1.7 |
| | 501 | cmd:git_upload_pack = $portVersion compat >= 1.7 |
| | 502 | " |
| | 503 | PROVIDES_arch=" |
| | 504 | git_arch = $portVersion compat >= 1.7 |
| | 505 | cmd:git_archimport = $portVersion compat >= 1.7 |
| | 506 | " |
| | 507 | PROVIDES_cvs=" |
| | 508 | git_cvs = $portVersion compat >= 1.7 |
| | 509 | cmd:git_cvsserver = $portVersion compat >= 1.7 |
| | 510 | " |
| | 511 | PROVIDES_daemon=" |
| | 512 | git_daemon = $portVersion compat >= 1.7 |
| | 513 | cmd:git_daemon = $portVersion compat >= 1.7 |
| | 514 | " |
| | 515 | PROVIDES_email=" |
| | 516 | git_email = $portVersion compat >= 1.7 |
| | 517 | cmd:git_send_email = $portVersion compat >= 1.7 |
| | 518 | " |
| | 519 | PROVIDES_source=" |
| | 520 | git_source = $portVersion compat >= 1.7 |
| | 521 | " |
| | 522 | PROVIDES_svn=" |
| | 523 | git_svn = $portVersion compat >= 1.7 |
| | 524 | cmd:git_svn = $portVersion compat >= 1.7 |
| | 525 | " |
| | 526 | |
| | 527 | REQUIRES=" |
| | 528 | haiku >= $haikuVersion |
| | 529 | curl |
| | 530 | expat |
| | 531 | man |
| | 532 | openssl |
| | 533 | perl |
| | 534 | python |
| | 535 | zlib |
| | 536 | cmd:nano |
| | 537 | " |
| | 538 | REQUIRES_arch=" |
| | 539 | haiku >= $haikuVersion |
| | 540 | git == $portVersion |
| | 541 | " |
| | 542 | REQUIRES_cvs=" |
| | 543 | haiku >= $haikuVersion |
| | 544 | git == $portVersion |
| | 545 | " |
| | 546 | REQUIRES_daemon=" |
| | 547 | haiku >= $haikuVersion |
| | 548 | git == $portVersion |
| | 549 | " |
| | 550 | REQUIRES_email=" |
| | 551 | haiku >= $haikuVersion |
| | 552 | git == $portVersion |
| | 553 | " |
| | 554 | REQUIRES_svn=" |
| | 555 | haiku >= $haikuVersion |
| | 556 | git == $portVersion |
| | 557 | " |
| | 558 | |
| | 559 | BUILD_REQUIRES=" |
| | 560 | $REQUIRES |
| | 561 | cmd:gcc |
| | 562 | cmd:ld |
| | 563 | cmd:make |
| | 564 | cmd:sed |
| | 565 | cmd:tar |
| | 566 | " |
| | 567 | BUILD_PREREQUIRES=" |
| | 568 | haiku_devel >= $haikuVersion |
| | 569 | " |
| | 570 | |
| | 571 | BUILD() |
| | 572 | { |
| | 573 | make |
| | 574 | } |
| | 575 | |
| | 576 | INSTALL() |
| | 577 | { |
| | 578 | make strip |
| | 579 | make install |
| | 580 | |
| | 581 | # replace copies of git binaries with symlinks |
| | 582 | cd $prefix/bin |
| | 583 | for program in git*; do |
| | 584 | ln -sfn "../lib/git-core/$program" "$program" |
| | 585 | done |
| | 586 | |
| | 587 | # copy manpages |
| | 588 | mkdir -p $manDir |
| | 589 | cp -rd $sourceDir2/* $manDir/ |
| | 590 | |
| | 591 | # copy html documentation |
| | 592 | htmlDir=$docDir/html |
| | 593 | mkdir -p $htmlDir |
| | 594 | cp -rd $sourceDir3/*.html $htmlDir/ |
| | 595 | rm $htmlDir/git-gui.html |
| | 596 | |
| | 597 | # copy asciidoc documentation for which there isn't any corresponding html |
| | 598 | asciidocDir=$docDir/asciidoc |
| | 599 | mkdir -p $asciidocDir |
| | 600 | for f in $sourceDir3/*.txt; do |
| | 601 | html=$sourceDir3/$(basename $f .txt).html |
| | 602 | if ! [ -e $html ]; then |
| | 603 | cp -d $f $asciidocDir/ |
| | 604 | fi |
| | 605 | done |
| | 606 | |
| | 607 | packageEntries arch \ |
| | 608 | documentation/packages/git/html/git-archimport.html \ |
| | 609 | documentation/man/man1/git-archimport.1 \ |
| | 610 | lib/git-core/git-archimport |
| | 611 | |
| | 612 | packageEntries cvs \ |
| | 613 | bin/git-cvsserver \ |
| | 614 | documentation/packages/git/html/git-cvsexportcommit.html \ |
| | 615 | documentation/packages/git/html/git-cvsimport.html \ |
| | 616 | documentation/packages/git/html/git-cvsserver.html \ |
| | 617 | documentation/man/man1/git-cvsexportcommit.1 \ |
| | 618 | documentation/man/man1/git-cvsimport.1 \ |
| | 619 | documentation/man/man1/git-cvsserver.1 \ |
| | 620 | documentation/man/man7/gitcvs-migration.7 \ |
| | 621 | lib/git-core/git-cvsexportcommit \ |
| | 622 | lib/git-core/git-cvsimport \ |
| | 623 | lib/git-core/git-cvsserver |
| | 624 | |
| | 625 | packageEntries daemon \ |
| | 626 | documentation/packages/git/html/git-credential-cache--daemon.html \ |
| | 627 | documentation/packages/git/html/git-credential-cache.html \ |
| | 628 | documentation/packages/git/html/git-daemon.html \ |
| | 629 | documentation/man/man1/git-credential-cache--daemon.1 \ |
| | 630 | documentation/man/man1/git-credential-cache.1 \ |
| | 631 | documentation/man/man1/git-daemon.1 \ |
| | 632 | lib/git-core/git-credential-cache--daemon \ |
| | 633 | lib/git-core/git-credential-cache \ |
| | 634 | lib/git-core/git-daemon |
| | 635 | |
| | 636 | packageEntries email \ |
| | 637 | documentation/packages/git/html/git-send-email.html \ |
| | 638 | documentation/man/man1/git-send-email.1 \ |
| | 639 | lib/git-core/git-send-email |
| | 640 | |
| | 641 | packageEntries svn \ |
| | 642 | documentation/packages/git/html/git-svn.html \ |
| | 643 | documentation/man/man1/git-svn.1 \ |
| | 644 | lib/git-core/git-svn |
| | 645 | } |
| | 646 | }}} |