Simple command line calculator http://amath.innolan.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

builddeb 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. #!/bin/sh
  2. #
  3. # Copyright {c} 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions
  8. # are met:
  9. # 1. Redistributions of source code must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. # 2. Redistributions in binary form must reproduce the above copyright
  12. # notice, this list of conditions and the following disclaimer in the
  13. # documentation and/or other materials provided with the distribution.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  16. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18. # ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
  19. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  20. # DAMAGES {INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  21. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION}
  22. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  23. # LIABILITY, OR TORT {INCLUDING NEGLIGENCE OR OTHERWISE} ARISING IN ANY WAY
  24. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  25. # SUCH DAMAGE.
  26. #
  27. # Project homepage:
  28. # https://amath.innolan.net
  29. #
  30. set -e
  31. version="1.8.4"
  32. build_package () {
  33. rm -Rf amath
  34. rm -f amath-${version}_$1.deb
  35. sh configure CFLAGS=$2
  36. make clean
  37. echo "Building $3 bit package of amath ${version} for Debian ..."
  38. make static
  39. mv amath amath.tmp
  40. # Create filesystem layout
  41. mkdir -m 755 amath
  42. mkdir -m 755 amath/DEBIAN
  43. mkdir -m 755 amath/usr/
  44. mkdir -m 755 amath/usr/bin
  45. mkdir -m 755 amath/usr/share
  46. mkdir -m 755 amath/usr/share/amath
  47. mkdir -m 755 amath/usr/share/man
  48. mkdir -m 755 amath/usr/share/man/man1
  49. mkdir -m 755 amath/usr/share/man/man3
  50. mkdir -m 755 amath/usr/share/doc
  51. mkdir -m 755 amath/usr/share/doc/amath
  52. # Copy binaries
  53. mv amath.tmp amath/usr/bin/amath
  54. chmod 0755 amath/usr/bin/amath
  55. # Copy documentation
  56. cp HISTORY amath/usr/share/doc/amath/changelog
  57. gzip --best -n amath/usr/share/doc/amath/changelog
  58. cp README amath/usr/share/doc/amath/
  59. gzip --best -n amath/usr/share/doc/amath/README
  60. chmod 644 amath/usr/share/doc/amath/*
  61. # Copy man pages
  62. cat amath.1 | sed '/SEE ALSO/,+1 d' > amath/usr/share/man/man1/amath.1
  63. gzip --best -n amath/usr/share/man/man1/amath.1
  64. chmod 644 amath/usr/share/man/man1/*
  65. # Copy scripts
  66. cp script/* amath/usr/share/amath/
  67. chmod 644 amath/usr/share/amath/*
  68. # Create control file
  69. {
  70. echo "Package: amath"
  71. echo "Version: ${version}"
  72. echo "Architecture: $1"
  73. echo "Maintainer: Carsten Sonne Larsen <cs@innolan.net>"
  74. echo "Installed-Size: $4"
  75. echo "Depends: libc6"
  76. echo "Section: math"
  77. echo "Priority: optional"
  78. echo "Homepage: https://amath.innolan.net"
  79. echo "Built-Using: gcc-7.3"
  80. echo "Description: Simple command line calculator"
  81. echo " Features a case sensitive command line interface, internal IEEE 754"
  82. echo " calculations with 15 significant digits, calculations with real and"
  83. echo " complex numbers, variables and user defined functions, logarithmic"
  84. echo " and exponential functions, trigonometric and hyperbolic function"
  85. echo " and selected mathematical constants and rounding functions."
  86. } >amath/DEBIAN/control
  87. chmod 0755 amath/DEBIAN/control
  88. # Create copyright file
  89. # Refer to https://www.debian.org/doc/debian-policy/ch-docs.html#s-copyrightfile
  90. {
  91. echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/"
  92. echo "Upstream-Name: amath"
  93. echo "Source: https://amath.innolan.net"
  94. echo
  95. echo "Files: *"
  96. echo "Copyright: 2014-2018 Carsten Sonne Larsen <cs@innolan.net>"
  97. echo " 2007 The NetBSD Foundation, Inc."
  98. echo " 1990, 1993 The Regents of the University of California."
  99. echo "License: BSD-2-Clause"
  100. echo " Redistribution and use in source and binary forms, with or without"
  101. echo " modification, are permitted provided that the following conditions are met:"
  102. echo " ."
  103. echo " Redistributions of source code must retain the above copyright notice, this"
  104. echo " list of conditions and the following disclaimer."
  105. echo " ."
  106. echo " Redistributions in binary form must reproduce the above copyright notice,"
  107. echo " this list of conditions and the following disclaimer in the documentation"
  108. echo " and/or other materials provided with the distribution."
  109. echo " ."
  110. echo " THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""
  111. echo " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"
  112. echo " IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE"
  113. echo " DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE"
  114. echo " FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"
  115. echo " DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"
  116. echo " SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"
  117. echo " CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,"
  118. echo " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE"
  119. echo " OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
  120. } >amath/usr/share/doc/amath/copyright
  121. chmod 644 amath/usr/share/doc/amath/*
  122. fakeroot dpkg-deb --build amath
  123. mv amath.deb amath-${version}_$1.deb
  124. rm -Rf amath
  125. }
  126. build_package 'amd64' '' 64 320
  127. build_package 'i386' '-m32' 32 322