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 6.9KB

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