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.

builddebdev 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. # THIS SCRIPT IS NOT READY FOR PRODUCTION !
  31. set -e
  32. version="1.8.4"
  33. build_package () {
  34. rm -Rf amath
  35. rm -f amath.deb
  36. rm -f amath-dev-${version}_$1.deb
  37. sh configure CFLAGS=$2
  38. make clean
  39. echo "Building $3 bit package of amath-dev ${version} for Debian ..."
  40. make
  41. mv amath amath.tmp
  42. # Create filesystem layout
  43. mkdir -m 755 amath
  44. mkdir -m 755 amath/DEBIAN
  45. mkdir -m 755 amath/usr/
  46. mkdir -m 755 amath/usr/bin
  47. mkdir -m 755 amath/usr/lib
  48. mkdir -m 755 amath/usr/lib/pkgconfig
  49. mkdir -m 755 amath/usr/include
  50. mkdir -m 755 amath/usr/share
  51. mkdir -m 755 amath/usr/share/amath
  52. mkdir -m 755 amath/usr/share/man
  53. mkdir -m 755 amath/usr/share/man/man1
  54. mkdir -m 755 amath/usr/share/man/man3
  55. mkdir -m 755 amath/usr/share/doc
  56. mkdir -m 755 amath/usr/share/doc/amath-dev
  57. # Copy binaries
  58. mv amath.tmp amath/usr/bin/amath
  59. chmod 0755 amath/usr/bin/amath
  60. mv src/lib/static/libamathapp.a amath/usr/lib/libamathapp.a
  61. chmod 0644 amath/usr/lib/libamathapp.a
  62. mv src/lib/libamathapp.so amath/usr/lib/libamathapp.so.${version}
  63. chmod 0644 amath/usr/lib/libamathapp.so.${version}
  64. mv src/clib/static/libamathc.a amath/usr/lib/libamathc.a
  65. chmod 0644 amath/usr/lib/libamathc.a
  66. mv src/clib/libamathc.so amath/usr/lib/libamathc.so.${version}
  67. chmod 0644 amath/usr/lib/libamathc.so.${version}
  68. mv src/real/static/libamath.a amath/usr/lib/libamath.a
  69. chmod 0644 amath/usr/lib/libamath.a
  70. mv src/real/libamath.so amath/usr/lib/libamath.so.${version}
  71. chmod 0644 amath/usr/lib/libamath.so.${version}
  72. mv src/cplex/static/libamathcplex.a amath/usr/lib/libamathcplex.a
  73. chmod 0644 amath/usr/lib/libamathcplex.a
  74. mv src/cplex/libamathcplex.so amath/usr/lib/libamathcplex.so.${version}
  75. chmod 0644 amath/usr/lib/libamathcplex.so.${version}
  76. # Copy pkg-config files
  77. cp src/lib/amatha.pc amath/usr/lib/pkgconfig/amatha.pc
  78. cp src/clib/amathc.pc amath/usr/lib/pkgconfig/amathc.pc
  79. cp src/real/amathr.pc amath/usr/lib/pkgconfig/amathr.pc
  80. cp src/cplex/amathi.pc amath/usr/lib/pkgconfig/amathi.pc
  81. chmod 644 amath/usr/lib/pkgconfig/*
  82. # Copy includes
  83. cp src/amath.h amath/usr/include/amath.h
  84. cp src/amathc.h amath/usr/include/amathc.h
  85. cp src/amatht.h amath/usr/include/amatht.h
  86. cp src/mathi.h amath/usr/include/amathi.h
  87. cp src/mathr.h amath/usr/include/amathr.h
  88. chmod 644 amath/usr/include/*
  89. # Copy documentation
  90. cp HISTORY amath/usr/share/doc/amath-dev/changelog
  91. gzip --best -n amath/usr/share/doc/amath-dev/changelog
  92. cp README amath/usr/share/doc/amath-dev/
  93. gzip --best -n amath/usr/share/doc/amath-dev/README
  94. chmod 644 amath/usr/share/doc/amath-dev/*
  95. # Copy man pages
  96. cp amath.1 amath/usr/share/man/man1/amath.1
  97. cp src/clib/amathc.3 amath/usr/share/man/man3/amathc.3
  98. cp src/real/amathr.3 amath/usr/share/man/man3/amathr.3
  99. cp src/cplex/amathi.3 amath/usr/share/man/man3/amathi.3
  100. gzip --best -n amath/usr/share/man/man1/amath.1
  101. gzip --best -n amath/usr/share/man/man3/amathc.3
  102. gzip --best -n amath/usr/share/man/man3/amathr.3
  103. gzip --best -n amath/usr/share/man/man3/amathi.3
  104. chmod 644 amath/usr/share/man/man1/*
  105. chmod 644 amath/usr/share/man/man3/*
  106. # Copy scripts
  107. cp script/* amath/usr/share/amath/
  108. chmod 644 amath/usr/share/amath/*
  109. # Create control file
  110. {
  111. echo "Package: amath-dev"
  112. echo "Version: ${version}"
  113. echo "Architecture: $1"
  114. echo "Maintainer: Carsten Sonne Larsen <cs@innolan.net>"
  115. echo "Installed-Size: $4"
  116. echo "Depends: libc6"
  117. echo "Section: math"
  118. echo "Priority: optional"
  119. echo "Homepage: https://amath.innolan.net"
  120. echo "Built-Using: gcc-5.4"
  121. echo "Description: Simple command line calculator"
  122. echo " Features a case sensitive command line interface, internal IEEE 754"
  123. echo " calculations with 15 significant digits, calculations with real and"
  124. echo " complex numbers, variables and user defined functions, logarithmic"
  125. echo " and exponential functions, trigonometric and hyperbolic function"
  126. echo " and selected mathematical constants and rounding functions."
  127. } >amath/DEBIAN/control
  128. chmod 0755 amath/DEBIAN/control
  129. # Create license file
  130. {
  131. echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/"
  132. echo "Upstream-Name: amath-dev"
  133. echo "Source: https://amath.innolan.net"
  134. echo
  135. echo "Files: *"
  136. echo "Copyright: 2014-2018 Carsten Sonne Larsen <cs@innolan.net>"
  137. echo " 2007 The NetBSD Foundation, Inc."
  138. echo " 1990, 1993 The Regents of the University of California."
  139. echo "License: BSD-2-Clause"
  140. echo " Redistribution and use in source and binary forms, with or without"
  141. echo " modification, are permitted provided that the following conditions are met:"
  142. echo " ."
  143. echo " Redistributions of source code must retain the above copyright notice, this"
  144. echo " list of conditions and the following disclaimer."
  145. echo " ."
  146. echo " Redistributions in binary form must reproduce the above copyright notice,"
  147. echo " this list of conditions and the following disclaimer in the documentation"
  148. echo " and/or other materials provided with the distribution."
  149. echo " ."
  150. echo " THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\""
  151. echo " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE"
  152. echo " IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE"
  153. echo " DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE"
  154. echo " FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL"
  155. echo " DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR"
  156. echo " SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER"
  157. echo " CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,"
  158. echo " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE"
  159. echo " OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
  160. } >amath/usr/share/doc/amath-dev/copyright
  161. chmod 644 amath/usr/share/doc/amath-dev/copyright
  162. {
  163. echo "libamath ${version}"
  164. echo "libamathc ${version}"
  165. echo "libamathcplex ${version}"
  166. echo "libamathapp ${version}"
  167. } >amath/DEBIAN/shlibs
  168. chmod 0644 amath/DEBIAN/shlibs
  169. # Create post install script
  170. {
  171. echo "#!/bin/sh"
  172. echo "set -e"
  173. echo "ln -s /usr/lib/libamathapp.so.${version} /usr/lib/libamathapp.so"
  174. echo "ln -s /usr/lib/libamathc.so.${version} /usr/lib/libamathc.so"
  175. echo "ln -s /usr/lib/libamath.so.${version} /usr/lib/libamath.so"
  176. echo "ln -s /usr/lib/libamathcplex.so.${version} /usr/lib/libamathcplex.so"
  177. echo "ldconfig"
  178. } >amath/DEBIAN/postinst
  179. chmod 0755 amath/DEBIAN/postinst
  180. # Create post remove script
  181. {
  182. echo "#!/bin/sh"
  183. echo "set -e"
  184. echo "if [ "\$1" = "remove" ]; then"
  185. echo "ldconfig"
  186. echo "fi"
  187. echo "rm -f /usr/lib/libamathapp.so.${version}"
  188. echo "rm -f /usr/lib/libamathc.so.${version}"
  189. echo "rm -f /usr/lib/libamath.so.${version}"
  190. echo "rm -f /usr/lib/libamathcplex.so.${version}"
  191. } >amath/DEBIAN/postrm
  192. chmod 0755 amath/DEBIAN/postrm
  193. fakeroot dpkg-deb --build amath
  194. mv amath.deb amath-dev-${version}_$1.deb
  195. rm -Rf amath
  196. }
  197. build_package 'amd64' '' 64 980
  198. build_package 'i386' '-m32' 32 980